This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Assigning a dynamic value of href in a stylesheet PI
- From: "bryan" <bry at itnisk dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 25 Jul 2002 19:46:46 +0200
- Subject: RE: [xsl] Assigning a dynamic value of href in a stylesheet PI
- Reply-to: xsl-list at lists dot mulberrytech dot com
><xsl:template match="/">
> <xsl:processing-instruction name="xml-stylesheet">
> href="{concat($client, "-part-styler.xsl")} type="text/xsl"
> </xsl:processing-instruction>
></xsl:template>
as others already pointed out you could say
<xsl:processing-instruction name="xml-stylesheet">
href="<xsl:value-of select="concat($client,'-part-styler.xsl')"/>"
type="text/xsl"
</xsl:processing-instruction>
however I have to wonder if maybe instead of passing in stuff like ie5
or netscape as the value of your $client if you shouldn't try to
discover some common condition to your clients, i.e have a class of
clients, as it would no doubt make it easier to code.
Also you can check for your processor inside your stylesheet with
function-available()
>OFFTOPIC: Does anyone know how a HTTP header indicates that the client
>is Netscape (as opposed to IE)? The HTTP user-agent header field
>contains MSIE if the client is IE. If the client is Netscape there
>doesn't seem to be any way of identifying that the client is Netscape.
>Any ideas?
I don't know I've always been able to find that the HTTP_USER_AGENT
contains Netscape if I get a Netscape browser, I can't be more specific
than that without knowing your environment. Browse to this site for
examples of various user_agent strings:
http://www.zytrax.com/tech/web/browser_ids.htm
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list