Subject: [xsl] Line Breaks From: "James Game" <jgame@xxxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 26 Sep 2005 13:42:16 +0100 |
Hi I would like to separate the data listed in the BulletPoints section of my XML (see below). Fortunately there is an * symbol seperating each line of data that I need. This data is then used to fill a predertimed set of Rows for each tag so I will need to create tags for each new line created. If anyone could point me in the right direction it would be much appreciated. James XML <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!--RT Generated XML file--> <property> <Price>125950.00</Price> <Unit /> <Building /> <StreetNumber>55</StreetNumber> <StreetName>Priors Drive</StreetName> <Village>Old Catton</Village> <Town>NORWICH</Town> <County>Norfolk</County> <PostCode>NR6 7LJ</PostCode> <BulletPoints><![CDATA[Entrance Lobby * Kitchen * Lounge * 2 Bedrooms * Bathroom * Gas Fired Radiator Central Heating * Sealed Unit Double Glazing * Gardens * Car Parking * Cul-de-Sac position * (Ref: 46479/MH) ]]></BulletPoints> <Status>Under offer</Status> </property> XSL <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 match = "/" > <DATAPACKET Version="2.0"> <xsl:call-template name="CDSMetaData"/> <ROWDATA> <xsl:apply-templates/> </ROWDATA> </DATAPACKET> </xsl:template> <xsl:template name="CDSMetaData"> <METADATA> <FIELDS> <FIELD attrname="Price" fieldtype="string" WIDTH="255" /> <FIELD attrname="Unit" fieldtype="string" WIDTH="255" /> <FIELD attrname="Building" fieldtype="string" WIDTH="255" /> <FIELD attrname="StreetNumber" fieldtype="string" WIDTH="255" /> <FIELD attrname="StreetName" fieldtype="string" WIDTH="255" /> <FIELD attrname="Village" fieldtype="string" WIDTH="255" /> <FIELD attrname="Town" fieldtype="string" WIDTH="255" /> <FIELD attrname="County" fieldtype="string" WIDTH="255" /> <FIELD attrname="PostCode" fieldtype="string" WIDTH="255" /> <FIELD attrname="BulletPoints" fieldtype="string" WIDTH="255" /> <FIELD attrname="Status" fieldtype="string" WIDTH="255" /> </FIELDS> </METADATA> </xsl:template> <xsl:template match="property"> <xsl:variable name="Price" select="Price" /> <xsl:variable name="Unit" select="Unit" /> <xsl:variable name="Building" select="Building" /> <xsl:variable name="StreetNumber" select="StreetNumber" /> <xsl:variable name="StreetName" select="StreetName" /> <xsl:variable name="Village" select="Village" /> <xsl:variable name="Town" select="Town" /> <xsl:variable name="County" select="County" /> <xsl:variable name="PostCode" select="PostCode" /> <xsl:variable name="BulletPoints" select="BulletPoints" /> <xsl:variable name="Status" select="Status" /> <ROW Price="{$Price}" Unit="{$Unit}" Building="{$Building}" StreetNumber="{$StreetNumber}" StreetName="{$StreetName}" Village="{$Village}" Town="{$Town}" County="{$County}" PostCode="{$PostCode}" BulletPoints="{$BulletPoints}" Status="{$Status}" /> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] What is wrong with this c, David Carlisle | Thread | Re: [xsl] Line Breaks, David Carlisle |
RE: [xsl] What is wrong with this c, Jarno.Elovirta | Date | Re: [xsl] Line Breaks, David Carlisle |
Month |