[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] URL rewriting with session id


Subject: RE: [xsl] URL rewriting with session id
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Wed, 27 Aug 2003 11:34:53 +0100

> <xsl:copy-of select="document(
'../xml_inc/documentname.xml')/include/*"/>
> 
> The problem is that these documents have hyperlinks embedded in them,
but
> these of course do not have the session ID.  How to do extend the xsl
> statement above to put in the session ID?

You want to use a custom URIResolver that handles the document()
request.  You can then SAX parse the XHTML document on its way 'through'
the uri resolver modifying the hrefs with the session ids.

http://www.cafeconleche.org/books/xmljava/chapters/ch17s02.html#d0e32363

...gives an example of a URIResolver returns a gzipped version of a
document.  Examples are sparse but its not that hard to do.  Write your
sax parser first and make sure it gives you the output you want, then
call it from your URIResolver.
 
Remember to use setURIResolver() on the Transformer and not on the
TransformerFactory as that handles the document() calls, only
import/include instructions are handled by the resolver set on the
factory. (iirc).

andrew

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords