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

RE: generating text from an attribute

Subject: RE: generating text from an attribute
From: "Spychalski, Frank" <frank.spychalski@xxxxxxx>
Date: Tue, 18 Jul 2000 00:54:30 +0200
RE: generating text from an attribute
->-----Original Message-----
->From: Foster, Justin (IT_Architecture) [mailto:JFoster@xxxxxxxxxxx]
->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>

You need something like:

<xsl:template name="PARENT">
  My name ist <xsl:value-of select="CHILD/@name"/>. I am <xsl:value-of
select="CHILD/@age"/> years old.
</xsl:template>

if you have multiple childs add a <xsl:foreach select="CHILD"> ... </..> and
change CHILD/@name to @name

Frank
-
Work is the curse of the drinking class. (Oscar Wilde)
Frank Spychalski                   frank@xxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.