[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: generating text from an attribute
<xsl:template match="CHILD"> <p>My name is <xsl:value-of select="@name">. I am <xsl:value-of select="@age".</p> </xsl:template> Here is the complete stylesheet. <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:template match="/"> <html> <head> <title>People Stuff</title> </head> <body> <xsl:apply-templates select="ROOT"/> </body> </html> </xsl:template> <xsl:template match="ROOT"> <h1>Hello</h1> <xsl:apply-templates select="PARENT"/> </xsl:template> <xsl:template match="PARENT"> <h1>Hello</h1> <xsl:apply-templates select="CHILD"/> </xsl:template> <xsl:template match="CHILD"> <p>My name is <xsl:value-of select="@name"/>. I am <xsl:value-of select="@age"/>.</p> </xsl:template> </xsl:stylesheet> -----Original Message----- From: Foster, Justin (IT_Architecture) [mailto:JFoster@xxxxxxxxxxx] Sent: Monday, July 17, 2000 4:24 PM To: 'xsl-list@xxxxxxxxxxxxxxxx' Subject: generating text from an attribute Here's a newbie question. How do I generate the value of a attribute as text: i.e. <ROOT> <PARENT> <CHILD name="Bob" age="20"/> </PARENT> </ROOT> I want to output to html: <HTML> <HEAD> </HEAD> <BODY> My name is Bob. I am 20 years old.</BODY> </HTML> Justin Foster IT Architecture 253-596-3260 office 253-223-3108 mobile XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|