Boolean isPreserveNamespaces = (Boolean) config.getConfigurationProperty(FeatureKeys.XQUERY_PRESERVE_NAMESPACES); Boolean isInheritNamespaces = (Boolean) config.getConfigurationProperty(FeatureKeys.XQUERY_INHERIT_NAMESPACES); if (queryModule.isPreserveNamespaces() == isPreserveNamespaces && queryModule.isInheritNamespaces() == isInheritNamespaces) { isPreserveNamespaces = queryModule.isPreserveNamespaces(); isInheritNamespaces = queryModule.isInheritNamespaces();
/** * Parse document constructor: document {...} * * @param offset the location in the source query * @return the document constructor instruction * @throws XPathException if parsing fails */ /*@NotNull*/ private Expression parseDocumentConstructor(int offset) throws XPathException { nextToken(); Expression content; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { content = Literal.makeEmptySequence(); } else { content = parseExpression(); } expect(Token.RCURLY); lookAhead(); // must be done manually after an RCURLY nextToken(); DocumentInstr doc = new DocumentInstr(false, null); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true); } doc.setValidationAction(((QueryModule) env).getConstructionMode(), null); doc.setContentExpression(content); setLocation(doc, offset); return doc; }
/** * Parse document constructor: document {...} * * @param offset the location in the source query * @return the document constructor instruction * @throws XPathException if parsing fails */ /*@NotNull*/ private Expression parseDocumentConstructor(int offset) throws XPathException { nextToken(); Expression content; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { content = Literal.makeEmptySequence(); } else { content = parseExpression(); } expect(Token.RCURLY); lookAhead(); // must be done manually after an RCURLY nextToken(); DocumentInstr doc = new DocumentInstr(false, null); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true); } doc.setValidationAction(((QueryModule) env).getConstructionMode(), null); doc.setContentExpression(content); setLocation(doc, offset); return doc; }
nextToken(); Expression exp = parseExpression(); if (!((QueryModule)env).isPreserveNamespaces()) { exp = new CopyOf(exp, false, Validation.PRESERVE, null, true);
nextToken(); Expression exp = parseExpression(); if (!((QueryModule)env).isPreserveNamespaces()) { exp = new CopyOf(exp, false, Validation.PRESERVE, null, true);
} else { Expression exp = parseExpression(); if (!((QueryModule) env).isPreserveNamespaces()) { exp = new CopyOf(exp, false, Validation.PRESERVE, null, true);
} else { Expression exp = parseExpression(); if (!((QueryModule) env).isPreserveNamespaces()) { exp = new CopyOf(exp, false, Validation.PRESERVE, null, true);
content = Literal.makeEmptySequence(); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true);
content = Literal.makeEmptySequence(); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true);
content = Literal.makeEmptySequence(); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true); content = Literal.makeEmptySequence(); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true);
content = Literal.makeEmptySequence(); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true); content = Literal.makeEmptySequence(); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true);
if (!((QueryModule)env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true);
if (!((QueryModule)env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true);