protected String readCollationName() throws XPathException { nextToken(); expect(Token.STRING_LITERAL); String collationName = uriLiteral(t.currentTokenValue); URI collationURI; try { collationURI = new URI(collationName); if (!collationURI.isAbsolute()) { URI base = new URI(env.getStaticBaseURI()); collationURI = base.resolve(collationURI); collationName = collationURI.toString(); } } catch (URISyntaxException err) { grumble("Collation name '" + collationName + "' is not a valid URI", "XQST0046"); collationName = NamespaceConstant.CODEPOINT_COLLATION_URI; } nextToken(); return collationName; }
protected String readCollationName() throws XPathException { nextToken(); expect(Token.STRING_LITERAL); String collationName = uriLiteral(t.currentTokenValue); URI collationURI; try { collationURI = new URI(collationName); if (!collationURI.isAbsolute()) { URI base = new URI(env.getStaticBaseURI()); collationURI = base.resolve(collationURI); collationName = collationURI.toString(); } } catch (URISyntaxException err) { grumble("Collation name '" + collationName + "' is not a valid URI", "XQST0046"); collationName = NamespaceConstant.CODEPOINT_COLLATION_URI; } nextToken(); return collationName; }
private void parseDefaultCollation() throws XPathException { // <"default" "collation"> StringLiteral if (foundDefaultCollation) { grumble("default collation appears more than once", "XQST0038"); } foundDefaultCollation = true; nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); ((QueryModule) env).setDefaultCollationName(uri); nextToken(); }
private void parseDefaultCollation() throws XPathException { // <"default" "collation"> StringLiteral if (foundDefaultCollation) { grumble("default collation appears more than once", "XQST0038"); } foundDefaultCollation = true; nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); ((QueryModule) env).setDefaultCollationName(uri); nextToken(); }
/** * Parse the Base URI declaration. * Syntax: <"declare" "base-uri"> uri-literal * * @throws XPathException if a static error is found */ private void parseBaseURIDeclaration() throws XPathException { if (foundBaseURIDeclaration) { grumble("Base URI Declaration may only appear once", "XQST0032"); } foundBaseURIDeclaration = true; nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); try { // if the supplied URI is relative, try to resolve it URI baseURI = new URI(uri); if (!baseURI.isAbsolute()) { String oldBase = env.getStaticBaseURI(); uri = ResolveURI.makeAbsolute(uri, oldBase).toString(); } ((QueryModule) env).setBaseURI(uri); } catch (URISyntaxException err) { // The spec says this "is not intrinsically an error", but can cause a failure later ((QueryModule) env).setBaseURI(uri); } nextToken(); }
/** * Parse the Base URI declaration. * Syntax: <"declare" "base-uri"> uri-literal * * @throws XPathException if a static error is found */ private void parseBaseURIDeclaration() throws XPathException { if (foundBaseURIDeclaration) { grumble("Base URI Declaration may only appear once", "XQST0032"); } foundBaseURIDeclaration = true; nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); try { // if the supplied URI is relative, try to resolve it URI baseURI = new URI(uri); if (!baseURI.isAbsolute()) { String oldBase = env.getStaticBaseURI(); uri = ResolveURI.makeAbsolute(uri, oldBase).toString(); } ((QueryModule) env).setBaseURI(uri); } catch (URISyntaxException err) { // The spec says this "is not intrinsically an error", but can cause a failure later ((QueryModule) env).setBaseURI(uri); } nextToken(); }
/** * Parse the "default function namespace" declaration. * Syntax: <"declare" "default" "function" "namespace"> StringLiteral * * @throws XPathException to indicate a syntax error */ private void parseDefaultFunctionNamespace() throws XPathException { if (foundDefaultFunctionNamespace) { grumble("default function namespace appears more than once", "XQST0066"); } foundDefaultFunctionNamespace = true; nextToken(); expect(Token.NAME); if (!"namespace".equals(t.currentTokenValue)) { grumble("After 'declare default function', expected 'namespace'"); } nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); if (uri.equals(NamespaceConstant.XML) || uri.equals(NamespaceConstant.XMLNS)) { grumble("Reserved namespace used as default element/type namespace", "XQST0070"); } ((QueryModule) env).setDefaultFunctionNamespace(uri); nextToken(); }
/** * Parse the "default element namespace" declaration. * Syntax: <"declare" "default" "element" "namespace"> StringLiteral * * @throws XPathException to indicate a syntax error */ private void parseDefaultElementNamespace() throws XPathException { if (foundDefaultElementNamespace) { grumble("default element namespace appears more than once", "XQST0066"); } foundDefaultElementNamespace = true; nextToken(); expect(Token.NAME); if (!"namespace".equals(t.currentTokenValue)) { grumble("After 'declare default element', expected 'namespace'"); } nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); if (uri.equals(NamespaceConstant.XML) || uri.equals(NamespaceConstant.XMLNS)) { grumble("Reserved namespace used as default element/type namespace", "XQST0070"); } ((QueryModule) env).setDefaultElementNamespace(uri); nextToken(); }
/** * Parse the "default function namespace" declaration. * Syntax: <"declare" "default" "function" "namespace"> StringLiteral * * @throws XPathException to indicate a syntax error */ private void parseDefaultFunctionNamespace() throws XPathException { if (foundDefaultFunctionNamespace) { grumble("default function namespace appears more than once", "XQST0066"); } foundDefaultFunctionNamespace = true; nextToken(); expect(Token.NAME); if (!"namespace".equals(t.currentTokenValue)) { grumble("After 'declare default function', expected 'namespace'"); } nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); if (uri.equals(NamespaceConstant.XML) || uri.equals(NamespaceConstant.XMLNS)) { grumble("Reserved namespace used as default element/type namespace", "XQST0070"); } ((QueryModule) env).setDefaultFunctionNamespace(uri); nextToken(); }
/** * Parse the "default element namespace" declaration. * Syntax: <"declare" "default" "element" "namespace"> StringLiteral * * @throws XPathException to indicate a syntax error */ private void parseDefaultElementNamespace() throws XPathException { if (foundDefaultElementNamespace) { grumble("default element namespace appears more than once", "XQST0066"); } foundDefaultElementNamespace = true; nextToken(); expect(Token.NAME); if (!"namespace".equals(t.currentTokenValue)) { grumble("After 'declare default element', expected 'namespace'"); } nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); if (uri.equals(NamespaceConstant.XML) || uri.equals(NamespaceConstant.XMLNS)) { grumble("Reserved namespace used as default element/type namespace", "XQST0070"); } ((QueryModule) env).setDefaultElementNamespace(uri); nextToken(); }
String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); mImport.namespaceURI = uri; nextToken(); expect(Token.STRING_LITERAL); mImport.locationURIs.add(uriLiteral(t.currentTokenValue)); nextToken(); } while (t.currentToken == Token.COMMA);
String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); mImport.namespaceURI = uri; nextToken(); expect(Token.STRING_LITERAL); mImport.locationURIs.add(uriLiteral(t.currentTokenValue)); nextToken(); } while (t.currentToken == Token.COMMA);
String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); sImport.namespaceURI = uri; nextToken(); expect(Token.STRING_LITERAL); sImport.locationURIs.add(uriLiteral(t.currentTokenValue)); nextToken(); while (t.currentToken == Token.COMMA) { nextToken(); expect(Token.STRING_LITERAL); sImport.locationURIs.add(uriLiteral(t.currentTokenValue)); nextToken();
String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); sImport.namespaceURI = uri; nextToken(); expect(Token.STRING_LITERAL); sImport.locationURIs.add(uriLiteral(t.currentTokenValue)); nextToken(); while (t.currentToken == Token.COMMA) { nextToken(); expect(Token.STRING_LITERAL); sImport.locationURIs.add(uriLiteral(t.currentTokenValue)); nextToken();
String uri = uriLiteral(rval); if (!StandardURIChecker.getInstance().isValidURI(uri)) { grumble("Namespace must be a valid URI value", "XQST0046");
nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); if ("xml".equals(prefix)) {
nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); if ("xml".equals(prefix)) {
nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); if (uri.isEmpty()) {
String uri = uriLiteral(rval); if (!StandardURIChecker.getInstance().isValidURI(uri)) { grumble("Namespace must be a valid URI value", "XQST0046");
nextToken(); expect(Token.STRING_LITERAL); String uri = uriLiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); if (uri.isEmpty()) {