dayvonjersen / ajaxslt

Automatically exported from code.google.com/p/ajaxslt
Other
0 stars 0 forks source link

wrong handling of XML namespaces. #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. trying to transfrom this xml:
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="AA">
Hello World!
</page>

2. using this xslt:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:aa="AB">

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="aa:page">
   <xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>

I expect to see:
Hellow world!

But result is empty.

What version of the product are you using? On what operating system?
MsWindows XP SP 2
Opera 9.26
FF 2.0.0.12
ajaxslt-0.8.1.tar.gz

Please provide any additional information below.

Another view on the same bug:
lets transform following xml:
<?xml version="1.0" encoding="UTF-8"?>
<aa:page xmlns:aa="AA">  <!-- AA namespace -->
Hello World!
</aa:page>

with following xslt:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:aa="ZZ"> <!-- ZZ namespace -->

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="aa:page">
   <xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>

Expected result: Empty, because namespaceses actually are different.
Actual result: Hello World!

It looks like engine doesn't handle namespace prefixes at all, treating
them just as begining of tags names.

Original issue reported on code.google.com by mial...@gmail.com on 13 Mar 2008 at 3:56

GoogleCodeExporter commented 9 years ago
From the README file: 

 The implementation is all agnostic about namespaces. It just expects
 XSLT elements to have tags that carry the xsl: prefix, but we
 disregard all namespace declaration for them.

Original comment by me...@google.com on 14 Mar 2008 at 5:45