Several output files in several maps

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

Several output files in several maps

Post by birstrack » Tue May 11, 2021 1:55 pm

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 267 times

Mircea
Posts: 90
Joined: Tue Mar 25, 2003 11:21 am

Re: Several output files in several maps

Post by Mircea » Wed May 12, 2021 4:41 pm

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: 15
Joined: Wed Jun 29, 2011 12:28 pm

Re: Several output files in several maps

Post by birstrack » Thu May 20, 2021 5:35 pm

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: 281
Joined: Thu Jul 01, 2004 12:29 pm

Re: Several output files in several maps

Post by tavy » Mon May 31, 2021 12:00 pm

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