Page 1 of 1

Several output files in several maps

Posted: Tue May 11, 2021 1:55 pm
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 1587 times

Re: Several output files in several maps

Posted: Wed May 12, 2021 4:41 pm
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.

Re: Several output files in several maps

Posted: Thu May 20, 2021 5:35 pm
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?

Re: Several output files in several maps

Posted: Mon May 31, 2021 12:00 pm
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