Several output files in several maps

Here should go questions about transforming XML with XSLT and FOP.
birstrack
Posts: 16
Joined: Wed Jun 29, 2011 12:28 pm

Several output files in several maps

Post by birstrack »

I have one inputfile for my XSLT transformation and I want to generate several outputfiles, each in a separate folder.

In my XSLT I have:

<xsl:template match="lcInteraction">
<xsl:for-each select="*">
<xsl:variable name="map" select="/learningAssessment/@id"/>
<xsl:variable name="item" select="concat(/learningAssessment/@id, '.xml')"/>
<xsl:result-document method="xml"
href="{$map}/{$item}" >
<xsl:element name="qti:assessmentItem">

But this isn't working.
And anyway, what do I have to fill in the XSLT transformation form?
XSLT_output.PNG
XSLT_output.PNG (23.61 KiB) Viewed 1586 times
Mircea
Posts: 131
Joined: Tue Mar 25, 2003 11:21 am

Re: Several output files in several maps

Post by Mircea »

Hello,

Since all the output is generated through the <xsl:result-document> there is no nedd to fill the "Save As" field.
If you need help with the stylesheet please send us some samples files on our support email address (support@oxygenxml.com) and we will try to help you.

Regards,
Mircea.
Mircea Enachescu
<oXygen> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
birstrack
Posts: 16
Joined: Wed Jun 29, 2011 12:28 pm

Re: Several output files in several maps

Post by birstrack »

In my script I have now:

<xsl:template match="map">
<xsl:for-each select="descendant::topicref">
<xsl:result-document method="xml" href="LO_{@cci-idref}.xml">
...

This works ok.

But I really would like, that all generated files are stored in the same sub-map.
How can I do that?
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Several output files in several maps

Post by tavy »

Hello,

I do not understand exactly how do you want to generate the result files. Maybe you can give me some examples of your map file content and how you configured the XSLT transformation.
Probably you can use the resolve-uri() and base-uri() functions to generate the result in the map folder. Something like this:

Code: Select all

<xsl:template match="map">
    <xsl:for-each select="descendant::topicref">
        <xsl:variable name="name" select="concat('LO_',@cci-idref,'.xml')"/>
        <xsl:variable name="uri" select="resolve-uri($name,base-uri())"/>
        <xsl:result-document method="xml" href="{$uri}">
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply