XML-handling, the E4X-way

The (easier?) alternative to the XML-plugin:
Create variables with plain XML-syntax like
</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);

Available through the Rhino JavaScript engine in vCO, which includes E4X.

Trackbacks / Pings

Leave a Reply

Your email address will not be published. Required fields are marked *

*