cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pier P. Fumagalli" <>
Subject Re: XSLT and namespaces: two different planets
Date Fri, 25 Aug 2000 01:10:47 GMT
Stefano Mazzocchi wrote:
> I got my hands dirty with SAX2 and, man, I love their namespace support,
> it's great, clean, perfect, just fits perfectly with what I need.
> Then I look at XSLT and, hmmm, their level of namespace support isn't
> quite what I like... ok, let's make an example:
>  <my:page xmlns:my="">
>    ...
>  </my:page>
> How would a "normal" person access this in XSLT? simple
>  <xsl:template match="my:page">
>  </xsl:template>
> All right (I know you already smell the problem, but keep going) then I
> move my page to
>  <my-stuff:page xmlns:my-stuff="">
>   ...
>  <my-stuff:page>
> because I found that that the "my" prefix is used in another (and more
> famous) schema.
> Great, while good behaving SAX2 applications don't give a damn since the
> "page" element is correctly interpreted (in memory) as
> no matter what prefix is used (as the namespace spec rules), in XSLT...
> well, I honestly don't know.
> Please help, the XPath spec is not very clear about this.

Heh... Nice point... I really don't know since that's an XPATH
expression. I took a look at the <xsl:namespace-alias> but it seems that
this tag just converts the namespaces inside the stylesheet XML, not
inside the source XML...
I believe you have to change the prefix in the whole XSLT file, but, of
course, this sucks...

So, the question becomes, is there a way to associate a specific
namespace URI with a prefix into an XPATH expression???


View raw message