I want to convert from XML1 to XML2. Is it possible to do this through set value? Or, do I have to write a custom script? I want to group the repeating elements by the id and merge it with the form as buckets of data...
XML1
<form1>
<Details>
<id>1</id>
<firsntname>example1</firstname>
<lastname>example1</lastname>
</Details>
<Details>
<id>2</id>
<firsntname>example2</firstname>
<lastname>example2</lastname>
</Details>
<Details>
<id>1</id>
<firsntname>example3</firstname>
<lastname>example3</lastname>
</Details>
<Details>
<id>3</id>
<firsntname>example4</firstname>
<lastname>example4</lastname>
</Details>
</form1>
XML2
<form1>
<Details>
<id>1</id>
<firsntname>example1</firstname>
<lastname>example1</lastname>
</Details>
<Details>
<id>1</id>
<firsntname>example3</firstname>
<lastname>example3</lastname>
</Details>
</form1>
Aditya
Views
Replies
Total Likes
This is not easily done with the setValue.
You're better off using the Execute Script or your own custom component to do that.
This is something we would like to improve.
Sorry.
Jasmin
Views
Replies
Total Likes
Do you have any sample scripts to do that? I am thinking of using the API to create the XML. Wasn't sure if it would affect the performance of the server.
Thanks
Aditya
Views
Replies
Total Likes
Actually, I would recommend using the XSLT service with a stylesheet for something like this. A custom DSC or script seems like overkill.
Views
Replies
Total Likes
Good point.
Jas
Views
Replies
Total Likes
Thanks! Do any one of you know a good resource on XSLT? I have never worked with them before...
Aditya
Views
Replies
Total Likes
A good beginner resource can be found here: http://www.w3schools.com/xsl/
I could write you a sample, but I am not sure what you want to accomplish. You just want every ID to be 1?
Views
Replies
Total Likes
Correct! I am trying to create buckets of XML by the id and merge it with the PDF. Hence, the three XMLs should be created in the following order id=1, id=2, id=3.
I am not sure, if XSLT will allow loops...
Aditya
Views
Replies
Total Likes
When you say "three XMLs" do you mean seperate files or simply seperate nodes in one XML file?
Views
Replies
Total Likes
Separate files...
Views
Replies
Total Likes
The plot thickens....
Let's see what we can do
Views
Replies
Total Likes
Below works for me...
I will have to create a loop anyway to create each XML merge it with the PDF. Thanks a lot for your help!
Aditya
Views
Replies
Total Likes