/** * Get fingerprint. The fingerprint is a coded form of the expanded name * of the node: two nodes * with the same name code have the same namespace URI and the same local name. * A fingerprint of -1 should be returned for a node with no name. */ public int getFingerprint() { return node.getFingerprint(); }
/** * Get fingerprint. The fingerprint is a coded form of the expanded name * of the node: two nodes * with the same name code have the same namespace URI and the same local name. * A fingerprint of -1 should be returned for a node with no name. * * @return an integer fingerprint; two nodes with the same fingerprint have * the same expanded QName */ public int getFingerprint() { return original.getFingerprint(); }
/** * Get fingerprint. The fingerprint is a coded form of the expanded name * of the node: two nodes * with the same name code have the same namespace URI and the same local name. * A fingerprint of -1 should be returned for a node with no name. */ public int getFingerprint() { return node.getFingerprint(); }
/** * Get fingerprint. The fingerprint is a coded form of the expanded name * of the node: two nodes * with the same name code have the same namespace URI and the same local name. * A fingerprint of -1 should be returned for a node with no name. * * @return an integer fingerprint; two nodes with the same fingerprint have * the same expanded QName */ public int getFingerprint() { return original.getFingerprint(); }
/** * Get fingerprint. The fingerprint is a coded form of the expanded name * of the node: two nodes * with the same name code have the same namespace URI and the same local name. * A fingerprint of -1 should be returned for a node with no name. */ public int getFingerprint() { return node.getFingerprint(); }
/** * Determine whether this stylesheet does any whitespace stripping * @return true if this stylesheet strips whitespace from source documents */ public boolean stripsWhitespace() { for (int i = 0; i < topLevel.size(); i++) { NodeInfo s = (NodeInfo) topLevel.get(i); if (s.getFingerprint() == StandardNames.XSL_STRIP_SPACE) { return true; } } return false; }
/** * Determine whether this stylesheet does any whitespace stripping * @return true if this stylesheet strips whitespace from source documents */ public boolean stripsWhitespace() { for (int i = 0; i < topLevel.size(); i++) { NodeInfo s = (NodeInfo) topLevel.get(i); if (s.getFingerprint() == StandardNames.XSL_STRIP_SPACE) { return true; } } return false; }
/** * Get the first ancestor element in the stylesheet tree that has a given name, supplied by * fingerprint. * * @param fingerprint the name of the required element * @return the first (innermost) ancestor with the required name, or null if none is found */ public StyleElement findAncestorElement(int fingerprint) { Optional<NodeInfo> ancestor = iterateAxis(AxisInfo.ANCESTOR).firstWith( node -> node instanceof StyleElement && node.getFingerprint() == fingerprint); return (StyleElement) ancestor.orElse(null); }
/** * Get the first ancestor element in the stylesheet tree that has a given name, supplied by * fingerprint. * * @param fingerprint the name of the required element * @return the first (innermost) ancestor with the required name, or null if none is found */ public StyleElement findAncestorElement(int fingerprint) { Optional<NodeInfo> ancestor = iterateAxis(AxisInfo.ANCESTOR).firstWith( node -> node instanceof StyleElement && node.getFingerprint() == fingerprint); return (StyleElement) ancestor.orElse(null); }
/** * Test whether this node test is satisfied by a given node. This alternative * method is used in the case of nodes where calculating the fingerprint is expensive, * for example DOM or JDOM nodes. * @param node the node to be matched */ public boolean matches(NodeInfo node) { return node.getNodeKind() == Type.ELEMENT && group.contains(node.getFingerprint()); } /**
/** * Create a NameTest for nodes of the same type and name as a given node * @param node the node whose node kind and node name will form the basis of the NameTest */ public NameTest(NodeInfo node) { this.nodeKind = node.getNodeKind(); this.fingerprint = node.getFingerprint(); this.namePool = node.getNamePool(); }
/** * Create a NameTest for nodes of the same type and name as a given node */ public NameTest(NodeInfo node) { this.nodeKind = node.getNodeKind(); this.fingerprint = node.getFingerprint(); this.namePool = node.getNamePool(); }
/** * Test whether this node test is satisfied by a given node. This alternative * method is used in the case of nodes where calculating the fingerprint is expensive, * for example DOM or JDOM nodes. * @param node the node to be matched */ public boolean matches(NodeInfo node) { return node.getNodeKind() == Type.ELEMENT && group.contains(node.getFingerprint()); } /**
/** * Test whether this node test is satisfied by a given node. This alternative * method is used in the case of nodes where calculating the fingerprint is expensive, * for example DOM or JDOM nodes. The default implementation calls the method * {@link #matches(int, int, int)} * @param node the node to be matched */ public boolean matches(NodeInfo node) { return matches(node.getNodeKind(), node.getFingerprint(), node.getTypeAnnotation()); }
@Override public void markAttributeNode(NodeInfo origin) { int[] atts = builder.getTree().getAttributeNameCodeArray(); int used = builder.getTree().getNumberOfAttributes(); int fp = origin.getFingerprint(); for (int i=used-1; i>=0; i--) { if ((atts[i] & NamePool.FP_MASK) == fp) { markedAttribute = i; return; } } throw new IllegalStateException("Selected attribute not found"); }
/** * Test whether this node test is satisfied by a given node. This alternative * method is used in the case of nodes where calculating the fingerprint is expensive, * for example DOM or JDOM nodes. The default implementation calls the method * {@link #matches(int, int, int)} * @param node the node to be matched */ public boolean matches(NodeInfo node) { return matches(node.getNodeKind(), node.getFingerprint(), node.getTypeAnnotation()); }
private static void setTransformerParameter(Item param, Transformer transformer, NodeInfo source) throws XPathException { int fp = ((NodeInfo)param).getFingerprint(); if (fp != -1) { Value val = ((NodeInfo)param).atomize(); ((Controller)transformer).setParameter( new StructuredQName(source.getNamePool(), fp), val); } }
private static void setTransformerParameter(Item param, Transformer transformer, NodeInfo source) throws XPathException { int fp = ((NodeInfo)param).getFingerprint(); if (fp != -1) { Value val = ((NodeInfo)param).atomize(); ((Controller)transformer).setParameter( new StructuredQName(source.getNamePool(), fp), val); } }
/** * Get the fingerprint required */ public int getFingerprint() { if (origin.hasFingerprint()) { return origin.getFingerprint(); } else { NamePool pool = origin.getConfiguration().getNamePool(); return pool.allocateFingerprint(origin.getURI(), origin.getLocalPart()); } }
/** * Get the fingerprint required */ public int getFingerprint() { if (origin.hasFingerprint()) { return origin.getFingerprint(); } else { NamePool pool = origin.getConfiguration().getNamePool(); return pool.allocateFingerprint(origin.getURI(), origin.getLocalPart()); } }