cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dr. Uwe Meyer-Gruhl" <>
Subject How to get the URI of an XML document in an XSL stylesheet?
Date Tue, 09 Jan 2001 14:53:04 GMT

I have several XML files which are to be presented in either HTML or WML
by Cocoon.

The problem with WML is that there are severe length restrictions, which
I avoid by displaying only a certain aspect at a time. This can be done
by using <xsl:choose> and supplying an "aspekt" parameter in the XSLT
stylesheet like this:


        <xsl:when test="$aspekt='infos'">




                        <card id="rezept"><xsl:attribute
name="title"><xsl:value-of select="TITEL"/></xsl:attribute><p>

                        <a href="?aspekt=zutaten">Zutaten</a><br/>
                        <a href="?aspekt=anleitung">Anleitung</a><br/>
                        <a href="?aspekt=infos">Informationen</a><br/>



Alas, I found out that some WAP browsers (like the Nokia) interpret
relative URLs starting with a question mark relative to the last but one
path component (i.e. the file name). That means if the XML source
document was: "" then following the
relative link "?aspekt=zutaten" would result in:
"" instead of
"" as intended.
Matter-of-fact, this kind of relative URL is interpreted the "wrong" way
by Netscape Navigator and the "right" way by Internet Explorer also.

So I guess I have to find a way of generating the source document file
name from the stylesheet prepended to the "?aspekt=" part but have been
unlucky at finding out how. Is there a function or pre-defined variable
in Cocoon or Xalan or a method for that in standard XSLT?

Kind regards

Dr. Uwe Meyer-Gruhl

View raw message