Reputation: 7
I can Parse the below XML that comes back as a string like below lets call it variable segments
var Segments = <TopologyElements> <TopologyElement creationClassName="CommSegmentation" displayName="V2V" name="Segmentation-GROUP-VirtualMachineByVirtualDataCenter::GROUP-USER-V2V" uuid="_ccgsEIsqEeazyLadZeWfsw"/> <TopologyElement creationClassName="EquiSegmentation" displayName="Test" name="Merge-Clusters-Test-_JJuBMIs0EeazyLadZeWfsw" uuid="_JJuBMIs0EeazyLadZeWfsw"/> </TopologyElements>
var xmlDoc = new XML(VMTurboSegments);
default xml namespace = xmlDoc.namespace();
System.log(xmlDoc.getElementsByTagName("creationClassName"));
Then I get the error below: TypeError: Cannot find function getElementsByTagName in object
Is there something I am missing to convert the xml (as a string) to an xml document which will allow me to parse the elements?
Upvotes: 0
Views: 151