Subject: Re: [xsl] Variable Problems From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Wed, 07 Sep 2005 12:56:06 +0200 |
Hi Joris (don't know what happened with previous post)
This is an example of data I have pulled from another source and I will be looking for the same structure. The fields are obviously named slightly different but you get the idea. This is the output I receive once run through Oxygen using Xalan.
Im not too sure where the XML / XSL disagree (original post)- could you point that out for me.
<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: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="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>
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Gaudiam omnibus traderat W3C, nec vana fides
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Variable Problems, James Game | Thread | [xsl] Template priority problem, Chris Bowditch |
Re: [xsl] Multiple source documents, Sylvain Hellegouarch | Date | xxRe: [xsl] efficient use of key el, Manfred Staudinger |
Month |