Re: [xslt] namespace bug ?



Hi again

> it is well known (I don't know how many time I repeated it) that 
> non-namespaced QName in XPath expression do not select nodes which have 
> a namespace. In your test a is in a default namespace so /a cannot 
> select it. Is that the problem you're seeing ? If yes then that's 
> perfectly normal. 

The default namespace specified in the xslt is the same as in
the xml-file:

xmlns="http://asdf";

-----------------

In my stylesheet I have the same namespace two times:

 xmlns="http://asdf";
 xmlns:test="http://asdf";

The xpath "test:a" works well, but isn't it the same as "a" without 
a prefix?


-----------------------------------

To be more exact:
xmlns:test1="http://asdf";
xmlns:test2="http://asdf";
xmlns="http://asdf";

<xsl:value-of select="test1:a"/>
<xsl:value-of select="test2:a"/>
<xsl:value-of select="a"/>

test1, test2 and the default namespace are ident,
but the xpath without prefix does not work.

Hm, I hope my question is not too stupid.



Here again my example:
-------------------------


> Hi
> 
> I had a little problem with namespaces when I updated from
> libxslt 1.0.31,libxml2-2.5.8 to
> libxslt 1.0.33, libxml2-2.5.11
> 
> I made a little Testcase the showes the difference:
> 
> 
> XSLT:
> ======
> 
> 
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>  xmlns:exsl="http://exslt.org/common";
> xmlns="http://asdf";
> xmlns:test="http://asdf";
>  extension-element-prefixes="exsl" exclude-result-prefixes="exsl test"
> >
> <xsl:output method="xml" encoding="utf-8" indent="yes"/>
> 
> <xsl:template match="/">
> <testcase>
> <!-- behaviour changed -->
> <notworking>
>         <xsl:copy-of select="exsl:node-set(document('test.xml'))/a"/>
> </notworking>
> <workaround>
>         <xsl:copy-of select="exsl:node-set(document('test.xml'))/test:a"/>
> </workaround>
> </testcase>
> </xsl:template>
> 
> 
> </xsl:stylesheet>
> 
> 
> XML:
> =====
> <a xmlns="http://asdf";>
> <c/>
> </a>
> 
> 
> Please have a look at this.
> 
> Bernhard Zwischenbrugger
> http://datenkueche.com
> 


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]