/** * Set the properties for this indenter * * @param props the serialization properties */ public void setOutputProperties(Properties props) { String s = props.getProperty(SaxonOutputKeys.SUPPRESS_INDENTATION); if (s != null) { suppressed = new HashSet<>(8); StringTokenizer st = new StringTokenizer(s, " \t\r\n"); while (st.hasMoreTokens()) { String clarkName = st.nextToken(); suppressed.add(FingerprintedQName.fromClarkName(clarkName).getLocalPart().toLowerCase()); } } }
/** * Set the properties for this indenter * * @param props the serialization properties */ public void setOutputProperties(Properties props) { String s = props.getProperty(SaxonOutputKeys.SUPPRESS_INDENTATION); if (s != null) { suppressed = new HashSet<>(8); StringTokenizer st = new StringTokenizer(s, " \t\r\n"); while (st.hasMoreTokens()) { String clarkName = st.nextToken(); suppressed.add(FingerprintedQName.fromClarkName(clarkName).getLocalPart().toLowerCase()); } } }
/** * Get the fingerprint of this name, allocating a new code from the namepool if necessary * * @param pool the NamePool used to allocate the name * @return a fingerprint for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool pool) { if (fingerprint == -1) { fingerprint = pool.allocateFingerprint(getURI(), getLocalPart()); } return fingerprint; }
/** * Get the fingerprint of this name, allocating a new code from the namepool if necessary * * @param pool the NamePool used to allocate the name * @return a fingerprint for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool pool) { if (fingerprint == -1) { fingerprint = pool.allocateFingerprint(getURI(), getLocalPart()); } return fingerprint; }
public boolean equals(/*@NotNull*/ Object other) { if (other instanceof NodeName) { if (fingerprint != -1 && ((NodeName) other).hasFingerprint()) { return getFingerprint() == ((NodeName) other).getFingerprint(); } else { return getLocalPart().equals(((NodeName) other).getLocalPart()) && isInSameNamespace((NodeName) other); } } else { return false; } }
public boolean equals(/*@NotNull*/ Object other) { if (other instanceof NodeName) { if (fingerprint != -1 && ((NodeName) other).hasFingerprint()) { return getFingerprint() == ((NodeName) other).getFingerprint(); } else { return getLocalPart().equals(((NodeName) other).getLocalPart()) && isInSameNamespace((NodeName) other); } } else { return false; } }
path.addPathSegment(AxisType.ATTRIBUTE, an.getURI(), an.getLocalPart());
@Override public Item evaluateItem(XPathContext context) throws XPathException { Item item = context.getContextItem(); if (item instanceof TinyElementImpl) { // fast path String val = ((TinyElementImpl) item).getAttributeValue(attributeName.getFingerprint()); return val == null ? null : new UntypedAtomicValue(val); } if (item == null) { // This doesn't actually happen, we don't create an AttributeGetter unless we know statically dynamicError("The context item for @" + attributeName.getDisplayName() + " is absent", "XPDY0002", context); } if (!(item instanceof NodeInfo)) { typeError("The context item for @" + attributeName.getDisplayName() + " is not a node", "XPDY0002", context); } assert item instanceof NodeInfo; NodeInfo node = (NodeInfo) item; if (node.getNodeKind() == Type.ELEMENT) { String val = node.getAttributeValue(attributeName.getURI(), attributeName.getLocalPart()); return val == null ? null : new UntypedAtomicValue(val); } else { return null; } }
@Override public Item evaluateItem(XPathContext context) throws XPathException { Item item = context.getContextItem(); if (item instanceof TinyElementImpl) { // fast path String val = ((TinyElementImpl) item).getAttributeValue(attributeName.getFingerprint()); return val == null ? null : new UntypedAtomicValue(val); } if (item == null) { dynamicError("The context item for @" + attributeName.getDisplayName() + " is absent", "XPDY0002", context); } if (!(item instanceof NodeInfo)) { typeError("The context item for @" + attributeName.getDisplayName() + " is not a node", "XPDY0002", context); } assert item instanceof NodeInfo; NodeInfo node = (NodeInfo) item; if (node.getNodeKind() == Type.ELEMENT) { String val = node.getAttributeValue(attributeName.getURI(), attributeName.getLocalPart()); return val == null ? null : new UntypedAtomicValue(val); } else { return null; } }