Package org.jdom.input

Examples of org.jdom.input.SAXBuilder.build()


    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


        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

        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

      }

      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

        try {       
            bai = new ByteArrayInputStream(sXML.getBytes("UTF-8"));
            SAXBuilder builder = new SAXBuilder(false);
            Document doc;

            doc = builder.build(bai);
            Element r = doc.getRootElement();
            r.detach();
           
            _settings.removeContent();
            _settings.addContent(r);
View Full Code Here


        String fullPath = getFullPath(configDir, usersFile);
        try {
            SAXBuilder builder = new SAXBuilder();
            Document document = builder.build(new File(fullPath));
            Element root = document.getRootElement();
            List userList = root.getChildren(TAG_USER);
               
            // Create user information map.
            int userListLen = userList.size();
View Full Code Here

      String s = "<commands>" + commands + "</commands>";
      bai = new ByteArrayInputStream(s.getBytes("UTF-8"));
      SAXBuilder builder = new SAXBuilder(false);
      Document doc;

      doc = builder.build(bai);
      Element r = doc.getRootElement();
      r.detach();
      _config.addContent(r);
      _dom.setChanged(true);
      _main.updateOrders();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.