</div> //create new xml-variable with E4X-syntax var xmlcontent = <vms></vms>; //E4X: create XML-Child Element: VM xmlcontent.vm.@uuid = uuid; xmlcontent.vm.name = vmname; xmlcontent.vm.cpus = numCpus; xmlcontent.vm.memory = memSize; xmlcontent.vm.ip = guestIpAddress; xmlcontent.vm.hostname = guestHostname; //log for sure : - ) System.debug(xmlcontent);
– March 1, 2011Posted in: Examples
The (easier?) alternative to the XML-plugin:
Create variables with plain XML-syntax like
Available through the Rhino JavaScript engine in vCO, which includes E4X.
Steve Jin: VMware VI and vSphere SDK
David Flanagan: JavaScript – The Definitive Guide
Marijn Haverbeke: Eloquent JavaScript
Cody Bunch: Automating vSphere: With VMware vCenter Orchestrator