@XMLGetNamespace
Syntax
@XMLGetNamespace(XMLN);
Description
The supplied handle must contain a valid VSPECHXMLNODE (XMLN) handle.
If a namespace is associated with the node, its namespace URI is returned as text.
If character set conversion is enabled for the XML handle, the returned namespace is converted accordingly.
VSPECHXMLNODE XMLN:
Handle of the XML node whose namespace is to be retrieved.
XMLN must contain a valid VSPECHXMLNODE (XMLN) handle that references an XML node.
Return Value:
On successful execution, the namespace URI of the XML node is returned as text.
If no namespace is associated with the XML node, an empty text value is returned.
If the XML node handle is invalid or an error occurs during character set conversion, the @Function returns @ERROR.
Example: @XMLGetNamespace(XMLN);
XML := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<customer xmlns=\"https://example.com/customer\">" +
" <name>Example GmbH</name>" +
"</customer>";
hXMLD := @XMLParse(XML);
hXMLRoot := @XMLGetRoot(hXMLD);
Namespace := @XMLGetNamespace(hXMLRoot);
@XMLRelease(hXMLD);
The example retrieves the namespace of the root element. Namespace then contains the value "https://example.com/customer".
Note : This text was machine-translated and may contain inaccuracies.
