[Home] [By Thread] [By Date] [Recent Entries]
Tempore 11:09:50, die 09/07/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit James Game <jgame@xxxxxxxxxxxxxxxxxxxxxxx>:
Hi Joris (don't know what happened with previous post) In your xslt, there ithis statement: <xsl:variable name="price" select="price" /> This will put the 'price' element (the child node of the context node) in a variable called 'price'. But there aren't any 'price' elements in your XML. TRy this stylesheet: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:output method="xml" />
<xsl:template name="CDSMetaData"> <METADATA> <FIELDS> <FIELD attrname="id" fieldtype="string" WIDTH="255"/> <FIELD attrname="price" fieldtype="string" WIDTH="255"/> <FIELD attrname="address1" fieldtype="string" WIDTH="255"/> <FIELD attrname="address2" fieldtype="string" WIDTH="255"/> <FIELD attrname="typedesc" fieldtype="string" WIDTH="255"/> <FIELD attrname="image" fieldtype="string" WIDTH="255"/> <FIELD attrname="bullets" fieldtype="string" WIDTH="255"/> </FIELDS> </METADATA> </xsl:template> <xsl:template match="desc"> <ROW> <xsl:apply-templates/> </ROW> </xsl:template> <xsl:template match="detail">
<xsl:attribute name="{@name}"><xsl:apply-templates/></xsl:attribute>
</xsl:template><xsl:template match="section[@name='bullets']/d">
<xsl:attribute name="starpoint{position()}"><xsl:apply-templates/></xsl:attribute>
</xsl:template><xsl:template match="section[@name='pics']/g">
<xsl:attribute name="image{position()}"><xsl:apply-templates/></xsl:attribute>
</xsl:template></xsl:stylesheet>
|

Cart



