XmlNodeReader
Class NodePathParser

NodePathParser is a helper class used by XmlNodeReader that converts a "nodeName.nodeName.nodeName" type string to an array of node names, and pulls out the attribute name and last node name for reference. The special rules for a "node path" are:


Normally this class will not need to be used directly.
Methods Summary
Public New(nodePath As String)
     Creates a new NodePathParser from the given node path string.
Functions Summary
Public Variant getArray()
     Returns a string array with one element for each node name in the node path.
Public String getAttName()
     Returns the attribute name in the node path, if any.
Public String getNodeName()
     Returns the last (right-most) node name in the node path, if any.
Public String getPath()
     Returns the node path string that was passed when this object was created, or when parseNodePath() was called, with all spaces stripped and any trailing attribute name removed.
Public Variant parseNodePath(np As String)
     Returns a string array with one element for each node name in the node path, and also sets all the internal references in this object to reflect this node path.
Private Variant SplitNodePath(Byval npath As String)
     Internal function used to convert a node path to an array, also changing ".." references in node names to "."

Method Detail

New

Public New(nodePath As String)
Creates a new NodePathParser from the given node path string.

Function Detail

getArray

Public Function getArray() As Variant
Returns a string array with one element for each node name in the node path. If the node path is empty (or only contains an attribute name) this will return an array with a single empty string element.

getAttName

Public Function getAttName() As String
Returns the attribute name in the node path, if any.

getNodeName

Public Function getNodeName() As String
Returns the last (right-most) node name in the node path, if any.

getPath

Public Function getPath() As String
Returns the node path string that was passed when this object was created, or when parseNodePath() was called, with all spaces stripped and any trailing attribute name removed.

parseNodePath

Public Function parseNodePath(np As String) As Variant
Returns a string array with one element for each node name in the node path, and also sets all the internal references in this object to reflect this node path. This method is called by the New() sub when the object is instantiated.

SplitNodePath

Private Function SplitNodePath(Byval npath As String) As Variant
Internal function used to convert a node path to an array, also changing ".." references in node names to "."