Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - problem with xslt [Thread Next] Re: problem with xsltTo: NULL Date: 11/6/2005 11:40:00 PM paulhux174@h... wrote: > > <Books> > <Book> > <Desc>AAA</Desc> > <Type>FRZ</Type> > </Book> > <Book> > <Desc>BBB</Desc> > <Type>ABC</Type> > </Book> > <Book> > <Desc>DDD</Desc> > <Type>DEF</Type> > </Book> > <Book> > <Desc>EEE</Desc> > <Type>HIJ</Type> > </Book> > </Books> > > <xsl:element name=:value-of select="Type" namespace=""> > <xsl:attribute name=$attrName> > <xsl:value-of select="Desc"/> > </xsl:attribute> > </xsl:element> > > What I want to achieve is > <AAA Desc="FRZ"> > <BBB Desc="ABC"> > <DDD Desc="DEF"> > .... > Can you see if mt xslt is correct? I have no idea what your XSLT is trying to do, and your specified output is not well-formed XML. To get the output I think you mean, use: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:strip-space elements="*"/> <xsl:template match="Type"> <xsl:text><</xsl:text> <xsl:value-of select="."/> <xsl:text> Desc="</xsl:text> <xsl:value-of select="preceding-sibling::Desc"/> <xsl:text>"/>
</xsl:text> </xsl:template> <xsl:template match="Desc"/> </xsl:stylesheet> ///Peter -- XML FAQ: http://xml.silmaril.ie/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
