ASN1C C# Runtime Library  7.6
Public Member Functions | List of all members
Asn1XmlNamespaceContext Class Reference

Public Member Functions

String addNamespace (String namespaceURI, String prefix)
 
String addUniquePrefix (String namespaceURI)
 
String GetExistingPrefix (String namespaceURI)
 
String getNamespaceURI (String prefix)
 
String getPrefix (String namespaceURI)
 
bool isDefaultNamespaceURI (String namespaceURI)
 
IEnumerator prefixes ()
 

Detailed Description

Represents a mapping between namespaces and prefixes. A prefix may map only to a single namespace. A namespace may be bound to multiple prefixes.

The default namespace is mapped by DEFAULT_NS_PREFIX. By default, the default namespace is NULL_NS_URI.

Member Function Documentation

◆ addNamespace()

String addNamespace ( String  namespaceURI,
String  prefix 
)

Add (or replace) a namespace mapping. If prefix was previously mapped, the previously mapped URI is returned. Otherwise, NULL_NS_URI is returned.

Parameters
namespaceURI
Parameters
prefix

◆ addUniquePrefix()

String addUniquePrefix ( String  namespaceURI)

Map a unique prefix for the given namespace.

Returns
the unique prefix that was generated and mapped to the namespace

◆ GetExistingPrefix()

String GetExistingPrefix ( String  namespaceURI)

Return a prefix for the given namespace URI. If the DEFAULT_NS_PREFIX is mapped to the URI, it will be returned. Otherwise, if one or more other prefixes are mapped to the URI, one of these will be returned. Finally, if no prefix at all is mapped to the URI, null is returned.

Parameters
namespaceURI

◆ getNamespaceURI()

String getNamespaceURI ( String  prefix)

Return the namespace URI that the given prefix is mapped to. Return NULL_NS_URI if it is not mapped to any URI

Parameters
prefix

◆ getPrefix()

String getPrefix ( String  namespaceURI)

Return a prefix for the given namespace URI. If one or more prefixes other than DEFAULT_NS_PREFIX is mapped to the URI, one of these will be returned. Otherwise, a generated prefix will be automatically mapped to the URI and returned.

Parameters
namespaceURI

◆ isDefaultNamespaceURI()

bool isDefaultNamespaceURI ( String  namespaceURI)

Return true if the given namespace is currently the default namespace (ie, DEFAULT_NS_PREFIX is mapped to this URI)

Parameters
namespaceURI

◆ prefixes()

IEnumerator prefixes ( )

Return an iterator over the set of all mapped prefixes