/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return basePattern.getUType(); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return p1.getUType(); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return p1.getUType(); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return wrappedPattern.getUType(); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return wrappedPattern.getUType(); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return basePattern.getUType(); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return getBasePattern().getUType(); }
/** * Get a UType indicating which kinds of items this Pattern can match. * * @return a UType indicating all the primitive types of item that the pattern can match. */ @Override public UType getUType() { return getBasePattern().getUType(); }
/** * Get a NodeTest to use as a filter for nodes, given a pattern. */ private static NodeTest getNodeTestForPattern(Pattern pattern) { ItemType type = pattern.getItemType(); if (type instanceof NodeTest) { return (NodeTest) type; } else if (pattern.getUType().overlaps(UType.ANY_NODE)) { return AnyNodeTest.getInstance(); } else { return ErrorType.getInstance(); } }
/** * Get a NodeTest to use as a filter for nodes, given a pattern. */ private static NodeTest getNodeTestForPattern(Pattern pattern) { ItemType type = pattern.getItemType(); if (type instanceof NodeTest) { return (NodeTest) type; } else if (pattern.getUType().overlaps(UType.ANY_NODE)) { return AnyNodeTest.getInstance(); } else { return ErrorType.getInstance(); } }
/** * Convert the pattern to a typed pattern, in which an element name is treated as * schema-element(N) * * @param val either "strict" or "lax" depending on the value of xsl:mode/@typed * @return either the original pattern unchanged, or a new pattern as the result of the * conversion * @throws net.sf.saxon.trans.XPathException if the pattern cannot be converted */ @Override public Pattern convertToTypedPattern(String val) throws XPathException { if (upperPattern.getUType().equals(UType.DOCUMENT)) { // suggests a pattern starting with a leading slash Pattern b2 = basePattern.convertToTypedPattern(val); if (b2 == basePattern) { return this; } else { return new AncestorQualifiedPattern(b2, upperPattern, upwardsAxis); } } else { Pattern u2 = upperPattern.convertToTypedPattern(val); if (u2 == upperPattern) { return this; } else { return new AncestorQualifiedPattern(basePattern, u2, upwardsAxis); } } }
/** * Convert the pattern to a typed pattern, in which an element name is treated as * schema-element(N) * * @param val either "strict" or "lax" depending on the value of xsl:mode/@typed * @return either the original pattern unchanged, or a new pattern as the result of the * conversion * @throws net.sf.saxon.trans.XPathException if the pattern cannot be converted */ @Override public Pattern convertToTypedPattern(String val) throws XPathException { if (upperPattern.getUType().equals(UType.DOCUMENT)) { // suggests a pattern starting with a leading slash Pattern b2 = basePattern.convertToTypedPattern(val); if (b2 == basePattern) { return this; } else { return new AncestorQualifiedPattern(b2, upperPattern, upwardsAxis); } } else { Pattern u2 = upperPattern.convertToTypedPattern(val); if (u2 == upperPattern) { return this; } else { return new AncestorQualifiedPattern(basePattern, u2, upwardsAxis); } } }
public void addRule(Pattern pattern, Rule newRule) { UType uType = pattern.getUType(); if (uType.equals(UType.ELEMENT)) { int fp = pattern.getFingerprint(); addRuleToNamedOrUnnamedChain( newRule, fp, unnamedElementRuleChain, namedElementRuleChains); } else if (uType.equals(UType.ATTRIBUTE)) { int fp = pattern.getFingerprint(); addRuleToNamedOrUnnamedChain( newRule, fp, unnamedAttributeRuleChain, namedAttributeRuleChains); } else if (uType.equals(UType.DOCUMENT)) { addRuleToList(newRule, documentRuleChain); } else if (uType.equals(UType.TEXT)) { addRuleToList(newRule, textRuleChain); } else if (uType.equals(UType.COMMENT)) { addRuleToList(newRule, commentRuleChain); } else if (uType.equals(UType.PI)) { addRuleToList(newRule, processingInstructionRuleChain); } else if (uType.equals(UType.NAMESPACE)) { addRuleToList(newRule, namespaceRuleChain); } else if (UType.ANY_ATOMIC.subsumes(uType)) { addRuleToList(newRule, atomicValueRuleChain); } else if (UType.FUNCTION.subsumes(uType)) { addRuleToList(newRule, functionItemRuleChain); } else { addRuleToList(newRule, genericRuleChain); } }
public void addRule(Pattern pattern, Rule newRule) { UType uType = pattern.getUType(); if (uType.equals(UType.ELEMENT)) { int fp = pattern.getFingerprint(); addRuleToNamedOrUnnamedChain( newRule, fp, unnamedElementRuleChain, namedElementRuleChains); } else if (uType.equals(UType.ATTRIBUTE)) { int fp = pattern.getFingerprint(); addRuleToNamedOrUnnamedChain( newRule, fp, unnamedAttributeRuleChain, namedAttributeRuleChains); } else if (uType.equals(UType.DOCUMENT)) { addRuleToList(newRule, documentRuleChain); } else if (uType.equals(UType.TEXT)) { addRuleToList(newRule, textRuleChain); } else if (uType.equals(UType.COMMENT)) { addRuleToList(newRule, commentRuleChain); } else if (uType.equals(UType.PI)) { addRuleToList(newRule, processingInstructionRuleChain); } else if (uType.equals(UType.NAMESPACE)) { addRuleToList(newRule, namespaceRuleChain); } else if (UType.ANY_ATOMIC.subsumes(uType)) { addRuleToList(newRule, atomicValueRuleChain); } else if (UType.FUNCTION.subsumes(uType)) { addRuleToList(newRule, functionItemRuleChain); } else { addRuleToList(newRule, genericRuleChain); } }