/** * Parse the Base URI declaration. * Syntax: <"declare" "base-uri"> uri-literal * * @throws XPathException */ 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.getBaseURI(); URI oldBaseURI = new URI(oldBase); uri = oldBaseURI.resolve(uri).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 */ 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.getBaseURI(); URI oldBaseURI = new URI(oldBase); uri = oldBaseURI.resolve(uri).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(); }
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(); }
String value = URILiteral(t.currentTokenValue);
String value = URILiteral(t.currentTokenValue);
/** * 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); ((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); ((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); ((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); ((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();
nextToken(); expect(Token.STRING_LITERAL); String collationName = URILiteral(t.currentTokenValue); URI collationURI; try {
nextToken(); expect(Token.STRING_LITERAL); String collationName = URILiteral(t.currentTokenValue); URI collationURI; try {
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();
nextToken(); expect(Token.STRING_LITERAL); String uri = URILiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); if (uri.length()==0) {
nextToken(); expect(Token.STRING_LITERAL); String uri = URILiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); if (uri.length()==0) {
/** * Parse a namespace declaration in the Prolog. * Syntax: <"declare" "namespace"> NCName "=" StringLiteral * * @throws XPathException */ private void parseNamespaceDeclaration() throws XPathException { nextToken(); expect(Token.NAME); String prefix = t.currentTokenValue; if (!nameChecker.isValidNCName(prefix)) { grumble("Invalid namespace prefix " + Err.wrap(prefix)); } nextToken(); expect(Token.EQUALS); nextToken(); expect(Token.STRING_LITERAL); String uri = URILiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); try { ((QueryModule)env).declarePrologNamespace(prefix, uri); } catch (XPathException err) { err.setLocator(makeLocator()); reportError(err); } nextToken(); }
/** * Parse a namespace declaration in the Prolog. * Syntax: <"declare" "namespace"> NCName "=" StringLiteral * * @throws XPathException */ private void parseNamespaceDeclaration() throws XPathException { nextToken(); expect(Token.NAME); String prefix = t.currentTokenValue; if (!nameChecker.isValidNCName(prefix)) { grumble("Invalid namespace prefix " + Err.wrap(prefix)); } nextToken(); expect(Token.EQUALS); nextToken(); expect(Token.STRING_LITERAL); String uri = URILiteral(t.currentTokenValue); checkProhibitedPrefixes(prefix, uri); try { ((QueryModule)env).declarePrologNamespace(prefix, uri); } catch (XPathException err) { err.setLocator(makeLocator()); reportError(err); } nextToken(); }