/** * Get the type of the result of this instruction. An xsl:variable instruction returns nothing, so the * type is empty. * @return the empty type. * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return EmptySequenceTest.getInstance(); }
/** * Get the item type of the items returned by evaluating this instruction * @return the static item type of the instruction. This is empty: the result-document instruction * returns nothing. * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return EmptySequenceTest.getInstance(); }
/** * Determine the item type * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return EmptySequenceTest.getInstance(); }
/** * Determine the item type * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return EmptySequenceTest.getInstance(); }
/** * Get the type of the result of this instruction. An xsl:variable instruction returns nothing, so the * type is empty. * @return the empty type. * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return EmptySequenceTest.getInstance(); }
/** * Determine the item type * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return EmptySequenceTest.getInstance(); }
/** * Get the item type of the items returned by evaluating this instruction * @return the static item type of the instruction. This is empty: the result-document instruction * returns nothing. * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return EmptySequenceTest.getInstance(); }
/** * Determine the data type of the items returned by this expression * @return the data type * @param th the type hierarchy cache */ public final ItemType getItemType(TypeHierarchy th) { if (children==null || children.length==0) { return EmptySequenceTest.getInstance(); } ItemType t1 = children[0].getItemType(th); for (int i=1; i<children.length; i++) { t1 = Type.getCommonSuperType(t1, children[i].getItemType(th), th); if (t1 instanceof AnyItemType) { return t1; // no point going any further } } return t1; }
/** * Determine the data type of the items returned by this expression * @return the data type * @param th the type hierarchy cache */ public final ItemType getItemType(TypeHierarchy th) { if (children==null || children.length==0) { return EmptySequenceTest.getInstance(); } ItemType t1 = children[0].getItemType(th); for (int i=1; i<children.length; i++) { t1 = Type.getCommonSuperType(t1, children[i].getItemType(th), th); if (t1 instanceof AnyItemType) { return t1; // no point going any further } } return t1; }
if (principalNodeType == Type.ELEMENT && (kind == Type.ATTRIBUTE || kind == Type.NAMESPACE)) { test = EmptySequenceTest.getInstance(); } else if (principalNodeType == Type.ATTRIBUTE && (kind == Type.COMMENT || kind == Type.TEXT || kind == Type.PROCESSING_INSTRUCTION || kind == Type.ELEMENT || kind == Type.DOCUMENT)) { test = EmptySequenceTest.getInstance();
if (principalNodeType == Type.ELEMENT && (kind == Type.ATTRIBUTE || kind == Type.NAMESPACE)) { test = EmptySequenceTest.getInstance(); } else if (principalNodeType == Type.ATTRIBUTE && (kind == Type.COMMENT || kind == Type.TEXT || kind == Type.PROCESSING_INSTRUCTION || kind == Type.ELEMENT || kind == Type.DOCUMENT)) { test = EmptySequenceTest.getInstance();
/** * Get the item type of the items returned by evaluating this instruction * * @return the static item type of the instruction * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { if (matching != null) { if (nonMatching != null) { return Type.getCommonSuperType(matching.getItemType(th), nonMatching.getItemType(th), th); } else { return matching.getItemType(th); } } else { if (nonMatching != null) { return nonMatching.getItemType(th); } else { return EmptySequenceTest.getInstance(); } } }
/** * Get the item type of the items returned by evaluating this instruction * * @return the static item type of the instruction * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { if (matching != null) { if (nonMatching != null) { return Type.getCommonSuperType(matching.getItemType(th), nonMatching.getItemType(th), th); } else { return matching.getItemType(th); } } else { if (nonMatching != null) { return nonMatching.getItemType(th); } else { return EmptySequenceTest.getInstance(); } } }
/** * Make a union node test for a set of supplied element fingerprints * @param elements the set of integer element fingerprints to be tested for * @param pool the name pool * @return a NodeTest that returns true if the node is an element whose name is one of the names * in this set */ private NodeTest makeUnionNodeTest(IntHashSet elements, NamePool pool) { NodeTest test = null; for (IntIterator iter = elements.iterator(); iter.hasNext();) { int fp = iter.next(); NodeTest nextTest = new NameTest(Type.ELEMENT, fp, pool); if (test == null) { test = nextTest; } else { test = new CombinedNodeTest(test, Token.UNION, nextTest); } } if (test == null) { return EmptySequenceTest.getInstance(); } else { return test; } }
/** * Make a union node test for a set of supplied element fingerprints * @param elements the set of integer element fingerprints to be tested for * @param pool the name pool * @return a NodeTest that returns true if the node is an element whose name is one of the names * in this set */ private NodeTest makeUnionNodeTest(IntHashSet elements, NamePool pool) { NodeTest test = null; for (IntIterator iter = elements.iterator(); iter.hasNext();) { int fp = iter.next(); NodeTest nextTest = new NameTest(Type.ELEMENT, fp, pool); if (test == null) { test = nextTest; } else { test = new CombinedNodeTest(test, Token.UNION, nextTest); } } if (test == null) { return EmptySequenceTest.getInstance(); } else { return test; } }
/** * Make a union node test for a set of supplied element fingerprints * @param elements the set of integer element fingerprints to be tested for * @param pool the name pool * @return a NodeTest that returns true if the node is an element whose name is one of the names * in this set */ private NodeTest makeUnionNodeTest(IntHashSet elements, NamePool pool) { NodeTest test = null; for (IntIterator iter = elements.iterator(); iter.hasNext();) { int fp = iter.next(); NodeTest nextTest = new NameTest(Type.ELEMENT, fp, pool); if (test == null) { test = nextTest; } else { test = new CombinedNodeTest(test, Token.UNION, nextTest); } } if (test == null) { return EmptySequenceTest.getInstance(); } else { return test; } }
/** * Get the most general type of item returned by the children of this instruction * * @return the lowest common supertype of the item types returned by the children */ protected ItemType getCommonChildItemType() { final TypeHierarchy th = getConfiguration().getTypeHierarchy(); ItemType t = EmptySequenceTest.getInstance(); AxisIterator children = iterateAxis(Axis.CHILD); while (true) { NodeInfo next = (NodeInfo)children.next(); if (next == null) { return t; } if (next instanceof StyleElement) { ItemType ret = ((StyleElement)next).getReturnedItemType(); if (ret != null) { t = Type.getCommonSuperType(t, ret, th); } } else { t = Type.getCommonSuperType(t, NodeKindTest.TEXT, th); } if (t == AnyItemType.getInstance()) { return t; // no point looking any further } } }
/** * Get the most general type of item returned by the children of this instruction * * @return the lowest common supertype of the item types returned by the children */ protected ItemType getCommonChildItemType() { final TypeHierarchy th = getConfiguration().getTypeHierarchy(); ItemType t = EmptySequenceTest.getInstance(); AxisIterator children = iterateAxis(Axis.CHILD); while (true) { NodeInfo next = (NodeInfo)children.next(); if (next == null) { return t; } if (next instanceof StyleElement) { ItemType ret = ((StyleElement)next).getReturnedItemType(); if (ret != null) { t = Type.getCommonSuperType(t, ret, th); } } else { t = Type.getCommonSuperType(t, NodeKindTest.TEXT, th); } if (t == AnyItemType.getInstance()) { return t; // no point looking any further } } }
expect(Token.RPAR); nextToken(); return SequenceType.makeSequenceType(EmptySequenceTest.getInstance(), StaticProperty.EMPTY);
expect(Token.RPAR); nextToken(); return SequenceType.makeSequenceType(EmptySequenceTest.getInstance(), StaticProperty.EMPTY);