Hi Folks,
Thanks for all you support in Advance, i have a requirement, where i have an XML in one line string form and i wondering how to convert into well formed XML?
Input XML sample:
<root> <one><link1></link1></one><two></two> </root>
to well-formed XML
<root>
<one>
<link1></link1>
</one>
<two>
</two>
</root>
I was trying to create a well-formed document using DOM or SAX parsers in ExcuteScript activity, but it is leading to some complicated exceptions. And i am looking for the simplest way for transformation.
Please let me know
thanks,
Rajesh
Views
Replies
Total Likes
In a Set Value operation use the deserialize() function found in the Misc group, where xmlDoc is of type 'xml' and xmlStr is of type 'string'.
Steve
Views
Replies
Total Likes
Thank you Steve, i tried DeSerializing the string to XML, but when i view the final XML i still see the XML is NOT well formed. i don't know where i am commiting mistakes. please find my sample process and investigate.
https://acrobat.com/#d=Ykz0yeJxJ9YmBwXPS68fQw
thanking you,
Rajesh
Views
Replies
Total Likes
Rajesh,
I don't understand. There is no difference between the two XML instances other than whitespace. They are both well-formed XML.
<root> <one><link1></link1></one><two></two> </root>
<root>
<one>
<link1></link1>
</one>
<two>
</two>
</root>
Steve
Views
Replies
Total Likes
Rajesh,
I believe you might want to look at this:
You can use saveXML('pretty') to get a well formatted XML..
Check this article..
http://forms.stefcameron.com/2009/08/19/tip-pretty-xml-strings/
Mark
Views
Replies
Total Likes