Subject: Re: [xsl] Setting a base href in xsl:include From: John Hurst <ajh@xxxxxxxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 18 Sep 2001 14:58:09 +1000 |
<received from="Chas Mick" date="17 Sep 2001" time="09:52"> <response> G'day Chas, I have a similar scenario which I solved by means of a (Unix) hack: 1. The XSLT templates generate URLs of the form ****WEBSERVER****/common/directory/path 2. In each source directory, I have a dummy "web" subdirectory, that contains pages for shipping to the ultimate server. 3. My makefile has entries of the form for each server destination: server: all @if [ ! -d web ] ; then mkdir web ; fi for f in $(FILES) ; do \ sed -e 's#****WEBSERVER****#http://server/base#g' <$$f >web/$$f ; \ done rsync -a web/ $(SERVERPAGE)/ where $(FILES) define the pages you want shipped to the server; and $(SERVERPAGE) defines a (possibly remote) server directory. Nothing to do with XSLT (apart from step 1), but it works fine. </response> Hello, I'm trying to avoid the use of a fully qualified URL in the xsl:include statement for portability reasons. Also, the deployment of my XSLT maps is different from the site of my executing program, so I can't use relative URLS. I'm using Xalan 1.3. For example, <xsl:include href="common.xsl" /> won't work for me because it is not in context with the executing program (Java). My ideal solution is to pass the base href in an XSL parameter and say: <xsl:include href="concat($baseUrl, 'common.xsl') />....but the processor does not seem to dereference or resolve any parameters within the include statement. That is, it seems to look for the literal file named 'concat($baseUrl, 'common.xsl')'. Is there another way to do this. Also, within the Xalan API, I do not see any way to set a base href within the Source interface, which is how one needs to feed a stylesheet into the tranformation process. Has anybody thought of any work-arounds to this issue? Thank you, Charles Mick XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list </received> cheers, --John Hurst -- Associate Dean (Teaching), Faculty of Information Technology -- Associate Professor, School of Computer Science and Software Engineering --rm G23, Building 63 --PO Box 26, Monash University, Clayton, VIC 3168 ~ ~~~&#: --ajh@xxxxxxxxxxxxxxxxxx +61 3 990 55192 _..___ ---____@___H__ --(mob 0407 569 041) (fax +61 3 990 55146) |_____[_|_________[__]_ --http://www.csse.monash.edu.au/~ajh oo oo oo O--O--O o=o --free times, see http://www.csse.monash.edu.au/~ajh/cgi-bin/appointments.cgi XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Setting a base href in xs, Michael Kay | Thread | [xsl] Auto refreshing with XSL, Shaun Lizzio |
RE: [xsl] questions?, Jarno . Elovirta | Date | Re: [xsl] questions?, Christopher R. Maden |
Month |