[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Design question
You could do what you say, but why not doing the following:
<xsl:template match="test[@type='positive']"> <da:Positive name="@name"> <xsl:for-each select="param"> <xsl:choose> <xsl:when test="starts-with(@name,'p')"> <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:element name="da:Date"> <xsl:attribute name="number"><xsl:value-of select="substring(@name,4)"/></xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> </xsl:element> </xsl:otherwise> </xsl:choose> </xsl:for-each> </da:Positive> </xsl:template> Beware: untested. Antonio Jay Burgess wrote: I'm attempting to use XSL to transform XML to XML. The problem is that some child elements in the original XML are "attributes" of the new XML element, whereas other child "elements" are actually new child elements. That is: XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|