Package org.jdom.input

Examples of org.jdom.input.SAXBuilder


        getBootProgressMonitor().updateProgress(4);
        for (Enumeration<URL> e = getClass().getClassLoader().getResources("META-INF/contextConfig-definitions.xml"); e
                        .hasMoreElements();) {
            URL u = e.nextElement();
            log.info("Loading context property definitions from " + u);
            SAXBuilder build = new SAXBuilder();
            Element root = build.build(u).getRootElement();
            if (!root.getName().equals("definitions")) {
                throw new JDOMException("Root element in " + u + " should be <definitions>");
            }
            for (Iterator i = root.getChildren().iterator(); i.hasNext();) {
                Element c = (Element) i.next();
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

        }
        element.attribute = getLiveAttributes(element);
       }
      
        String encoding = "ISO-8859-1";
    SAXBuilder builder = new org.jdom.input.SAXBuilder();
    String xml = "<?xml version=\"1.0\" encoding=\""+ encoding + "\"?> ";
    xml +=  "<" + rootElement.element_name + " " + rootElement.attribute + "></" + rootElement.element_name+">";
    spooler_log.debug3(xml);
    Document parentDoc = builder.build(new java.io.StringReader(xml));
    Element root = parentDoc.getRootElement();
  
     it=listOfElements.iterator();
        element = (JobSchedulerMetadataElement)it.next();
View Full Code Here

  
   private void getXml() {
 
      try {
        // ---- Read XML file ----
        SAXBuilder builder = new SAXBuilder();
        doc = builder.build( xmlFile );
      
        XMLOutputter fmt = new XMLOutputter();
        fmt.setFormat( Format.getPrettyFormat() )// only for nicer formatting
        // fmt.output( doc, System.out );
      } catch( Exception ex ) {
View Full Code Here

    public static void readSchemaVersion() {
     
     
      try {
        //String schema = _properties.getProperty("editor.xml.xsd");
        SAXBuilder builder = new SAXBuilder(false);
       
      Document doc = builder.build(System.class.getResource(Options.getSchema()).toString());
     
      XPath x = XPath.newInstance("//xsd:documentation");         
      List<Element> listOfElement = x.selectNodes(doc);
      if(!listOfElement.isEmpty()) {
        Element e = listOfElement.get(0);
View Full Code Here

    Element order       = null
    //Element params_     = null;
    List process     = null;

    try {
      SAXBuilder builder = new SAXBuilder();
      filename = _dom.getFilename();
      if(filename == null || filename.length() == 0)
        return list;

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

      root = doc.getRootElement();

      Element application = root.getChild("job_chain");
      if(application == null) {
View Full Code Here

    listOfReadOnly = new ArrayList();
    listOfChangeElementNames = new ArrayList();

    try {
      SAXBuilder builder = new SAXBuilder();

      String xml = createConfigurationFile();

      parentDoc = builder.build(new StringReader(xml));

      root = parentDoc.getRootElement();
      if (root != null) {
        config = root.getChild("config");
      }
View Full Code Here

  }

  private void addContains(Element parent, String name, String mask) {

    // SAXBuilder builder = new SAXBuilder(true);
    SAXBuilder builder = null;
    Document currDocument = null;
    String jobXMLFilename = "";
    try {
      builder = getBuilder(false);
      Vector filelist = SOSFile.getFilelist(getNormalizedFile(path)
          .getAbsolutePath(), mask,
          java.util.regex.Pattern.CASE_INSENSITIVE);
      Iterator orderIterator = filelist.iterator();
      while (orderIterator.hasNext()) {
        try {
          jobXMLFilename = orderIterator.next().toString();
          File jobXMLFile = new File(jobXMLFilename);
          currDocument = builder.build(jobXMLFile);

          Element xmlRoot = currDocument.getRootElement();
          if (xmlRoot != null) {
            if (parent == null) {
              // config hat keinen Kindknoten {name}, also
View Full Code Here

      System.out.println("error: " + e.getMessage());
    }
  }

  private void addContainsForOrder(Element parent, String name, String mask) {
    SAXBuilder builder = new SAXBuilder();
    Document currDocument = null;
    try {
      Vector filelist = SOSFile.getFilelist(getNormalizedFile(path)
          .getAbsolutePath(), mask,
          java.util.regex.Pattern.CASE_INSENSITIVE);
      Iterator orderIterator = filelist.iterator();
      while (orderIterator.hasNext()) {
        String xmlFilename = orderIterator.next().toString();
        File xmlFile = new File(xmlFilename);
        currDocument = builder.build(xmlFile);
        Element xmlRoot = currDocument.getRootElement();
        if (xmlRoot != null) {
          if (parent == null) {
            // config hat keinen Kindknoten {name}, also erzeugen
            parent = new Element(name);
View Full Code Here

    String originalFilename = filename;
    filename = filename + "~";

    try {
      // system.out.println("********************************************************************");
      SAXBuilder builder2 = getBuilder(false);
      Document doc = builder2.build(new StringReader(xml));
      // test
      SchedulerDom dom = new SchedulerDom(SchedulerDom.DIRECTORY);
      // dom.setInit(true);

      new File(originalFilename).delete();
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.