Subject: Re: [xsl] Calling templates based on node contents From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 18 Aug 2004 15:26:05 +0100 |
> Unfortunatly I get the same result with your template as I did with mine. It's rather hard to debug since you still have not really shown either your input or desired output or what rules you are wanting to apply to get from one to the other. I suggested: <xsl:template match="contentField"> <a class="{concat(contentFieldElement, '_', contentFieldStyle)}" and you say you got <a class="defaultField_default" href="Default url text -- please update">Default text -- please update</a> <a class="defaultField_A" href="Default url text -- please update">Default text -- please update</a> So I assume that some of your input had a contentFieldStyle of A (although the sample you posted did not) ideally the output should look like: <span class="defaultField_default">Default text -- please update</span> <a class="defaultField_A" href="Default url text -- please update">Default text -- please update</a> again you haven't given any indication of what rules you want to apply that would give that output, I could guess some rules such as if there is a contentItemValue[@type='url'] make an <a href=> otherwise make a <span> in which case you need two templates, such as: <xsl:template match="contentField[contentFieldValue/contentItem/contentItemValue[@type='url']]"> <a class="{concat(contentFieldElement, '_', contentFieldStyle)}" href="{contentFieldValue/contentItem/contentItemValue[@type='url']}"> <xsl:value-of select="contentFieldValue/contentItem/contentItemValue[@type='text']"/> </a> </xsl:template> <xsl:template match="contentField"> <span class="{concat(contentFieldElement, '_', contentFieldStyle)}"> <xsl:value-of select="contentFieldValue/contentItem/contentItemValue[@type='text']"/> </span> </xsl:template> But there could be any number of other rules that you have in mind that would lead to your desired output. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Calling templates based o, cking | Thread | RE: [xsl] Calling templates based o, Ben Gazzard |
Re: [xsl] namespace prefix weirdnes, Colin Paul Adams | Date | [xsl] group data in XSL, Tham Tinh |
Month |