MCD_STR CMarkup::GetElemPath() const;

CMarkup Developer License

GetElemPath is only in CMarkup Developer and the free XML editor  FOAL C++ scripting.

The GetElemPath method returns the absolute path of the main position element. See Paths In CMarkup.

In the following example XML document there are six elements:

  <diagnostics d="3">
  <diagnostics d="7">
    <proxy usedefault="true"/>

This code prints the paths for those six elements.

while ( xml.FindElem("//*") )
  printf( xml.GetElemPath() );

Every path is unique and provides a way of returning to the element (with the FindElem method) after navigating away from it.


However, if the first diagnostics element were removed, the second one would have the path originally associated with the first one. In other words, the path of an element can change when the document changes.

See also GetChildElemPath and GetParentElemPath.