Subject: [xsl] Variable Problems From: "James Game" <james_game2002@xxxxxxxxxxxxx> Date: Tue, 06 Sep 2005 15:16:06 +0000 |
<?xml version="1.0" encoding="iso-8859-1"?> <desc> <detail name="id">1000001</detail> <detail name="price">Offers in the region of £358,000</detail> <detail name="address1">Blenheim House, Lincoln Lane</detail> <detail name="address2">Blackwell</detail> <detail name="typedesc"> 4 Bedroom Detached House</detail> <detail name="image">999\nikonhse.jpg</detail>
<section name="bullets"> <d>4 Bedrooms</d> <d>Drawing Room</d> <d>Dining Room</d> <d>Fitted Breakfast Kitchen</d> <d>Family Bathroom</d> <d>Study</d> <d>Gas Central Heating</d> <d>Large Double Garage</d> </section>
<section name="pics"> <g d="">999\lounge1.jpg</g> <g d="">999\rdraw.jpg</g> <g d="">999\garden1.jpg</g> <g d="">999\rdine2.jpg</g> <g d="">999\rkitch.jpg</g> <g d="">999\c1cons1.jpg</g> <g d="">999\rbed.jpg</g> <g d="">999\rbath.jpg</g> <g d="">999\rgarden.jpg</g> </section> </desc>
<xsl:key name = "test" match = "detail" use = "@name" /> <xsl:key name = "test2" match = "section" use = "@name" />
<xsl:template match = "/" > <DATAPACKET Version="2.0"> <xsl:call-template name="CDSMetaData"/> <ROWDATA> <xsl:apply-templates select = "key('test','id')" /> <xsl:apply-templates select= "key('test','price')" /> <xsl:apply-templates select= "key('test','address1')" /> <xsl:apply-templates select= "key('test','address2')" /> <xsl:apply-templates select= "key('test','typedesc')" /> <xsl:apply-templates select= "key('test','image')" /> <xsl:apply-templates select= "key('test2','bullets')" /> <xsl:apply-templates select= "key('test2','pics')" /> </ROWDATA> </DATAPACKET> </xsl:template>
<xsl:template match = "detail" > <xsl:text > </xsl:text> <xsl:value-of select = "." /> </xsl:template>
<xsl:template> <xsl:variable name="id" select="(id)" /> <xsl:variable name="price" select="price" /> <xsl:variable name="address1" select="address1" /> <xsl:variable name="address2" select="address2" /> <xsl:variable name="typedesc" select="typedesc" /> <xsl:variable name="image" select="image" /> <xsl:variable name="bullets" select="@image"/>
<ROW id="{$id}" price= "{$price}" address1= "{$address1}" address2= "{$address2}" typedesc= "{$typedesc}" image= "{$image}" bullets= "{$bullets}"/>
</xsl:template> </xsl:stylesheet>
Many Thanks, James
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Solution: Passing Cookie , Joris Gillis | Thread | Re: [xsl] Variable Problems, Joris Gillis |
[xsl] Solution: Passing Cookie Valu, Michael | Date | [xsl] Template priority problem, Chris Bowditch |
Month |