[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Newbie - apply-templates

Subject: Newbie - apply-templates
From: "David" <gaudimila@xxxxxxxxx>
Date: Thu, 30 Sep 2004 18:42:55 -0400
xsl apply templates body
I think this is a pretty basic question

Ive got a document of the following form (transforming to html).  I need
any mention of the state name (e.g. California) to be inserted where the
[statename/] element is.  I dont know how to write the XSLT transformation
for this to work.    I put below my first stab at the XSLT code, but I know
its incomplete. 

I think the part Im having difficulty with relates to the fact that
[statename/] appears  possibly multiple times  within the body text of an
element.  I dont think Ive ever had to code for a situation like this.

Thanks!
David

[doc]
            [body]
                        [para]Summary of Laws for [statename/][/para]
       [para]The laws in [statename/] are favorable to defendants.  If you
live in [statename/] then your outcome is secure.[/para]
            [/body]
[/doc]

And XSLT of the form:

[xsl:template match=/doc]
            [html]
                        [xsl:apply-templates/]
            [/html]
[/xsl:template]

[xsl:template match=body]
            [body]
                        [xsl:apply-templates/]
            [/body]
[/xsl:template]

[xsl:template match=para]
            [p][xsl:apply-templates/][/p]
[/xsl:template]

[xsl:template match=statename]
            [xsl:value-of select=$statename/]
[/xsl:template]

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.