Altova XMLSpy 2024 Enterprise Edition

Method: GetElementHierarchy (out_arrElementNames as Variant)



Retrieve the names of all XML elements that are parents of the current selection. Inner elements get listed before enclosing elements. An empty list is returned whenever the current selection is not inside a single XMLData element.


The names of the element hierarchy, together with the range object uniquely identify XMLData elements in the document. The attributes of these elements can be directly accessed by GetElementAttributeNames, and related methods.





The authentic range object, or its related view object is no longer valid.


Invalid address for the return parameter was specified.




C# Examples

' --------------------------------------------

' C#

' --------------------------------------------


namespace ConsoleApplication1


   class Program


       static void Main(string[] args)


           XMLSpyLib.Application app = new XMLSpyLib.Application();




           XMLSpyLib.AuthenticView view = app.ActiveDocument.AuthenticView;

           XMLSpyLib.AuthenticRange range = view.DocumentBegin;


           object o = null;

           range.GetElementHierarchy(ref o);


           object[] elements = (object[])o;


           foreach (string e in elements)








Also see: SetElementAttributeValue.


© 2018-2024 Altova GmbH