Package org.dom4j

Examples of org.dom4j.Element.selectNodes()


            for (Iterator<Element> it = document.getRootElement().elementIterator("contact"); it.hasNext();) {
                Element contactElement = it.next();

                Node nomElement = contactElement.selectSingleNode("nom");
                Node prenomElement = contactElement.selectSingleNode("prenom");
                List<Node> emailsElement = contactElement.selectNodes("email");
                Node descriptionElement = contactElement.selectSingleNode("description");

                Contact contact = new Contact();
                contact.setNom(nomElement.getText());
                contact.setPrenom(prenomElement.getText());
View Full Code Here


    xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set/element");
    list = xpath.selectNodes(document);
    assertEquals("Expected to get one element 'element'", 1, list.size());
    node = (Element) list.get(0);
    assertEquals(node.attribute( "type" ).getText(), "string");
    list = node.selectNodes("column");
    assertEquals("Expected to get one element 'column'", 1, list.size());
    node = (Element) list.get(0);
    assertEquals(node.attribute( "name" ).getText(), "text");
  }
View Full Code Here

      // TODO: add support for inline service class definition
      pws.setServiceBeanId( getProperty( node, "ref" ) ); //$NON-NLS-1$
      pws.setServiceClass( getProperty( node, "class" ) ); //$NON-NLS-1$

      Collection<String> extraClasses = new ArrayList<String>();
      List<?> extraNodes = node.selectNodes( "extra" ); //$NON-NLS-1$
      for ( Object extra : extraNodes ) {
        Element extraElement = (Element) extra;
        String extraClass = getProperty( extraElement, "class" ); //$NON-NLS-1$
        if ( extraClasses != null ) {
          extraClasses.add( extraClass );
View Full Code Here

        contentInfo.setTitle( title );
        contentInfo.setExtension( extension );
        contentInfo.setMimeType( mimeType );
        contentInfo.setIconUrl( iconUrl );

        List<?> operationNodes = node.selectNodes( "operations/operation" ); //$NON-NLS-1$
        for ( Object operationObj : operationNodes ) {
          Element operationNode = (Element) operationObj;
          String id = XmlDom4JHelper.getNodeText( "id", operationNode, "" ); //$NON-NLS-1$ //$NON-NLS-2$
          String perspective = XmlDom4JHelper.getNodeText( "perspective", operationNode, "" ); //$NON-NLS-1$ //$NON-NLS-2$
          if ( StringUtils.isNotEmpty( id ) ) {
View Full Code Here

      callMethods( Arrays.asList( new Method[] { loggerMethod } ), getLogger() );
    }

    Map<String, Object> inputMap = new HashMap<String, Object>();
    // look at the component settings
    List<?> nodes = defnNode.selectNodes( "*" ); //$NON-NLS-1$
    for ( int idx = 0; idx < nodes.size(); idx++ ) {
      Element node = (Element) nodes.get( idx );
      // inputs may typically contain a dash in them, such as
      // something like "report-definition" and we should expect
      // a setter as setReportDefinition, so we will remove the
View Full Code Here

    List rows = node.selectNodes( "static-lov/rows/row" ); //$NON-NLS-1$
    List data = new LinkedList();
    for ( Iterator it = rows.iterator(); it.hasNext(); ) {
      Element rowItem = (Element) it.next();
      List items = rowItem.selectNodes( "item" );
      List row = new LinkedList();
      for ( Iterator itt = items.iterator(); itt.hasNext(); ) {
        Element item = (Element) itt.next();
        String value = item.getStringValue();
        row.add( value );
View Full Code Here

        final Tuple<String, Element> result = importer.unmarshal(new StAXSource(xmlEventReader));
       
        assertNotNull(result);
       
        final Element document = result.getSecond();
        final List<org.dom4j.Node> comments = document.selectNodes("//comment()");
        for (final org.dom4j.Node comment : comments) {
            comment.detach();
        }
       
        final StringWriter writer = new StringWriter();
View Full Code Here

      DOMBuilder domBuilder = new DOMBuilder();
      Document document = domBuilder.getDocument(transformationsXML);
        Element rootElement = document.getRootElement();
       
      String transformationXPath = "//transformation";
      List transformationElements = rootElement.selectNodes(transformationXPath);
      logger.info("transformationElements:" + transformationElements.size());
     
      /*
      <transformations>
        <transformation inputFilePattern=".*(jpeg|jpg|gif|png).*" keepOriginal="false">
View Full Code Here

     
        String name = propertySet.attributeValue("name");
        String clazz = propertySet.attributeValue("class");
       
        // get args now
        List args = propertySet.selectNodes("arg");
        Map argsMap = new HashMap();
        Iterator argsIterator = args.iterator();
        while(argsIterator.hasNext())
        {
            Element arg = (Element) argsIterator.next();
View Full Code Here

      DOMBuilder domBuilder = new DOMBuilder();
      Document document = domBuilder.getDocument(transformationsXML);
        Element rootElement = document.getRootElement();
       
      String transformationXPath = "//transformation";
      List transformationElements = rootElement.selectNodes(transformationXPath);
      logger.info("transformationElements:" + transformationElements.size());
     
      /*
      <transformations>
        <transformation inputFilePattern=".*(jpeg|jpg|gif|png).*" keepOriginal="false">
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.