Generates a string representation of the full XML name specified with the Namespace URI and Local Name according to the specified form.

Parameters:

form

Specify the form of the result XML name returned by the function.

The parameter may accept one of the three possible string values:

"qualified"

The XML name will be represented as
prefix:localName
where the namespace prefix is found according to the XML document context(s) explicitly or implicitly specified in the function parameters.
"unqualified"
The XML name will be represented only by its Local Name part.
"full"
The XML name will be represented as the string
{namespaceURI}localName
If the passed parameter value is not the one of those above, an error will be raised.

When the parameter 'form' is not specified, the default XML name representation form will be used, which is set with setXMLNameForm() function. This allows setting the form only once for all subsequent toXMLName() calls without passing it each time as the function parameter. As the toXMLName() function is used very frequently, this simplifies programming and improves performance.

namespaceURI
localName
Specifies the Namespace URI and Local Name to be converted to the XML name string.
qName
Alternatively, specifies both Namespace URI and Local Name at once (via qName.namespaceURI and qName.localName properties).

(For more details about QName type, see below.)

Note: When this parameter is null, the function returns empty string.

contextElement
Specifies the element that determines the XML document context (i.e. position on the XML document's tree) against which a new namespace prefix is to be resolved.

Note: This parameter will be used only when generating the qualified form.

contextElements
Specifies an array or enumeration of elements that determine different XML document contexts.

The function starts from the first element and uses it to resolve the namespace prefix.

If the element's context does not define the necessary namespace URI/prefix binding, the function tries the next element from the array/enumeration and repeats so until the binding found or the last element reached.

Note: This parameter will be used only when generating the qualified form.

Note: When the qualified form is to be generated and neither 'contextElement' nor 'contextElements' parameter is specified, the generator context element will be used by default.

Returns:

A string representation of the XML name.

See Also:

setXMLNameForm(), getXMLNameForm()

${include ../../../refs/qname_type_heading.htm}

${include ../../../gom/QName/doc.htm}