[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: Charles Cantrell <chc@xxxxxxxxxxx>
Date: Tue, 18 Jul 2000 10:43:50 -0500
charles cantrell
<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


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.