Examples of NodeTest


Examples of org.apache.commons.jxpath.ri.compiler.NodeTest

     * iteration.
     */
    @Test
    public void testIterateWithUnknownTest()
    {
        NodeTest test = new ProcessingInstructionTest("test");
        ConfigurationNodeIteratorChildren it = new ConfigurationNodeIteratorChildren(
                rootPointer, test, false, null);
        assertEquals("Unknown test was not evaluated", 0, iteratorSize(it));
    }
View Full Code Here

Examples of org.apache.commons.jxpath.ri.compiler.NodeTest

                this,
                node,
                name.toString(),
                index);
        if (success) {
            NodeTest nodeTest;
            String prefix = name.getPrefix();
            if (prefix != null) {
                String namespaceURI = context.getNamespaceURI(prefix);
                nodeTest = new NodeNameTest(name, namespaceURI);
            }
View Full Code Here

Examples of org.apache.commons.jxpath.ri.compiler.NodeTest

        EvalContext context,
        NodePointer pointer,
        Step step)
    {
        if (step.getAxis() == Compiler.AXIS_CHILD) {
            NodeTest nodeTest = step.getNodeTest();
            QName qname = ((NodeNameTest) nodeTest).getNodeName();
            String prefix = qname.getPrefix();
            if (prefix != null) {
                String namespaceURI = context.getJXPathContext()
                        .getNamespaceURI(prefix);
View Full Code Here

Examples of org.apache.xpath.patterns.NodeTest

  {

    if (DEBUG)
      System.out.println("In ColumnHeader.getNextSibling");

    NodeTest nt = this.getNodeTest();
    if ((null == nt) || nt.getNamespace() == null)
    {
      if (
        (null == nt) ||
        nt.getLocalName().equals(XStatement.S_COLUMNHEADERNAME))
      {
        int nextIndex = m_columnIndex + 1;

        if (nextIndex < m_parent.m_columnHeaders.length)
        {
View Full Code Here

Examples of org.apache.xpath.patterns.NodeTest

  {

    if (DEBUG)
      System.out.println("In RowSet.getFirstChild");

    NodeTest nt = this.getNodeTest();

      // If we are asking for the Column Header branch of the Node Tree
      // or if we are asking for any branch (nt == null) then we will
      // return the First Column Header Node
    if ((null == nt) ||
      nt.getLocalName().equals(XStatement.S_COLUMNHEADERNAME))
    {
      m_RowSetPos = ROWSET_POS_COLHDR;
      return getFirstColHdr();
    }
    //
    // If we ask for the Row Branch directly then return the
    // first row. If we have been here before and we are in
    // streamable mode then return null, we can re-traverse
    // the Result Set in Streamable Mode.
    //
    // Suppporting JDBC scrollable cursors may change that
    // though.
    //
    else if (nt.getLocalName().equals(XStatement.S_ROWNAME))
    {
      m_RowSetPos = ROWSET_POS_ROW;
      return getFirstRow();
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.NodeTest

public class test_CountingNodeTester extends TestCase {
    private NodeTest test;
    private CountingNodeTester tester;

    public void testPositivePath() throws Exception {
        test = new NodeTest(new StringReader("<a><b>c</b></a>"));
        tester = new CountingNodeTester(2);
        test.performTest(tester, Node.ELEMENT_NODE);

        tester = new CountingNodeTester(1);
        test.performTest(tester, Node.TEXT_NODE);
View Full Code Here

Examples of org.custommonkey.xmlunit.NodeTest

        tester = new CountingNodeTester(0);
        test.performTest(tester, Node.COMMENT_NODE);
    }

    public void testNegativePath() throws Exception {
        test = new NodeTest(new StringReader("<a><b>c</b></a>"));
        try {
            tester = new CountingNodeTester(2);
            test.performTest(tester, Node.TEXT_NODE);
            fail("Expected NodeTestException");
        } catch (NodeTestException e) {
View Full Code Here

Examples of org.exist.xquery.NodeTest

            LocationStep lastStep = steps.get(steps.size() - 1);
            if (firstStep != null && steps.size() == 1 && firstStep.getAxis() == Constants.SELF_AXIS) {
                final Expression outerExpr = contextInfo.getContextStep();
                if (outerExpr != null && outerExpr instanceof LocationStep) {
                    final LocationStep outerStep = (LocationStep) outerExpr;
                    final NodeTest test = outerStep.getTest();
                    if (!test.isWildcardTest() && test.getName() != null) {
                        contextQName = new QName(test.getName());
                        if (outerStep.getAxis() == Constants.ATTRIBUTE_AXIS || outerStep.getAxis() == Constants.DESCENDANT_ATTRIBUTE_AXIS)
                            {contextQName.setNameType(ElementValue.ATTRIBUTE);}
                        contextStep = firstStep;
                        axis = outerStep.getAxis();
                        optimizeSelf = true;
                    }
                }
            } else if (firstStep != null && lastStep != null) {
                final NodeTest test = lastStep.getTest();
                if (!test.isWildcardTest() && test.getName() != null) {
                    contextQName = new QName(test.getName());
                    if (lastStep.getAxis() == Constants.ATTRIBUTE_AXIS || lastStep.getAxis() == Constants.DESCENDANT_ATTRIBUTE_AXIS)
                        {contextQName.setNameType(ElementValue.ATTRIBUTE);}
                    contextStep = lastStep;
                    axis = firstStep.getAxis();
                    if (axis == Constants.SELF_AXIS && steps.size() > 1) {
View Full Code Here

Examples of org.exist.xquery.NodeTest

    if (match != null)
      if (match.getLength() > 0) {
        Expression expr = match.getExpression(0);
        if (expr instanceof LocationStep) {
          LocationStep locationStep = (LocationStep) expr;
          NodeTest test = locationStep.getTest();
          if ((test.getName() == null)
              || (test.getName().getLocalName() == null))
            priority = -0.5;
          else if (locationStep.getPredicates().size() > 0)
            priority = 0.25;
          else
            priority = 0;
View Full Code Here

Examples of org.exist.xquery.NodeTest

    if (match != null)
      if (match.getLength() > 0) {
        Expression expr = match.getExpression(0);
        if (expr instanceof LocationStep) {
          LocationStep locationStep = (LocationStep) expr;
          NodeTest test = locationStep.getTest();
          if (test instanceof TypeTest) {
            if (test.getName() == null)
            return true;
          }
        }
      }
    return 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.