This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:include href attribute
- From: Nathan Shaw <n8_shaw at yahoo dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Tue, 16 Jul 2002 11:02:51 -0700 (PDT)
- Subject: Re: [xsl] xsl:include href attribute
- Reply-to: xsl-list at lists dot mulberrytech dot com
My bad David, you are right. Let me expound a bit on
why I am trying to use a var in the href attribute.
I am trying to include the file from another server
via an http call as the xslt will be used by two
separate applications living on two separate boxes. I
do not want to have to have 2 separate copies of this
included xslt, therefore, I cannot use a relative URI.
The following two possible solutions don't apply to my
situation (although they are handy and I will tuck
them away for later).
- include a different stylesheet based on
circumstances
- use different templates in the included stylesheet
Basically, I just want to set the path in a var as it
is used several time throughout my master xslt and has
to be changed when it gets moved into production. I
just don't want to have to change it in 4 or 5 places.
Having it in a var means I only have to change it in
one place.
Not a truly large or show-stopping deal, but something
that I would like to be able to do regardless. I could
send in a var as suggested as well, but I don't see
that as much of an improvement over just hard-coding
it in the xslt itself.
--n
--- David Carlisle <davidc@nag.co.uk> wrote:
>
> > Guess I am screwed then,
> you can achieve any result you want, just not always
> the way you want to
> do it.
>
> You haven't said what you actually wanted to do,
> just what you tried
> using Xpath expressions in xsl:include.
>
> people try doing this for different reasons, and the
> suggested
> alternatives vary, so given no info, here's a random
> collection of
> possible answers.
>
> 1) use a relative URI (from the base stylesheet)
>
> 2) don't try to include different stylesheets from a
> common base
> depending on circimstances. Instead run different
> stylesheets
> depending on circumstances and get each of these
> stylesheets to
> import a common core stylesheet.
>
> 3) import all the stylesheets you might use, but
> make sure the templates
> use different modes, then in your main stylesheet
> apply templates in
> a given mode by testing your variable in an
> xsl:choose.
>
> 4) use perl instead of XSLT.
>
> David
>
>
_____________________________________________________________________
> This message has been checked for all known viruses
> by Star Internet
> delivered through the MessageLabs Virus Scanning
> Service. For further
> information visit http://www.star.net.uk/stats.asp
> or alternatively call
> Star Internet for details on the Virus Scanning
Service.
__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list