The most likely explanation is that ExchangerXML is invoking Saxon without supplying a base output URI, meaning that the relative URI passed in the href attribute of xsl:result-document can't be resolved. To confirm this theory you'll have to ask the ExchangerXML developers. Or you might be able to work around it by supplying an absolute URI (starting file://...) as the href value.

Michael Kay
Saxonica


On 08/01/2013 21:23, padraic stack wrote:
I am trying to split an xml file into a number of html files. I am using <xsl:result-document> to do so.

I can do this and it works with Saxon HE 9.3.0.5 (in oXygen). I need it to work with the version of Saxon used in Exchanger xml (Saxon XSLT 2.0).

My xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="trans.xsl"?>
    
    <book>
        <chapter>
            <page pageID="101">
                <paragraph paraID="1">
                    <sentence>... </sentence>
                    ...
                </paragraph>
                </page>
                <page pageID="102">
                ....
        </chapter>
    </book>

My xsl is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
        <xsl:template match="/">
            <xsl:for-each select="//page">
            <xsl:result-document method="html" href="{@pageID}.html">
                <html>
                    <head>
                        
                <title>
                          Page <xsl:value-of select="@pageID"/>
                      </title>
                    </head>
                    <body>
                      ...
                    </body>
                </html>
             </xsl:result-document>
        </xsl:for-each>
        </xsl:template>
    </xsl:stylesheet>

Using Exchanger (Saxon 2.0) gives me the following error


> [9.1.0.3] Starting transformation ... FATAL ERROR: Exception thrown by
> OutputURIResolver; SystemID:
> file:/C:/Users/jack/trans.xsl;
> Line#: 5; Column#: -1 FATAL ERROR: Exception thrown by
> OutputURIResolver
>
> Transformation Interrupted!

I am aware that having the href value being a string would cause this error but I'm using the attribute value.


Does anyone have any ideas on where the problem might be?

Regards,

Padraic


------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help