[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Calling templates based on node contents
> 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 ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|