Package org.jdom.input

Examples of org.jdom.input.SAXBuilder


  }

  public String getJobname(String filename) {
    String jobname = "";
    try {
      SAXBuilder builder = new SAXBuilder();

      // String xml = createConfigurationFile();

      Document doc = builder.build(new File(filename));

      Element root = doc.getRootElement();

      jobname = Utils.getAttributeValue("name", root);
View Full Code Here


  }

  public static Element readElementFromHotHolderFile(File file) {
    Element elem = null;
    try {
      SAXBuilder builder = new SAXBuilder();

      // String xml = createConfigurationFile();

      Document doc = builder.build(file);

      elem = doc.getRootElement();
      String name = file.getName().substring(0,
          file.getName().indexOf("."));
View Full Code Here

    this.listOfChangeElementNames = listOfChangeElementNames;
  }

  protected SAXBuilder getBuilder(boolean validate) throws IOException {

    SAXBuilder builder = new SAXBuilder(validate);
    if (validate) {

      builder.setProperty(
          "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
          "http://www.w3.org/2001/XMLSchema");
      builder.setProperty(
          "http://java.sun.com/xml/jaxp/properties/schemaSource",
          writeSchemaFile());

    }
View Full Code Here

     */
    public void createAllocationReport() throws Exception
    {
        // 1. Teil: Informationen aus XML in Objekte �bertragen
       
        SAXBuilder builder = new SAXBuilder();
       
        SystemProcesses processes = new SystemProcesses();
       
       
        ArrayList<File> files = new FileCollector(
                reportsLocation,
                "MemoryAllocationReport",
                "xml").collect();

        Timestamp created = new Timestamp(new GregorianCalendar());
        FileOutputStream os1 = new FileOutputStream(
                new File(reportsLocation + "/MemoryAllocationReportAddressSpace_"
                        + created.forFilenames() + ".csv"));

        String csvLine = "pid;created;size;count;reserved_virtual;total_virtual;avail_virtual;total_physical";
        csvLine += ";avail_physical;total_pagefile;avail_pagefile;memoryload\n";
        os1.write(csvLine.getBytes());

       
        for (File f : files) {
            System.out.println("file:" + f.getAbsolutePath());
            Document document = builder.build(f);
            System.out.println(document.getRootElement().getName());
       
            XPath xpath = XPath.newInstance("/spooler/answer");
            Element e = (Element)xpath.selectSingleNode(document);
            String timeStamp = e.getAttributeValue("time");
View Full Code Here

//                "C:/PerfLog/System/Performance/Sammlungssatz-performance/Sammlungssatz-performance",
                reportsLocation + "/Sammlungssatz-performance",
                "report",
                "xml").collect();
       
        SAXBuilder builder = new SAXBuilder();

        FileOutputStream os = new FileOutputStream(new File( reportsLocation + "/MemoryAllocationReport2" + ".csv"));

        String csvLine = "Shot At;Pid;Private Bytes";
        csvLine += "\n";
        os.write(csvLine.getBytes());
       
        for (File f : files) {
            Document document = builder.build(f);
            System.out.println(document.getRootElement().getName() + "file:" + f.getAbsolutePath());
       
            boolean schedulerProcessFound = false;
            XPath xpath = XPath.newInstance("//Table[@name='TableWorkingSet']/Item/Data[@name='process' and . = 'scheduler']/following-sibling::node()[@name='pid']");
            Element e = (Element)xpath.selectSingleNode(document);
View Full Code Here

    xmlPaths = (xmlPaths.endsWith("/") || xmlPaths.endsWith("\\") ? xmlPaths.concat(include) : xmlPaths.concat("/").concat(include));   

    try {

      SAXBuilder builder = new SAXBuilder();
      Document doc = builder.build( new File( xmlPaths ) );
      Element root = doc.getRootElement();       
      Element config = root.getChild("configuration", root.getNamespace());
      Element params = config.getChild("params", config.getNamespace());
      if(params == null)
        return;
View Full Code Here

      if(!(new java.io.File(filename).exists())) {
        return;
      }
     
      SAXBuilder builder = new SAXBuilder();
      Document   doc= builder.build(filename);
      String xml = Utils.getElementAsString(doc.getRootElement());
      Utils.showClipboard(xml, getShell(), false, null, false, null, false);
     
    } catch (Exception ex) {
      MainWindow.message( "could not open Holiday File" + ex.getMessage(), SWT.ICON_ERROR);
View Full Code Here

*/
    protected SAXBuilder getBuilder(boolean validate) throws IOException {

     
        SAXBuilder builder = new SAXBuilder(validate);
        if (validate) {
         
            builder.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
                    "http://www.w3.org/2001/XMLSchema");
                       
            builder.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", writeSchemaFile());

        }
       
        return builder;
       
View Full Code Here

          tabFolder.setSelection(tabFolder.getItem(i));
          return;
        }       
      }

      SAXBuilder builder = new SAXBuilder();


      final Document   doc= builder.build(filename);           
      java.util.List listOfElement = null;
      if(txtIncludeNode.getText() != null && txtIncludeNode.getText().length() > 0) {
        XPath x = XPath.newInstance(txtIncludeNode.getText());
        //Element e = (Element)x.selectSingleNode(doc);
        listOfElement = x.selectNodes(doc);                               
View Full Code Here

  public org.eclipse.swt.widgets.Composite openQuick(String xmlFilename) {

    try {             
      if (xmlFilename != null && xmlFilename.length() > 0) {
        SAXBuilder builder = new SAXBuilder();      
        org.jdom.Document doc = builder.build( new File( xmlFilename ) );       
        org.jdom.Element root = doc.getRootElement();
        if(root.getName().equalsIgnoreCase("description")) {
          return openDocumentation(xmlFilename);
        } else if(root.getName().equalsIgnoreCase("spooler")) {
          return openScheduler(xmlFilename);
View Full Code Here

TOP

Related Classes of org.jdom.input.SAXBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.