Package org.jdom.input

Examples of org.jdom.input.SAXBuilder


     
     
        ByteArrayInputStream bai;
        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


            usersFile = DEFAULT_USERS_FILE;


        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

    _config.removeChild("commands");
    ByteArrayInputStream bai;
    try {
      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

      if(!new File(xmlFilename).exists()) {
        MainWindow.message(jobParameterShell, "Missing Job Description " + xmlFilename , SWT.OK );
        return listOfParams;
      }

      SAXBuilder builder = new SAXBuilder();

      Document doc = builder.build( new File( xmlFilename ) );
      Element root = doc.getRootElement();       
      Element config = root.getChild("configuration", root.getNamespace());
      if(config == null) {
        return listOfParams;
      }
View Full Code Here

      Iterator fileIterator = filelist.iterator();

      while (fileIterator.hasNext()) {
        xmlFilename = fileIterator.next().toString();

        SAXBuilder builder = new SAXBuilder();
        Document doc = builder.build( new File( xmlFilename ) );
        Element root = doc.getRootElement();
        List listMainElements = root.getChildren()
        HashMap h = null;
        for( int i=0; i<listMainElements.size(); i++ ){         
          Element elMain  = (Element)(listMainElements.get( i ));
View Full Code Here

    Element root        = null;         
    Element order       = null

    try {

      SAXBuilder builder = new SAXBuilder();

      if(doc == null) {

        File f = null;
        if(xmlFilename != null)
          f = new File(xmlFilename);
        if(f==null || !f.exists()) {         
          String xml = createConfigurationFile();

          doc = builder.build(new StringReader(xml));
          if(type == Editor.DETAILS) {
            if(f != null)
              f.deleteOnExit();         
            dom.setDoc(doc);
          }
        } else {       
          doc = builder.build( new File( xmlFilename ) );
          if(type == Editor.DETAILS) {
            dom.setDoc(doc);
          }
        }
View Full Code Here

  }

  private Element createNewNoteElement(String text) {
    Element newNote = null;
    try {
      SAXBuilder builder = new SAXBuilder();
      Document doc = builder.build(new StringReader(text));
      newNote = doc.getRootElement();
    } catch (Exception e) {
      try {
        new sos.scheduler.editor.app.ErrorLog("error in " + sos.util.SOSClassUtil.getMethodName() , e);
      } catch(Exception ee) {
View Full Code Here

*/
public class JDOMParser implements XMLParser {

    public Object parseXML(InputStream stream) {
        try {
            SAXBuilder builder = new SAXBuilder();
            return builder.build(stream);
        }
        catch (Exception ex) {
            throw new JXPathException("JDOM parser error", ex);
        }
    }
View Full Code Here

     */
    public void createTitleSet() throws Exception {
        guiTitles = new HashMap<String, Boolean>(90);

        String compref = "../xdocs/usermanual/component_reference.xml";
        SAXBuilder bldr = new SAXBuilder();
        Document doc;
        doc = bldr.build(compref);
        Element root = doc.getRootElement();
        Element body = root.getChild("body");
        @SuppressWarnings("unchecked")
        List<Element> sections = body.getChildren("section");
        for (int i = 0; i < sections.size(); i++) {
View Full Code Here

     */
    public void createTagSet() throws Exception {
        guiTags = new HashMap<String, Boolean>(90);

        String compref = "../xdocs/usermanual/component_reference.xml";
        SAXBuilder bldr = new SAXBuilder();
        Document doc;
        doc = bldr.build(compref);
        Element root = doc.getRootElement();
        Element body = root.getChild("body");
        @SuppressWarnings("unchecked")
        List<Element> sections = body.getChildren("section");
        for (int i = 0; i < sections.size(); i++) {
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.