|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Apply-templates - how to omit top level element ta
On 9/7/05, Mike Schinkel <mikes@xxxxxxxxx> wrote: > Thanks. Question, I use "Name" in many contexts in my XML. How can I do this when I don't always want "Name" to be handled that way? > Check out modes, have choose statements, or be more selective in your apply-templates selectiong. Plenty of ways to do this and it's hard to tell advise any particular method without knowing more about your XML.templates and your style. Lets say you have Name appear in two places, in a description of the company and when the company is actually used in some text... so <description> <Name>some name</Name> more nodes </description> <text> whaaa wawa <Name>some name</Name> </text> could have two templates (code not tested) <xsl:template match="description"> <xsl:apply-templates mode="descript"/> </xsl:template> <xsl:template match="text"> <xsl:apply-templates mode="text"/> </xsl:template> <xsl:template match="Name" mode="descript"> <h1><xsl:value-of select="." /></h1> </xsl:template> <xsl:template match="Name" mode="text"> <span class="name"><xsl:value-of select="." /></span> </xsl:template> Jon Gorman
|
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
|

Cart








