I have an XSL that I want to use to populate a 2d barcode. I've set the data connection like so:
However, when I call
this.rawValue = xfa.record.saveXML();
it does not apply the XSL transform. What do I need to do to force the transform? If I do a Export Data operation from Acrobat, the resulting XML file is transformed, so I know my transform works.
Solved! Go to Solution.
Views
Replies
Total Likes
OK. I think I have a solution. The stylesheet nodes are of packet className, so by using the code below:
var oStyleSheets = xfa.resolveNodes("stylesheet[*]")
for (var i = 0; i < oStyleSheets.length; i++) {
if (oStyleSheets.item(i).getAttribute("id") == "XFADataInputXSL")
console.println("got input XSL");
else if (oStyleSheets.item(i).getAttribute("id") == "XFADataOutputXSL")
console.println("got output XSL");
}
I can then pull out the right stylesheet for the job.
Views
Replies
Total Likes
Well I'm a bit closer. I can do the transform now, as I've found that the stylesheets are located at xfa.stylesheet. Then I can do something like this:
this.rawValue = xfa.record.applyXSL(xfa.stylesheet.saveXML());
However, what if I have an outgoing and incoming transform stylesheet? How can I differentiate them? It looks like the incoming stylesheet has an id="XFADataInputXSL" and the outgoing an id="XFADataOutputXSL".
But I can't write a script that will pick the right one!
var outgoingXSL = xfa.resolveNode("stylesheet.[id == \"XFADataOutputXSL\"]");
I'm not sure why this isn't working.
Views
Replies
Total Likes
OK. I think I have a solution. The stylesheet nodes are of packet className, so by using the code below:
var oStyleSheets = xfa.resolveNodes("stylesheet[*]")
for (var i = 0; i < oStyleSheets.length; i++) {
if (oStyleSheets.item(i).getAttribute("id") == "XFADataInputXSL")
console.println("got input XSL");
else if (oStyleSheets.item(i).getAttribute("id") == "XFADataOutputXSL")
console.println("got output XSL");
}
I can then pull out the right stylesheet for the job.
Views
Replies
Total Likes
Views
Likes
Replies