XQuery/XSLT Input View and more than one XML input?

<oXygen/> general issues.
amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

XQuery/XSLT Input View and more than one XML input?

Post by amix » Sun Jun 29, 2008 4:58 am

Hi,

I am working on a scenario, where I have three input files, all of slightely different format (styles.xml,meta.xml and content.xml from ODF) which I want to process using styles.xsl, meta.xsl and content.xsl, all referenced from a master xsl called odf2xhtml.xsl.

I have added all three modules as additional stylesheets to the transformation scenario in oXygen. However, I do not know how to make oXygen aware of the multiple input files, so I can get a full view on all input nodes from the XQuery/XSLT Input view. Is this possible? It would be nice, since I am also doing some more stuff from the master-xsl as just invoking the other transformers. They basically just plug-in into the main flow, which is in the master-stylesheet, so I do development from there.

Thanks.
Andreas

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: XQuery/XSLT Input View and more than one XML input?

Post by sorin_ristache » Mon Jun 30, 2008 12:29 pm

Hello,
amix wrote:I have added all three modules as additional stylesheets to the transformation scenario in oXygen.
Do you mean you added the three stylesheets to the scenario using the Addidional XSLT stylesheets button? You should add a stylesheet to the scenario as additional stylesheet only when you want to process the output of the main stylesheet set in the XSL URL field of the scenario with the additional stylesheet.

In your case I understand you have three different XML files and you want to process each XML file independently with a different XSLT stylesheet. So you should create one scenario for each independent transformation: styles.xsl, meta.xsl and content.xsl and run each scenario for transforming the corresponding XML input file.

If each stylesheet already knows the full path of the XML input file name that it must process (the XML file path is set with a parameter or is read with the function document()) and you do not need to set the XML file path in the XML URL field of the scenario then you can add just create a scenario with master.xsl set in the XSL URL field and with any XML file set in the XML URL field. In this case you do not need to add the three stylesheets as additional stylesheets because they are included in master.xsl.

The XQuery/XSLT Input view shows only the structure of the file set in the XML URL field of the scenario. If you want to see a single tree that includes all the three files (styles.xml, meta.xml and content.xml) you have to create a new XML file which includes all the three files and set this new XML file in the XML URL field of the scenario. The XQuery/XSLT Input view works at the scenario level and looks at the XML file processed by the scenario.


Regards,
Sorin

amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

Re: XQuery/XSLT Input View and more than one XML input?

Post by amix » Wed Jul 02, 2008 4:49 pm

sorin wrote: The XQuery/XSLT Input view shows only the structure of the file set in the XML URL field of the scenario. If you want to see a single tree that includes all the three files (styles.xml, meta.xml and content.xml) you have to create a new XML file which includes all the three files and set this new XML file in the XML URL field of the scenario. The XQuery/XSLT Input view works at the scenario level and looks at the XML file processed by the scenario.
Right. I have one master-xslt, which invokes three other xslts. Neither of these three other xslts is a stand-alone xslt. I just use them to make the complex project more readable, they are "plug-in" modules to the master xslt (I use xslt v2.0, btw.). However, the main architecture of the output tree is being built in the master xslt (for example, the XHTML prolog and similare stuff). So, when editing the master-xslt I would have liked to assign the modules somehow with oXygen, so I can see all the parts of the complete project in the Input view. Gives a better overview, especially since ODF does style declarations both in contents.xml as well as in styles.xml.

Not sure, whether other users would like to have something like this, too. But it certainly would enhance project-readability (what I mean is, that I read the project not with a text-editor only, but with oXygen and all the views onto the projct, you could reterm 'readability' with 'overview') when I could have a view onto the complete data I am working on.
Andreas

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: XQuery/XSLT Input View and more than one XML input?

Post by sorin_ristache » Wed Jul 02, 2008 5:34 pm

Hello,

The XSLT/XQuery Input view shows the structure of the main XML input of the transformation, that is the XML input specified in the XML URL field of the transformation scenario. How do your module stylesheets read their input? Do they read styles.xml, meta.xml and content.xml with the document() XSLT function? In that case it is very difficult (and currently not available in Oxygen) to find all the XML files needed by the module stylesheets and display them in the XSLT/XQuery Input view. Do they process a master XML file which includes the module XML files and which is set as the standard XML input of the transformation scenario? In that case the structure of each XML module is available inside the structure of the master XML file displayed in the XSLT/XQuery Input view.


Regards,
Sorin

amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

Re: XQuery/XSLT Input View and more than one XML input?

Post by amix » Mon Jul 07, 2008 8:42 pm

sorin wrote:Do they read styles.xml, meta.xml and content.xml with the document() XSLT function?
Yes.
In that case it is very difficult (and currently not available in Oxygen) to find all the XML files needed by the module stylesheets and display them in the XSLT/XQuery Input view.
Okay, no problem. Thanks for lining that out.
Andreas

Post Reply