[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Setting a base href in xsl:include

Subject: Re: Setting a base href in xsl:include
From: John Hurst <ajh@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Sep 2001 14:58:09 +1000
base href
<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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.