Package org.dom4j

Examples of org.dom4j.Document.selectNodes()


            DocumentType docType = doc.getDocType();

            if (docType != null && "svn".equalsIgnoreCase(docType.getName())) {
                items = new ArrayList();

                addNodes(items, doc.selectNodes("//dir/@name"), true);
                addNodes(items, doc.selectNodes("//file/@name"), false);
            }
        } else if (doc != null && !xml) {
            Node title = doc.selectSingleNode("//head/title");
View Full Code Here


            if (docType != null && "svn".equalsIgnoreCase(docType.getName())) {
                items = new ArrayList();

                addNodes(items, doc.selectNodes("//dir/@name"), true);
                addNodes(items, doc.selectNodes("//file/@name"), false);
            }
        } else if (doc != null && !xml) {
            Node title = doc.selectSingleNode("//head/title");

            if (title != null && title.getText() != null && title.getText().indexOf("Revision") > 0) {
View Full Code Here

            }
        } else if (doc != null && !xml) {
            Node title = doc.selectSingleNode("//head/title");

            if (title != null && title.getText() != null && title.getText().indexOf("Revision") > 0) {
                List nodes = doc.selectNodes("//ul/li/a/@href");

                items = new ArrayList();

                for (Iterator i = nodes.iterator(); i.hasNext();) {
                    Node node = (Node) i.next();
View Full Code Here

    }
   
    public void runUnitTest(String name) throws Exception {
        Document document = parseUnitTest(name);
       
        List failures = document.selectNodes( "/*/fail" );
        for ( Iterator iter = failures.iterator(); iter.hasNext(); ) {
            Node node = (Node) iter.next();
            fail( node.getStringValue() );
        }
    }
View Full Code Here

     */
    public void load(InputStream input) throws Exception
    {
        log("Loading toolbox...");
        Document document = new SAXReader().read(input);
        List elements = document.selectNodes("//"+BASE_NODE+"/*");

        int elementsRead = 0;
        Iterator i = elements.iterator();
        while(i.hasNext())
        {
View Full Code Here

        init();
        if (xmlString == null) {
            return;
        }
        Document document = XmlUtils.parse(xmlString);       
        for (Element e : (List<Element>) document.selectNodes(FIELD_XPATH)) {
            Field field = new Field(e);           
            fields.put(field.getName(), field);
        }      
        for (Element e : (List<Element>) document.selectNodes(ROLE_XPATH)) {
            Role role = new Role(e);           
View Full Code Here

        Document document = XmlUtils.parse(xmlString);       
        for (Element e : (List<Element>) document.selectNodes(FIELD_XPATH)) {
            Field field = new Field(e);           
            fields.put(field.getName(), field);
        }      
        for (Element e : (List<Element>) document.selectNodes(ROLE_XPATH)) {
            Role role = new Role(e);           
            roles.put(role.getName(), role);
        }
        for (Element e : (List<Element>) document.selectNodes(STATE_XPATH)) {
            String key = e.attributeValue(STATUS);
View Full Code Here

        }      
        for (Element e : (List<Element>) document.selectNodes(ROLE_XPATH)) {
            Role role = new Role(e);           
            roles.put(role.getName(), role);
        }
        for (Element e : (List<Element>) document.selectNodes(STATE_XPATH)) {
            String key = e.attributeValue(STATUS);
            String value = e.attributeValue(LABEL);
            states.put(Integer.parseInt(key), value);
        }       
        for (Element e : (List<Element>) document.selectNodes(FIELD_ORDER_XPATH)) {
View Full Code Here

        for (Element e : (List<Element>) document.selectNodes(STATE_XPATH)) {
            String key = e.attributeValue(STATUS);
            String value = e.attributeValue(LABEL);
            states.put(Integer.parseInt(key), value);
        }       
        for (Element e : (List<Element>) document.selectNodes(FIELD_ORDER_XPATH)) {
            String fieldName = e.attributeValue(NAME);
            fieldOrder.add(Field.convertToName(fieldName));
        }        
    }       
   
View Full Code Here

          if ( outputStream.size() > 0 ) {
            Document document = parseText( outputStream.toString() );

            // exclude all parameters that are of type "system", xactions set system params that have to be ignored.
            @SuppressWarnings ( "rawtypes" )
            List nodes = document.selectNodes( "parameters/parameter" );
            for ( int i = 0; i < nodes.size() && !hasParameters; i++ ) {
              Element elem = (Element) nodes.get( i );
              if ( elem.attributeValue( "name" ).equalsIgnoreCase( "output-target" )
                  && elem.attributeValue( "is-mandatory" ).equalsIgnoreCase( "true" ) ) {
                hasParameters = true;
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.