This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Setting a base href in xsl:include


> I'm trying to avoid the use of a fully qualified
> URL in the xsl:include statement for portability
> reasons....
>
> For example,
> <xsl:include href="common.xsl" /> won't work for
> me because it is not in context with the executing
> program (Java).

I'm not quite sure what you mean by that... presumably the problem is that
the base URI of the stylesheet is either unknown, or different from that
required to use common.xsl as a relative URI.

  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.

Correct, the value of the parameter is a (relative or absolute) URI, it
can't be an expression that is evaluated to produce a URI, or even an
attribute value template.
>
> 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.

You should be able to do that using the setSystemId() method on the Source
interface.

An alternative is to define a URIResolver and handle the URI in your own
code, returning the included stylesheet module as another Source object.

Mike Kay


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]