DynamicDOM v0.43.2. Implementation based on XRules v0.43

XmlHelpers.GetXmlNodeFullPath Method 

Retrieves the full xpath of the specified node.

[Visual Basic]
Shared Public Function GetXmlNodeFullPath( _ 
   ByVal xmlNode As XmlNode, _ 
   ByRef namespaceManager As XmlNamespaceManager, _ 
   ByVal getPositions As Boolean, _ 
   ByRef needsEmptyNamespace As Boolean _ 
) As String
[C#]
public static string GetXmlNodeFullPath(
   XmlNode xmlNode,
   ref XmlNamespaceManager namespaceManager,
   bool getPositions,
   out bool needsEmptyNamespace
);
[C++]
public: static String* GetXmlNodeFullPath(
   XmlNode* xmlNode,
   * XmlNamespaceManager* namespaceManager,
   bool getPositions,
   * bool needsEmptyNamespace
);
[JScript]
public static function GetXmlNodeFullPath(
   XmlNode xmlNode,
   XmlNamespaceManager namespaceManager,
   bool getPositions,
   bool needsEmptyNamespace
): String;

Parameters

xmlNode
A reference to the XML node to return its full path.
namespaceManager
The namespace manager from which to get namespace prefixes. This function might add new namespace prefixes to this namespace manager if such prefixes are needed in the path and not already defined.
getPositions
If 'true', the position of the each element in the path will be added between square brackets after the name of the element. The position will always be 1 if there is one element of this name in its context, and it will be its position among the elements having the same name in its context.
needsEmptyNamespace
This parameter is set to true if the generated path contains a node that belongs to the empty namespace, and therefore doesn't use a namespace prefix.

Return Value

The full path of the node.

Example

For the student element below:


    
        
        
    

this function returns 'class/first[1]/student[1]' or 'class/first/student' depending on the value of the getPositions parameter.

See Also

XmlHelpers Class | XRules.Utilities Namespace