[oXygen-user] xsl:result-document with no href causes "Cannot write to a URI that has already been read" err-XTRE1500

Andrew Welch
Tue Oct 28 09:18:31 CDT 2008


> If no output is specified for the result of a transformation oXygen sets the
> system ID as the stylesheet for the virtual result that is presented in the
> oXygen results area. That is why you get that error message. Without setting
> a system identifier for the output it would have not been possible to use
> relative locations for result document without setting an output destination
> in the transformation scenario.

Hi George,

I think the point is that:

    <xsl:template match="/">
            <foo/>
    </xsl:template>

and

    <xsl:template match="/">
        <xsl:result-document>
            <foo/>
        </xsl:result-document>
    </xsl:template>

...are equivalent - the output URI is the same in both cases - so the
exception shouldn't occur.

Fwiw, I do the same in Kernow (although it's been a while since I
wrote it and its all a bit hazy now) - when no output file is
specified (so all output goes to standard out) the base output uri is
the systemId of the stylesheet.... and in Kernow it seems fine.

I basically do:

controller.setBaseOutputURI(stylesheet.getSystemId());

....with the Result being a StreamResult(System.out).



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/



More information about the oXygen-user mailing list