These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Is it possible to add xsl href to submitted xml file

LarsG
Registered: Oct 5 2008
Posts: 3
Answered

Hi All,

I have made a form designed in LC Designer 8.0 that generates an mail with enclosed data in the form of an xml file (so that Acrobat Reader can without "enabling user rights" etc use the form).

This xml file should prefebly contain a company specific xsl href in the header (Something like <?xml-stylesheet type="text/xsl" href="http://MyServer/MyOwn.xsl"?> ).
This because some of the receivers of this mail do not have a good way of viewing the xml data, so we made a local xsl that will show the data in IE).

This has proved to be not so easy (for me anyway)!

Has anyone figured out how to do this from the "design view"?

Or, maybe there's easier ways around this?
Even an reply with "it's not possible" will be appreciated (at least I know then)!...

Thanks In Advance
Lars

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I know this can be done with JavaScript, but you may also be able to do this from the design view. Whenyou associate your form with an XML file or schema you have the option to include an XSLT for both loading and saving data. I believe this XSLT is used for data submissions, so you could easily include your reference in the transformation.

There are two differnt JavaScript methods.

1) When you submit the data as XDP, Acrobat copies "xfa.dataset" verbatim into the attached file. You can modify the xfa.dataset before submission to include the tags you want.

2) A better option though is to use the AcroForm "doc.submitForm()" function. With this function you can create you're own custom XML for submission. There is an example of using this function with custom data built from XFA forms. Since your code will be operating from inside an XFA form you're syntax will be a little different than the example.

i.e. you'll need to use this line to do the actual data submission

event.target.submitForm(...);

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

LarsG
Registered: Oct 5 2008
Posts: 3
Hi Thom,

Thanks for your quick response!

The entire mail process is already in java script but there has been no mentioning in ref texts on how to actually apply hrefs and so on, i.e. build the xml, so I was kind of lost!

But now I know that there is a way and you pointed me in the right direction, so... Now the fun begin.

Thanks again!
Lars