Skip to content

PrefixToNamespaceURI - cXMLDOMDocumentType

Finds the NamespaceURi string for a prefix

Type: Function
Return Data Type: String

Parameters

Parameter Type Description
sPrefix String Prefix name

Syntax

Function PrefixToNamespaceURI String sPrefix Returns String

Call Example

Get PrefixToNamespaceURI sPrefix to StringVariable

Description

PrefixToNamespaceURI finds the namespaceURI for a prefix. It starts its search at the XML object node receiving the message and proceeds up the object's structure (e.g., parent node, grandparent node) searching for an xmlns: attribute that matches the prefix. If found, the value of the attribute (the NamespaceURI) is returned, if not found, an empty string is returned.

You will never need to use this message with element or atribute names. You can acquire this information using the much simpler psNamespaceURI, psPrefix and psBaseName properties.

This message is only required in advanced parsing situations. This may be used when an attribute's value (not its name) contains a prefix and you need to associate that prefix with a namespace.

Get AttributeValue of hoNode "type" to sName
Get PrefixNameFromQName sName to sPrefix
Get BaseNameFromName sName to sName
if (sPrefix<>"") begin
    Get PrefixToNamespace of hoSchemaNode sPrefix to sNamespace
end

See Also

PrefixNameFromQName | BaseNameFromQName | psNamespaceURI | psPrefix | psBaseName

Return Value

Returns the NamespaceURI string associated with the prefix