Class DocumentBuilder
Class DomDestination
Class DynamicContext
Class DynamicError
Class EmptyEnumerator
Class ExtensionFunctionCall
Class NullDestination
Class Processor
Class QName
Class SchemaManager
Class SchemaValidator
Class Serializer
Class StaticContext
Class StaticError
Class TextWriterDestination
Class XPathCompiler
Class XPathExecutable
Class XPathSelector
Class XQueryCompiler
Class XQueryEvaluator
Class XQueryExecutable
Class XdmAnyFunctionType
Class XdmAnyItemType
Class XdmAnyNodeType
Class XdmAtomicType
Class XdmAtomicValue
Class XdmDestination
Class XdmEmptySequence
Class XdmFunctionItem
Class XdmItem
Class XdmItemType
Class XdmNode
Class XdmNodeKind
Class XdmSequenceType
Class XdmValue
Class XmlDestination
Class XsltCompiler
Class XsltExecutable
Class XsltTransformer
Enum RecoveryPolicy
Enum SchemaValidationMode
Enum TreeModel
Enum WhitespacePolicy
Enum XdmAxis
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.
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 | |
---|---|
static QName |
XS_STRING |
static QName |
XS_INTEGER |
static QName |
XS_DOUBLE |
static QName |
XS_FLOAT |
static QName |
XS_DECIMAL |
static QName |
XS_BOOLEAN |
static QName |
XS_ANYURI |
static QName |
XS_QNAME |
static QName |
XS_UNTYPED_ATOMIC |
static QName |
XDT_UNTYPED_ATOMIC |
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 |
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 |
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
-
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 static readonly QName XS_STRING {}
public static readonly QName XS_INTEGER {}
public static readonly QName XS_DOUBLE {}
public static readonly QName XS_FLOAT {}
public static readonly QName XS_DECIMAL {}
public static readonly QName XS_BOOLEAN {}
public static readonly QName XS_ANYURI {}
public static readonly QName XS_QNAME {}
public static readonly QName XS_UNTYPED_ATOMIC {}
public static readonly QName XDT_UNTYPED_ATOMIC {}
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.
Method Detail |
---|
public static QName FromClarkName(string expandedName)
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 QName
will be set to an empty string.
expandedName
-
{uri}local
if the
name is in a namespace, or simply local
if not.
public static QName FromEQName(string expandedName)
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.
public void Register(Processor processor)
Register a QName with the Processor
. This makes comparison faster
when the QName is compared with others that are also registered with the Processor
.
A given QName
object can only be registered with one Processor
.
processor
-
public bool IsValid(Processor processor)
Validate the QName against the XML 1.0 or XML 1.1 rules for valid names.
Parameters:processor
-
public override 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.
public override 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.
The algorithm for allocating a hash code does not depend on registering the QName
with the Processor
.
public override 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.
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
-
public XmlQualifiedName ToXmlQualifiedName()
Convert the value to an XmlQualifiedName
(as defined in the
System.Xml
package)
Note that this loses the prefix.