/** * Set the default element namespace * @param uri the namespace URI to be used as the default namespace for elements and types * @since 8.4 */ public void setDefaultElementNamespace(String uri) throws XPathException { defaultElementNamespace = uri; declareNamespace("", uri); }
/** * Set the default element namespace * * @param uri the namespace URI to be used as the default namespace for elements and types * @since 8.4 */ public void setDefaultElementNamespace(String uri) { defaultElementNamespace = uri; declareNamespace("", uri); }
/** * Set the default element namespace * @param uri the namespace URI to be used as the default namespace for elements and types * @since 8.4 */ public void setDefaultElementNamespace(String uri) { defaultElementNamespace = uri; declareNamespace("", uri); }
/** * Set the default element namespace * * @param uri the namespace URI to be used as the default namespace for elements and types * @since 8.4 */ public void setDefaultElementNamespace(String uri) { defaultElementNamespace = uri; declareNamespace("", uri); }
/** * Clear all the user-declared namespaces * * @since 9.0 */ public void clearNamespaces() { userDeclaredNamespaces.clear(); declareNamespace("xml", NamespaceConstant.XML); declareNamespace("xs", NamespaceConstant.SCHEMA); declareNamespace("xsi", NamespaceConstant.SCHEMA_INSTANCE); declareNamespace("fn", NamespaceConstant.FN); declareNamespace("local", NamespaceConstant.LOCAL); declareNamespace("err", NamespaceConstant.ERR); declareNamespace("saxon", NamespaceConstant.SAXON); declareNamespace("", ""); }
/** * Declare a namespace binding as part of the static context for queries compiled using this * XQueryCompiler. This binding may be overridden by a binding that appears in the query prolog. * The namespace binding will form part of the static context of the query, but it will not be copied * into result trees unless the prefix is actually used in an element or attribute name. * * @param prefix The namespace prefix. If the value is a zero-length string, this method sets the default * namespace for elements and types. * @param uri The namespace URI. It is possible to specify a zero-length string to "undeclare" a namespace; * in this case the prefix will not be available for use, except in the case where the prefix * is also a zero length string, in which case the absence of a prefix implies that the name * is in no namespace. * @throws NullPointerException if either the prefix or uri is null. * @throws IllegalArgumentException in the event of an invalid declaration of the XML namespace */ public void declareNamespace(String prefix, String uri) { env.declareNamespace(prefix, uri); }
/** * Clear all the user-declared namespaces * * @since 9.0 */ public void clearNamespaces() { userDeclaredNamespaces.clear(); declareNamespace("xml", NamespaceConstant.XML); declareNamespace("xs", NamespaceConstant.SCHEMA); declareNamespace("xsi", NamespaceConstant.SCHEMA_INSTANCE); declareNamespace("fn", NamespaceConstant.FN); declareNamespace("local", NamespaceConstant.LOCAL); declareNamespace("saxon", NamespaceConstant.SAXON); declareNamespace("", ""); }
/** * Clear all the user-declared namespaces * * @since 9.0 */ public void clearNamespaces() { userDeclaredNamespaces.clear(); declareNamespace("xml", NamespaceConstant.XML); declareNamespace("xs", NamespaceConstant.SCHEMA); declareNamespace("xsi", NamespaceConstant.SCHEMA_INSTANCE); declareNamespace("fn", NamespaceConstant.FN); declareNamespace("local", NamespaceConstant.LOCAL); declareNamespace("saxon", NamespaceConstant.SAXON); declareNamespace("", ""); }
/** * Declare a namespace binding as part of the static context for queries compiled using this * XQueryCompiler. This binding may be overridden by a binding that appears in the query prolog. * The namespace binding will form part of the static context of the query, but it will not be copied * into result trees unless the prefix is actually used in an element or attribute name. * * @param prefix The namespace prefix. If the value is a zero-length string, this method sets the default * namespace for elements and types. * @param uri The namespace URI. It is possible to specify a zero-length string to "undeclare" a namespace; * in this case the prefix will not be available for use, except in the case where the prefix * is also a zero length string, in which case the absence of a prefix implies that the name * is in no namespace. * @throws NullPointerException if either the prefix or uri is null. * @throws IllegalArgumentException in the event of an invalid declaration of the XML namespace */ public void declareNamespace(String prefix, String uri) { env.declareNamespace(prefix, uri); }
/** * Clear all the user-declared namespaces * * @since 9.0 */ public void clearNamespaces() { userDeclaredNamespaces.clear(); declareNamespace("xml", NamespaceConstant.XML); declareNamespace("xs", NamespaceConstant.SCHEMA); declareNamespace("xsi", NamespaceConstant.SCHEMA_INSTANCE); declareNamespace("fn", NamespaceConstant.FN); declareNamespace("local", NamespaceConstant.LOCAL); declareNamespace("err", NamespaceConstant.ERR); declareNamespace("saxon", NamespaceConstant.SAXON); declareNamespace("", ""); }
/** * Declare a namespace binding as part of the static context for queries compiled using this * XQueryCompiler. This binding may be overridden by a binding that appears in the query prolog. * The namespace binding will form part of the static context of the query, but it will not be copied * into result trees unless the prefix is actually used in an element or attribute name. * * @param prefix The namespace prefix. If the value is a zero-length string, this method sets the default * namespace for elements and types. * @param uri The namespace URI. It is possible to specify a zero-length string to "undeclare" a namespace; * in this case the prefix will not be available for use, except in the case where the prefix * is also a zero length string, in which case the absence of a prefix implies that the name * is in no namespace. * @throws NullPointerException if either the prefix or uri is null. * @throws IllegalArgumentException in the event of an invalid declaration of the XML namespace */ public void declareNamespace(String prefix, String uri) { env.declareNamespace(prefix, uri); }
/** * Declare a namespace whose prefix can be used in expressions. This is * equivalent to declaring a prefix in the Query prolog. The term "passive" * was a term from a draft XQuery proposal indicating a namespace that won't * be copied into the result tree. Passive namespaces are never undeclared. * Any namespace declared in the Query prolog overrides a namespace declared using * this API. * * @param prefix The namespace prefix. Must not be null. * @param uri The namespace URI. Must not be null. The value "" (zero-length string) is used * to undeclare a namespace; it is not an error if there is no existing binding for * the namespace prefix. * @param explicit Must be false (the value true was previously reserved for internal use, but is * no longer permitted) * @since 8.4 * @deprecated since 9.0. Use {@link #declareNamespace} */ public void declarePassiveNamespace(String prefix, String uri, boolean explicit) throws XPathException { if (explicit) { throw new IllegalArgumentException("explicit must be false"); } declareNamespace(prefix, uri); }
/** * Declare a namespace whose prefix can be used in expressions. This is * equivalent to declaring a prefix in the Query prolog. The term "passive" * was a term from a draft XQuery proposal indicating a namespace that won't * be copied into the result tree. Passive namespaces are never undeclared. * Any namespace declared in the Query prolog overrides a namespace declared using * this API. * * @param prefix The namespace prefix. Must not be null. * @param uri The namespace URI. Must not be null. The value "" (zero-length string) is used * to undeclare a namespace; it is not an error if there is no existing binding for * the namespace prefix. * @param explicit Must be false (the value true was previously reserved for internal use, but is * no longer permitted) * @since 8.4 * @deprecated since 9.0. Use {@link #declareNamespace} */ public void declarePassiveNamespace(String prefix, String uri, boolean explicit) throws XPathException { if (explicit) { throw new IllegalArgumentException("explicit must be false"); } declareNamespace(prefix, uri); }
XmlObjectXQueryEvaluatorImpl(DefaultNamespaceContext namespaceContext) { this.configuration = new Configuration(); staticQueryContext = configuration.newStaticQueryContext(); for (Map.Entry<String, String> namespaceBinding : namespaceContext.getNamespaces().entrySet()) { staticQueryContext.declareNamespace(namespaceBinding.getKey(), namespaceBinding.getValue()); } }
String namespace = st.nextToken(); int idx = namespace.indexOf(":"); sqc.declareNamespace(namespace.substring(0, idx), namespace.substring(idx + 1));
context.declareNamespace(item.getPrefix(), item.getUri()); ic.declareNamespace(item.getPrefix(), item.getUri()); namespaceMap.put(item.getPrefix(), item.getUri());
context.declareNamespace(item.getPrefix(), item.getUri()); ic.declareNamespace(item.getPrefix(), item.getUri()); saxonXQueryExpression.namespaceMap.put(item.getPrefix(), item.getUri());
context.declareNamespace(item.getPrefix(), item.getUri()); ic.declareNamespace(item.getPrefix(), item.getUri()); saxonXQueryExpression.namespaceMap.put(item.getPrefix(), item.getUri());
String[] prefixes = ctx.getNamespacePrefixes(); for (String prefix: prefixes) { sqc.declareNamespace(prefix, ctx.getNamespaceURI(prefix));