XML Client side?

SSK2
Kilo Expert

Hi All,

I have populated wizard varaible (multiline field) with XML string.

On the onLoad client script, I need to use the XML string populated in the wizard varaibel to get element values.

 

Not sure if any OOB functions for parsing XML string on the client side? if not what are the options?

Appericaite your help on this!

 

Thanks

Sats

1 ACCEPTED SOLUTION

Thanks a lot Marcelo, this works perfect!


View solution in original post

7 REPLIES 7

Hi Marcelo,


Above link has solved the problem of converting the given string to XML object to access and modify XML element values. Now I need to convert the modifiedXML object to string, so I can write modified value on a SNC variable. Can't see a function to do this? Any help?



Thanks again!



Regards,


Sats


Finally got the answer, with help Marcelo



var xmlString = "<?xml version='1.0' ?>\


<root>\


<level1>\


<option>Option1</option>\


<option>Option2</option>\


<option>Option3</option>\


</level1>\


</root>";



var parser = new DOMParser();


var xmlDocument = parser.parseFromString( xmlString, "text/xml" );



var serializer = new XMLSerializer();


var string = serializer.serializeToString( xmlDocument );


alert( string )



for IE


return xmlDocument.xml;


Glad to hear