Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Xfa.form.export xml into field

buildmeup
Level 2
Level 2

Hello i have a question about how to export xml into fields, because i cant find a way to do it, is it possible?

 

i know how to export our pdf into xml, by using 

xfa.host.exportData("", 0);

but how to export it on textfield, for example i have textField named with "xmlfield".

 

what should i do, ..xml.field.rawValue = ?? or xfa.host.exportData("..xmlfield", 0); its not working

Thanks in advance.

Export XML into Fields
1 Accepted Solution
Kosta_Prokopiu1
Correct answer by
Employee
Employee

I think what you want to do is the saveXML() function:

Kosta_Prokopiu1_0-1605799313066.png

Kosta_Prokopiu1_1-1605799361262.png

 

View solution in original post

7 Replies
Kosta_Prokopiu1
Correct answer by
Employee
Employee

I think what you want to do is the saveXML() function:

Kosta_Prokopiu1_0-1605799313066.png

Kosta_Prokopiu1_1-1605799361262.png

 

View solution in original post

buildmeup
Level 2
Level 2
hello, that method is good, but how about in case i have xslt and i want the xml converted into xslt that i already connected on Data Connection, so the result xml will be XML with xslt conversion? thnaks
Kosta_Prokopiu1
Employee
Employee
Not sure I understand your use case... An XML Schema Data Connection can be set to transform in- and out-going data via XSLT files. The saveXML() takes the currently active XML below the element you selected (here it is from the top level). It will NOT perform transformations - these happened either when the data connection loaded the data or will hapen when the form gets serialized (saved or submitted). Unless someone else on this forum knows more details, I would assume that this cannot be done.
buildmeup
Level 2
Level 2
yep, i already set transform-out going data via XSLT, i want the save xml would be same like i got when i export this xml with XSLT, currenly the xml with saveXML() function, only get the pure XML, but is ok, big thanks to you
radzmar
Level 10
Level 10
You can store your XSLT stylesheet within the XML source and use it to transform the xml data with the applyXSL() method before writing it into the text field.
radzmar
Level 10
Level 10

Just use the saveXML() method.

 

Textfield.rawValue = xfa.data.saveXML("pretty");