public class QNameParser
extends java.lang.Object
withProperty()
fluent API style.Constructor and Description |
---|
QNameParser(NamespaceResolver resolver) |
Modifier and Type | Method and Description |
---|---|
StructuredQName |
parse(java.lang.String lexicalName,
java.lang.String defaultNS)
Make a structured QName from a lexical QName, using a supplied NamespaceResolver to
resolve the prefix.
|
QNameParser |
withAcceptEQName(boolean acceptEQName)
Say whether URI-qualified names in
Q{uri}local format should be accepted |
QNameParser |
withErrorOnBadSyntax(java.lang.String code)
Say what error code should be thrown when the QName syntax is invalid
|
QNameParser |
withErrorOnUnresolvedPrefix(java.lang.String code)
Say what error code should be thrown when the prefix is undeclared
|
QNameParser |
withNamespaceResolver(NamespaceResolver resolver)
Set the namespace resolver to be used
|
QNameParser |
withUnescaper(XQueryParser.Unescaper unescaper)
Supply a callback used to unescape special characters appearing in the URI part of an EQName
|
public QNameParser(NamespaceResolver resolver)
public QNameParser withNamespaceResolver(NamespaceResolver resolver)
resolver
- the namespace resolverpublic QNameParser withAcceptEQName(boolean acceptEQName)
Q{uri}local
format should be acceptedacceptEQName
- true if extended QName syntax is acceptedpublic QNameParser withErrorOnBadSyntax(java.lang.String code)
code
- the error code to be thrownpublic QNameParser withErrorOnUnresolvedPrefix(java.lang.String code)
code
- the error code to be thrownpublic QNameParser withUnescaper(XQueryParser.Unescaper unescaper)
unescaper
- the callback to be usedpublic StructuredQName parse(java.lang.String lexicalName, java.lang.String defaultNS) throws XPathException
lexicalName
- the QName as a lexical name (prefix:local)defaultNS
- the default namespace to use if there is no prefixXPathException
- if the namespace prefix is not in scope or if the value is lexically
invalid. Error code FONS0004 is set if the namespace prefix has not been declared; error
code FOCA0002 is set if the name is lexically invalid. These may need to be
changed on return depending on the caller's requirements.Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.