/** * Make a LocalNameTest (*:name) * * @param nodeType the kind of node to be matched * @param localName the requred local name * @throws XPathException if the local name is invalid * @return a LocalNameTest, a pattern which matches all nodes of a given * local name, regardless of namespace */ public LocalNameTest makeLocalNameTest(short nodeType, String localName) throws XPathException { if (!nameChecker.isValidNCName(localName)) { grumble("Local name [" + localName + "] contains invalid characters"); } return new LocalNameTest(env.getNamePool(), nodeType, localName); }
/** * Make a LocalNameTest (*:name) * * @param nodeType the kind of node to be matched * @param localName the requred local name * @throws XPathException if the local name is invalid * @return a LocalNameTest, a pattern which matches all nodes of a given * local name, regardless of namespace */ public LocalNameTest makeLocalNameTest(short nodeType, String localName) throws XPathException { if (!nameChecker.isValidNCName(localName)) { grumble("Local name [" + localName + "] contains invalid characters"); } return new LocalNameTest(env.getNamePool(), nodeType, localName); }
/** * Make a LocalNameTest (*:name) * * @param nodeType the kind of node to be matched * @param localName the requred local name * @return a LocalNameTest, a pattern which matches all nodes of a given * local name, regardless of namespace * @throws XPathException if the local name is invalid */ /*@NotNull*/ public LocalNameTest makeLocalNameTest(short nodeType, String localName) throws XPathException { if (!NameChecker.isValidNCName(localName)) { grumble("Local name [" + localName + "] contains invalid characters"); } return new LocalNameTest(env.getConfiguration().getNamePool(), nodeType, localName); }
/** * Make a LocalNameTest (*:name) * * @param nodeType the kind of node to be matched * @param localName the requred local name * @return a LocalNameTest, a pattern which matches all nodes of a given * local name, regardless of namespace * @throws XPathException if the local name is invalid */ /*@NotNull*/ public LocalNameTest makeLocalNameTest(short nodeType, String localName) throws XPathException { if (!NameChecker.isValidNCName(localName)) { grumble("Local name [" + localName + "] contains invalid characters"); } return new LocalNameTest(env.getConfiguration().getNamePool(), nodeType, localName); }
nt = new LocalNameTest( getNamePool(), Type.ELEMENT,
nt = new LocalNameTest( getNamePool(), Type.ELEMENT,
/** * Helper method to construct a NodeTest for use with the {@link NodeInfo#iterateAxis} method * @param pool the NamePool. The relevant NamePool can be obtained by calling the method * {@link NodeInfo#getNamePool}. * @param nodeKind The kind of node required, for example {@link Type#ELEMENT} or {@link Type#ATTRIBUTE}. * To select nodes of any kind, use {@link Type#NODE}. * @param uri The namespace URI of the nodes to be selected. Supply null to selects nodes from any * namespace or none. Supply "" to select nodes that are not in a namespace. * @param localName The local name of the nodes to be selected. Supply null to select nodes irrespective * of their local name. * @return a NodeTest that matches the requested nodes * @since 9.0 */ public static NodeTest makeNodeTest(NamePool pool, int nodeKind, String uri, String localName) { if (uri == null && localName == null) { return NodeKindTest.makeNodeKindTest(nodeKind); } else if (uri == null) { return new LocalNameTest(pool, nodeKind, localName); } else if (localName == null) { return new NamespaceTest(pool, nodeKind, uri); } else { int fp = pool.allocate("", uri, localName); return new NameTest(nodeKind, fp, pool); } }
/** * Helper method to construct a NodeTest for use with the {@link NodeInfo#iterateAxis} method * * @param pool the NamePool. * @param nodeKind The kind of node required, for example {@link Type#ELEMENT} or {@link Type#ATTRIBUTE}. * To select nodes of any kind, use {@link Type#NODE}. * @param uri The namespace URI of the nodes to be selected. Supply null to selects nodes from any * namespace or none. Supply "" to select nodes that are not in a namespace. * @param localName The local name of the nodes to be selected. Supply null to select nodes irrespective * of their local name. * @return a NodeTest that matches the requested nodes * @since 9.0 */ /*@Nullable*/ public static NodeTest makeNodeTest(/*@NotNull*/ NamePool pool, int nodeKind, /*@Nullable*/ String uri, /*@Nullable*/ String localName) { if (uri == null && localName == null) { return NodeKindTest.makeNodeKindTest(nodeKind); } else if (uri == null) { return new LocalNameTest(pool, nodeKind, localName); } else if (localName == null) { return new NamespaceTest(pool, nodeKind, uri); } else { int fp = pool.allocateFingerprint(uri, localName); return new NameTest(nodeKind, fp, pool); } }
/** * Helper method to construct a NodeTest for use with the {@link NodeInfo#iterateAxis} method * @param pool the NamePool. The relevant NamePool can be obtained by calling the method * {@link NodeInfo#getNamePool}. * @param nodeKind The kind of node required, for example {@link Type#ELEMENT} or {@link Type#ATTRIBUTE}. * To select nodes of any kind, use {@link Type#NODE}. * @param uri The namespace URI of the nodes to be selected. Supply null to selects nodes from any * namespace or none. Supply "" to select nodes that are not in a namespace. * @param localName The local name of the nodes to be selected. Supply null to select nodes irrespective * of their local name. * @return a NodeTest that matches the requested nodes * @since 9.0 */ public static NodeTest makeNodeTest(NamePool pool, int nodeKind, String uri, String localName) { if (uri == null && localName == null) { return NodeKindTest.makeNodeKindTest(nodeKind); } else if (uri == null) { return new LocalNameTest(pool, nodeKind, localName); } else if (localName == null) { return new NamespaceTest(pool, nodeKind, uri); } else { int fp = pool.allocate("", uri, localName); return new NameTest(nodeKind, fp, pool); } }
/** * Helper method to construct a NodeTest for use with the {@link NodeInfo#iterateAxis} method * * @param pool the NamePool. * @param nodeKind The kind of node required, for example {@link Type#ELEMENT} or {@link Type#ATTRIBUTE}. * To select nodes of any kind, use {@link Type#NODE}. * @param uri The namespace URI of the nodes to be selected. Supply null to selects nodes from any * namespace or none. Supply "" to select nodes that are not in a namespace. * @param localName The local name of the nodes to be selected. Supply null to select nodes irrespective * of their local name. * @return a NodeTest that matches the requested nodes * @since 9.0 */ /*@Nullable*/ public static NodeTest makeNodeTest(/*@NotNull*/ NamePool pool, int nodeKind, /*@Nullable*/ String uri, /*@Nullable*/ String localName) { if (uri == null && localName == null) { return NodeKindTest.makeNodeKindTest(nodeKind); } else if (uri == null) { return new LocalNameTest(pool, nodeKind, localName); } else if (localName == null) { return new NamespaceTest(pool, nodeKind, uri); } else { int fp = pool.allocateFingerprint(uri, localName); return new NameTest(nodeKind, fp, pool); } }
test = new LocalNameTest(getNamePool(), Type.ELEMENT, localname); addWildCardTest(componentTypeCode, test);
test = new LocalNameTest(getNamePool(), Type.ELEMENT, localname); addWildCardTest(componentTypeCode, test);
nt = new LocalNameTest( getNamePool(), Type.ELEMENT,
nt = new LocalNameTest( getNamePool(), Type.ELEMENT,
nt = new LocalNameTest(getNamePool(), Type.ELEMENT, localname); rules.addRule(nt, preserve, decl.getModule(), decl.getSourceElement().getLineNumber());
nt = new LocalNameTest(getNamePool(), Type.ELEMENT, localname); rules.addRule(nt, preserve, decl.getModule(), decl.getSourceElement().getLineNumber());