cocoon-users mailing list archives

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


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:choose>

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

        .
        .
        .

        </xsl:when>

        <xsl:otherwise>

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

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

        </xsl:otherwise>

        </xsl:choose>


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: "http://www.xyz.com/abc/duck.xml" then following the
relative link "?aspekt=zutaten" would result in:
"http://www.xyz.com/abc/?aspekt=zutaten" instead of
"http://www.xyz.com/abc/duck.xml?aspekt=zutaten" 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


Mime
View raw message