Class DocumentBuilder
Class DomDestination
Class DynamicContext
Class DynamicError
Class EmptyEnumerator
Class ExtensionFunctionCall
Class InvalidityHandlerWrapper
Class NamespaceConstant
Class NullDestination
Class Processor
Class QName
Class SchemaManager
Class SchemaValidator
Class Serializer
Class StandardLogger
Class StaticContext
Class StaticError
Class TextWriterDestination
Class WhitespacePolicy
Class XPathCompiler
Class XPathExecutable
Class XPathSelector
Class XQueryCompiler
Class XQueryEvaluator
Class XQueryExecutable
Class XdmAnyFunctionType
Class XdmAnyItemType
Class XdmAnyNodeType
Class XdmArray
Class XdmAtomicType
Class XdmAtomicValue
Class XdmDestination
- Class TreeProtector
Class XdmEmptySequence
Class XdmExternalObjectValue
Class XdmFunctionItem
Class XdmItem
Class XdmItemType
Class XdmMap
Class XdmNode
Class XdmNodeKind
Class XdmSequenceType
Class XdmValue
Class XmlDestination
Class Xslt30Transformer
Class XsltCompiler
Class XsltExecutable
- Class ParameterDetails
Class XsltPackage
Class XsltTransformer
Enum RecoveryPolicy
Enum SchemaValidationMode
Enum TreeModel
Enum XdmAxis
Interface IInvalidityHandler
Interface IMessageListener
Interface IQueryResolver
Interface IResultDocumentHandler
Interface IXdmEnumerator
Interface IXmlLocation
Interface SchemaResolver
public class QName
The QName class represents an instance of xs:QName, as defined in the XPath 2.0 data model. Internally, it has three components, a namespace URI, a local name, and a prefix. The prefix is intended to be used only when converting the value back to a string.
Note that a QName is not itself an XdmItem
in this model; however it can
be wrapped in an XdmItem.
Field Summary | |
---|---|
static QName |
XS_STRING QName constant for the name xs:string |
static QName |
XS_INTEGER QName constant for the name xs:integer |
static QName |
XS_DOUBLE QName constant for the name xs:double |
static QName |
XS_FLOAT QName constant for the name xs:float |
static QName |
XS_DECIMAL QName constant for the name xs:decimal |
static QName |
XS_BOOLEAN QName constant for the name xs:boolean |
static QName |
XS_ANYURI QName constant for the name xs:anyURI |
static QName |
XS_QNAME QName constant for the name xs:QName |
static QName |
XS_UNTYPED_ATOMIC QName constant for the name xs:untypedAtomic |
static QName |
XDT_UNTYPED_ATOMIC QName constant for the name xs:untypedAtomic (for backwards compatibility) |
Constructor Summary | |
---|---|
QName(string local) Construct a QName representing a name in no namespace |
|
QName(string uri, string lexical)
Construct a QName using a namespace URI and a lexical representation.
The lexical representation may be a local name on its own, or it may
be in the form |
|
QName(string prefix, string uri, string local) Construct a QName using a namespace prefix, a namespace URI, and a local name (in that order). |
|
QName(string lexicalQName, XdmNode element) Construct a QName from a lexical QName, supplying an element node whose in-scope namespaces are to be used to resolve any prefix contained in the QName. |
|
QName(System.Xml.XmlQualifiedName qualifiedName)
Construct a |
Property Summary | |
---|---|
String |
Prefix The prefix of the QName. This plays no role in operations such as comparison of QNames for equality, but is retained (as specified in XPath) so that a string representation can be reconstructed. |
String |
Uri The namespace URI of the QName. Returns "" (the zero-length string) if the QName is not in a namespace. |
String |
LocalName The local part of the QName |
String |
ClarkName The expanded name, as a string using the notation devised by James Clark.
If the name is in a namespace, the resulting string takes the form |
String |
EQName The expanded name in EQName format that is |
Method Summary | |
---|---|
static QName |
FromClarkName(string expandedName)
Factory method to construct a QName from a string containing the expanded
QName in Clark notation, that is, |
static QName |
FromEQName(string expandedName)
Factory method to construct a QName from a string containing the expanded
QName in EQName notation, that is, |
void |
Register(Processor processor)
Register a QName with the |
bool |
IsValid(Processor processor) Validate the QName against the XML 1.0 or XML 1.1 rules for valid names. |
String |
ToString() Convert the value to a string. The resulting string is the lexical form of the QName, using the original prefix if there was one. |
int |
GetHashCode() Get a hash code for the QName, to support equality matching. This supports the semantics of equality, which considers only the namespace URI and local name, and not the prefix. |
bool |
Equals(object other) Test whether two QNames are equal. This supports the semantics of equality, which considers only the namespace URI and local name, and not the prefix. |
XmlQualifiedName |
ToXmlQualifiedName()
Convert the value to an |
Field Detail |
---|
public static readonly QName XS_STRING
QName constant for the name xs:string
public static readonly QName XS_INTEGER
QName constant for the name xs:integer
public static readonly QName XS_DOUBLE
QName constant for the name xs:double
public static readonly QName XS_FLOAT
QName constant for the name xs:float
public static readonly QName XS_DECIMAL
QName constant for the name xs:decimal
public static readonly QName XS_BOOLEAN
QName constant for the name xs:boolean
public static readonly QName XS_ANYURI
QName constant for the name xs:anyURI
public static readonly QName XS_QNAME
QName constant for the name xs:QName
public static readonly QName XS_UNTYPED_ATOMIC
QName constant for the name xs:untypedAtomic
public static readonly QName XDT_UNTYPED_ATOMIC
QName constant for the name xs:untypedAtomic (for backwards compatibility)
Constructor Detail |
---|
public QName(string local)
Construct a QName representing a name in no namespace
This constructor does not check that the components of the QName are lexically valid.
Parameters:local
-
public QName(string uri, string lexical)
Construct a QName using a namespace URI and a lexical representation.
The lexical representation may be a local name on its own, or it may
be in the form prefix:local-name
This constructor does not check that the components of the QName are lexically valid.
Parameters:uri
-
lexical
-
prefix:local
public QName(string prefix, string uri, string local)
Construct a QName using a namespace prefix, a namespace URI, and a local name (in that order).
This constructor does not check that the components of the QName are lexically valid.
Parameters:prefix
-
uri
-
local
-
public QName(string lexicalQName, XdmNode element)
Construct a QName from a lexical QName, supplying an element node whose in-scope namespaces are to be used to resolve any prefix contained in the QName.
This constructor checks that the components of the QName are lexically valid.
If the lexical QName has no prefix, the name is considered to be in the
default namespace, as defined by xmlns="..."
.
If the prefix of the lexical QName is not in scope, returns null.
Parameters:lexicalQName
-
prefix:local
or simply local
.
element
-
System.ArgumentException
- If the prefix of the lexical QName is not in scope
System.ArgumentException
- If the lexical QName is invalid
(for example, if it contains invalid characters)
public QName(System.Xml.XmlQualifiedName qualifiedName)
Construct a QName
from an XmlQualifiedName
(as defined in the
System.Xml
package).
Note that an XmlQualifiedName
does not contain any prefix, so the result
will always have a prefix of ""
qualifiedName
-
Property Detail |
---|
public String Prefix {get; }
The prefix of the QName. This plays no role in operations such as comparison of QNames for equality, but is retained (as specified in XPath) so that a string representation can be reconstructed.
Returns the zero-length string in the case of a QName that has no prefix.
public String Uri {get; }
The namespace URI of the QName. Returns "" (the zero-length string) if the QName is not in a namespace.
public String LocalName {get; }
The local part of the QName
public String ClarkName {get; }
The expanded name, as a string using the notation devised by James Clark.
If the name is in a namespace, the resulting string takes the form {uri}local
.
Otherwise, the value is the local part of the name.
public String EQName {get; }
The expanded name in EQName format that is Q{uri}local
. A no namespace name is returned as Q{}local
.
Method Detail |
---|
Factory method to construct a QName from a string containing the expanded
QName in EQName notation, that is, Q{uri}local
The prefix part of the QName
will be set to an empty string.
expandedName
-
{uri}local
if the
name is in a namespace. For a name in no namespace, either of the
forms Q{}local
or simply local
are accepted.
Register a QName with the Processor
. This makes comparison faster
when the QName is compared with others that are also registered with the Processor
.
Depreacted method.
A given QName
object can only be registered with one Processor
.
processor
-
Validate the QName against the XML 1.0 or XML 1.1 rules for valid names.
Parameters:processor
-
Convert the value to a string. The resulting string is the lexical form of the QName, using the original prefix if there was one.
Get a hash code for the QName, to support equality matching. This supports the semantics of equality, which considers only the namespace URI and local name, and not the prefix.
The algorithm for allocating a hash code does not depend on registering the QName
with the Processor
.
Test whether two QNames are equal. This supports the semantics of equality, which considers only the namespace URI and local name, and not the prefix.
The result of the function does not depend on registering the QName
with the Processor
, but is computed more quickly if the QNames have
both been registered
other
-
Convert the value to an XmlQualifiedName
(as defined in the
System.Xml
package)
Note that this loses the prefix.
Factory method to construct a QName from a string containing the expanded QName in Clark notation, that is,
{uri}local
The prefix part of the
Parameters:QName
will be set to an empty string.expandedName
-{uri}local
if the name is in a namespace, or simplylocal
if not.