Package org.jdom.xpath

Examples of org.jdom.xpath.XPath.selectSingleNode()


      ArrayList<String> stateList = new ArrayList<String>();
     
      try {
        String jobChainname = getCommandAttribute("job_chain");       
        XPath x3 = XPath.newInstance("//job_chain[@name='"+ jobChainname + "']");
        Element jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
       
        if(jobChain == null) {
          jobChainname = getCommandAttribute("job_chain_node.job_chain");
          x3 = XPath.newInstance("//job_chain_node.job_chain[@name='"+ jobChainname + "']");
            jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
View Full Code Here


        Element jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
       
        if(jobChain == null) {
          jobChainname = getCommandAttribute("job_chain_node.job_chain");
          x3 = XPath.newInstance("//job_chain_node.job_chain[@name='"+ jobChainname + "']");
            jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
             
        }
        if(jobChain == null)
          return retVal;
       
View Full Code Here

      ArrayList stateList = new ArrayList();
     
      try {
        String jobChainname = Utils.getAttributeValue("job_chain", getCommand());       
        XPath x3 = XPath.newInstance("//job_chain[@name='"+ jobChainname + "']");
        Element jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
       
        if(jobChain == null) {
          jobChainname = Utils.getAttributeValue("job_chain_node.job_chain", getCommand());
          x3 = XPath.newInstance("//job_chain_node.job_chain[@name='"+ jobChainname + "']");
            jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
View Full Code Here

        Element jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
       
        if(jobChain == null) {
          jobChainname = Utils.getAttributeValue("job_chain_node.job_chain", getCommand());
          x3 = XPath.newInstance("//job_chain_node.job_chain[@name='"+ jobChainname + "']");
            jobChain = (Element)x3.selectSingleNode(_dom.getDoc());
           
        }
        if(jobChain == null)
          return retVal;
       
View Full Code Here

        final XPath hint = XPath.newInstance( "//component[position()=1]/role-hint/text()" );
        final XPath implementation = XPath.newInstance( "//component[position()=1]/implementation/text()" );

        assertEquals( "role", ( (Text) role.selectSingleNode( doc ) ).getText() );
        assertNull( hint.selectSingleNode( doc ) );
        assertEquals( "impl", ( (Text) implementation.selectSingleNode( doc ) ).getText() );
    }

    public void testAddToArchive_ShouldWriteComponentWithHintToFile()
        throws IOException, ArchiverException, JDOMException
    {
View Full Code Here

        final XPath hint = XPath.newInstance( "//component[position()=1]/role-hint/text()" );
        final XPath implementation = XPath.newInstance( "//component[position()=1]/implementation/text()" );

        assertEquals( "role", ( (Text) role.selectSingleNode( doc ) ).getText() );
        assertEquals( "hint", ( (Text) hint.selectSingleNode( doc ) ).getText() );
        assertEquals( "impl", ( (Text) implementation.selectSingleNode( doc ) ).getText() );
    }

    public void testAddToArchive_ShouldWriteTwoComponentToFile()
        throws IOException, ArchiverException, JDOMException
    {
View Full Code Here

        final XPath hint = XPath.newInstance( "//component[position()=1]/role-hint/text()" );
        final XPath implementation = XPath.newInstance( "//component[position()=1]/implementation/text()" );

        assertEquals( "role", ( (Text) role.selectSingleNode( doc ) ).getText() );
        assertEquals( "hint", ( (Text) hint.selectSingleNode( doc ) ).getText() );
        assertEquals( "impl", ( (Text) implementation.selectSingleNode( doc ) ).getText() );

        final XPath role2 = XPath.newInstance( "//component[position()=2]/role/text()" );
        final XPath hint2 = XPath.newInstance( "//component[position()=2]/role-hint/text()" );
        final XPath implementation2 = XPath.newInstance( "//component[position()=2]/implementation/text()" );
View Full Code Here

        final XPath hint2 = XPath.newInstance( "//component[position()=2]/role-hint/text()" );
        final XPath implementation2 = XPath.newInstance( "//component[position()=2]/implementation/text()" );

        assertEquals( "role", ( (Text) role2.selectSingleNode( doc ) ).getText() );
        assertEquals( "hint2", ( (Text) hint2.selectSingleNode( doc ) ).getText() );
        assertEquals( "impl", ( (Text) implementation2.selectSingleNode( doc ) ).getText() );

    }

    public void testAddToArchive_ShouldWriteTwoComponentToArchivedFile()
        throws IOException, ArchiverException, JDOMException
View Full Code Here

        final XPath hint = XPath.newInstance( "//component[position()=1]/role-hint/text()" );
        final XPath implementation = XPath.newInstance( "//component[position()=1]/implementation/text()" );

        assertEquals( "role", ( (Text) role.selectSingleNode( doc ) ).getText() );
        assertEquals( "hint", ( (Text) hint.selectSingleNode( doc ) ).getText() );
        assertEquals( "impl", ( (Text) implementation.selectSingleNode( doc ) ).getText() );

        final XPath role2 = XPath.newInstance( "//component[position()=2]/role/text()" );
        final XPath hint2 = XPath.newInstance( "//component[position()=2]/role-hint/text()" );
        final XPath implementation2 = XPath.newInstance( "//component[position()=2]/implementation/text()" );
View Full Code Here

        final XPath hint2 = XPath.newInstance( "//component[position()=2]/role-hint/text()" );
        final XPath implementation2 = XPath.newInstance( "//component[position()=2]/implementation/text()" );

        assertEquals( "role", ( (Text) role2.selectSingleNode( doc ) ).getText() );
        assertEquals( "hint2", ( (Text) hint2.selectSingleNode( doc ) ).getText() );
        assertEquals( "impl", ( (Text) implementation2.selectSingleNode( doc ) ).getText() );

    }

    private Xpp3Dom createComponentDom( final ComponentDef def )
    {
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.