Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Does anyone know why this transformation doesn't work with the current xsl namespace? [Thread Next] Re: Does anyone know why this transformation doesn't work with the current xsl namespace?To: NULL Date: 7/29/2008 7:45:00 PM I refer you to my first response about namespaces. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name "CK" <c_kettenbach@h...> wrote in message news:Hsnjk.16571$mh5.7714@n...... >I am trying to transform the follwing xml > <?xml version="1.0" encoding="utf-8" ?> > <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"> > <string>blah blah blah</string> > <string>blah blah blah</string> > <string>blah blah blah</string> > <string>blah blah blah</string> > <string>blah blah blah</string> > <string>blah blah blah</string> > </ArrayOfString> > > Any ideas on getting this to work with the exisiting schema? Thanks for > your help. > Cheers, > ck > > > "Joe Fawcett" <joefawcett@n...> wrote in message > news:DE46BE9C-D52F-448E-A6D1-A4F797FBD684@m...... >> >> >> "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 >> >> > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
