Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Does anyone know why this transformation doesn't work with the current xsl namespace?

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 7/26/2008 9:45:00 AM



"CK" <c_kettenbach@h...> wrote in message 
news:hHnik.5779$np7.5361@f......
> This works with the old namespace just fine.
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
>    <xsl:template match='/'>
>         <div>
>             <xsl:apply-templates 
> select='ArrayOfString'></xsl:apply-templates>
>         </div>
>     </xsl:template>
>     <xsl:template match='ArrayOfString'>
>         <xsl:apply-templates select='string'></xsl:apply-templates>
>     </xsl:template>
>     <xsl:template match='string'>
>         <div>
>             <span><xsl:value-of select="."/></span>
>         </div>
>     </xsl:template>
> </xsl:stylesheet>
>
>
>
> but when I use the current namespace
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> version="1.0">
>    <xsl:template match='/'>
>        <div>
>            <xsl:apply-templates 
> select='ArrayOfString'></xsl:apply-templates>
>         </div>
>     </xsl:template>
>     <xsl:template match='ArrayOfString'>
>         <xsl:apply-templates select='string'></xsl:apply-templates>
>     </xsl:template>
>     <xsl:template match='string'>
>         <div>
>             <span><xsl:value-of select="."/></span>
>         </div>
>     </xsl:template>
> </xsl:stylesheet>
>
> the output fails and just gives me the processor instruction and one div 
> tag.
> <?xml version="1.0" encoding="UTF-16"?><div></div>
>
> Am I doing something wrong? Any ideas how to make it work with the current 
> namespace?
>
> Thanks,
> ~CK
http://www.w3.org/TR/WD-xsl is an older namespace for XSLPattern, an 
obsolete transformation technology that Microsoft invented before the 
current XSLT was finalised. It's very different to XSLT.
That being said I don't see anything terribly wrong with the actual 
transform although XSLPattern treated namespaced elements differently and I 
suspect your XML uses these. Take a look at 
http://www.dpawson.co.uk/xsl/sect2/N5536.html especially numbers 13 and 23 
and if that doesn't help show the XML you're trying to transform.

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent