private lux.xpath.NodeTest nodeTestFor (DocumentNodeTest nodeTest) { NodeTest elementTest = nodeTest.getElementTest(); int nameCode = elementTest.getFingerprint(); return new lux.xpath.NodeTest (ValueType.DOCUMENT, qnameForNameCode(nameCode)); }
/** * Make an ItemType representing a document-node() test with an embedded element test. * This reflects the XPath syntax <code>document-node(element(N, T))</code> or * <code>document-node(schema-element(N))</code>. * <p>It is undefined whether two calls supplying the same argument values will * return the same ItemType object.</p> * * @param elementTest the elementTest. An IllegalArgumentException is thrown if the supplied * ItemTest is not an elementTest or schemaElementTest. * @return a new ItemType representing the document test */ public ItemType getDocumentTest(ItemType elementTest) { net.sf.saxon.type.ItemType test = elementTest.getUnderlyingItemType(); if (test.getPrimitiveType() != Type.ELEMENT) { throw new IllegalArgumentException("Supplied itemType is not an element test"); } DocumentNodeTest docTest = new DocumentNodeTest((NodeTest) test); return new ConstructedItemType(docTest, processor); }
/** * Test whether this node test is satisfied by a given node on a TinyTree. The node * must be a document, element, text, comment, or processing instruction node. * This method is provided * so that when navigating a TinyTree a node can be rejected without * actually instantiating a NodeInfo object. * * @param tree the TinyTree containing the node * @param nodeNr the number of the node within the TinyTree * @return true if the node matches the NodeTest, otherwise false */ public boolean matches(TinyTree tree, int nodeNr) { if (tree.getNodeKind(nodeNr) != Type.DOCUMENT) { return false; } return matches(tree.getNode(nodeNr)); }
if (t1 instanceof DocumentNodeTest) { if (t2 instanceof DocumentNodeTest) { contentRelationship = relationship(((DocumentNodeTest) t1).getElementTest(), ((DocumentNodeTest) t2).getElementTest()); } else { contentRelationship = SUBSUMED_BY;
/** * Make an ItemType representing a document-node() test with an embedded element test. * This reflects the XPath syntax <code>document-node(element(N, T))</code> or * <code>document-node(schema-element(N))</code>. * <p>It is undefined whether two calls supplying the same argument values will * return the same ItemType object.</p> * * @param elementTest the elementTest. An IllegalArgumentException is thrown if the supplied * ItemTest is not an elementTest or schemaElementTest. * @return a new ItemType representing the document test */ public ItemType getDocumentTest(ItemType elementTest) { net.sf.saxon.type.ItemType test = elementTest.getUnderlyingItemType(); if (test.getPrimitiveType() != Type.ELEMENT) { throw new IllegalArgumentException("Supplied itemType is not an element test"); } DocumentNodeTest docTest = new DocumentNodeTest((NodeTest) test); return new ConstructedItemType(docTest, processor); }
/** * Test whether this node test is satisfied by a given node on a TinyTree. The node * must be a document, element, text, comment, or processing instruction node. * This method is provided * so that when navigating a TinyTree a node can be rejected without * actually instantiating a NodeInfo object. * * @param tree the TinyTree containing the node * @param nodeNr the number of the node within the TinyTree * @return true if the node matches the NodeTest, otherwise false */ public boolean matches(TinyTree tree, int nodeNr) { if (tree.getNodeKind(nodeNr) != Type.DOCUMENT) { return false; } return matches(tree.getNode(nodeNr)); }
if (t1 instanceof DocumentNodeTest) { if (t2 instanceof DocumentNodeTest) { contentRelationship = relationship(((DocumentNodeTest) t1).getElementTest(), ((DocumentNodeTest) t2).getElementTest()); } else { contentRelationship = SUBSUMED_BY;
/** * Make an ItemType representing a document-node() test with an embedded element test. * This reflects the XPath syntax <code>document-node(element(N, T))</code> or * <code>document-node(schema-element(N))</code>. * * <p>It is undefined whether two calls supplying the same argument values will * return the same ItemType object.</p> * * @param elementTest the elementTest. An IllegalArgumentException is thrown if the supplied * ItemTest is not an elementTest or schemaElementTest. * @return a new ItemType representing the document test */ public ItemType getDocumentTest(ItemType elementTest) { net.sf.saxon.type.ItemType test = elementTest.getUnderlyingItemType(); if (test.getPrimitiveType() != Type.ELEMENT) { throw new IllegalArgumentException("Supplied itemType is not an element test"); } DocumentNodeTest docTest = new DocumentNodeTest((NodeTest)test); return new ItemType(docTest, processor); }
contentRelationship = relationship(((DocumentNodeTest)t1).getElementTest(), ((DocumentNodeTest)t2).getElementTest()); } else { contentRelationship = SUBSUMED_BY;
return NodeKindTest.DOCUMENT; } else { return new DocumentNodeTest((NodeTest) elementType);
contentRelationship = relationship(((DocumentNodeTest)t1).getElementTest(), ((DocumentNodeTest)t2).getElementTest()); } else { contentRelationship = SUBSUMED_BY;
return NodeKindTest.DOCUMENT; } else { return new DocumentNodeTest((NodeTest) elementType);
NodeTest elementTest = ((DocumentNodeTest) contextType).getElementTest(); Optional<IntSet> outermostElementNames = elementTest.getRequiredNodeNames(); if (outermostElementNames.isPresent()) {
return NodeKindTest.DOCUMENT; } else { return new DocumentNodeTest((NodeTest)elementType);
NodeTest elementTest = ((DocumentNodeTest) contextType).getElementTest(); Optional<IntSet> outermostElementNames = elementTest.getRequiredNodeNames(); if (outermostElementNames.isPresent()) {
return NodeKindTest.DOCUMENT; } else { return new DocumentNodeTest((NodeTest)elementType);
NodeTest elementTest = ((DocumentNodeTest)contextItemType).getElementTest(); IntHashSet requiredNames = elementTest.getRequiredNodeNames(); if (requiredNames != null) {
expect(Token.RPAR); nextToken(); return new DocumentNodeTest(inner);
NodeTest elementTest = ((DocumentNodeTest)contextItemType).getElementTest(); IntHashSet requiredNames = elementTest.getRequiredNodeNames(); if (requiredNames != null) {
expect(Token.RPAR); nextToken(); return new DocumentNodeTest(inner);