public RetainedStaticContext(StaticContext sc) { this.config = sc.getConfiguration(); this.packageData = sc.getPackageData(); if (sc.getStaticBaseURI() != null) { staticBaseUriString = sc.getStaticBaseURI(); try { this.staticBaseUri = ExpressionTool.getBaseURI(sc, null, true); } catch (XPathException e) { staticBaseUri = null; } } this.defaultCollationName = sc.getDefaultCollationName(); this.decimalFormatManager = sc.getDecimalFormatManager(); this.defaultElementNamespace = sc.getDefaultElementNamespace(); defaultFunctionNamespace = sc.getDefaultFunctionNamespace(); backwardsCompatibility = sc.isInBackwardsCompatibleMode(); if (Version.platform.JAXPStaticContextCheck(this, sc)) { //updated in method } else { this.namespaces = new HashMap<>(4); NamespaceResolver resolver = sc.getNamespaceResolver(); for (Iterator<String> it = resolver.iteratePrefixes(); it.hasNext(); ) { String prefix = it.next(); if (!prefix.equals("xml")) { namespaces.put(prefix, resolver.getURIForPrefix(prefix, true)); } } } }
public RetainedStaticContext(StaticContext sc) { this.config = sc.getConfiguration(); this.packageData = sc.getPackageData(); if (sc.getStaticBaseURI() != null) { staticBaseUriString = sc.getStaticBaseURI(); try { this.staticBaseUri = ExpressionTool.getBaseURI(sc, null, true); } catch (XPathException e) { staticBaseUri = null; } } this.defaultCollationName = sc.getDefaultCollationName(); this.decimalFormatManager = sc.getDecimalFormatManager(); this.defaultElementNamespace = sc.getDefaultElementNamespace(); defaultFunctionNamespace = sc.getDefaultFunctionNamespace(); backwardsCompatibility = sc.isInBackwardsCompatibleMode(); if (Version.platform.JAXPStaticContextCheck(this, sc)) { //updated in method } else { this.namespaces = new HashMap<>(4); NamespaceResolver resolver = sc.getNamespaceResolver(); for (Iterator<String> it = resolver.iteratePrefixes(); it.hasNext(); ) { String prefix = it.next(); if (!prefix.equals("xml")) { namespaces.put(prefix, resolver.getURIForPrefix(prefix, true)); } } } }