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

RE: xsl:attribute -- is this doing what I hope?

Subject: RE: xsl:attribute -- is this doing what I hope?
From: Américo Albuquerque <aalbuquerque@xxxxxxxxxxxxxxxx>
Date: Mon, 28 Apr 2003 20:16:48 +0100
RE:  xsl:attribute -- is this doing what I hope?
Hi

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Kathy Burke
> Sent: Monday, April 28, 2003 7:49 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  xsl:attribute -- is this doing what I hope?
That depends on what is you want to do

> 
> 
> 
> I have a <step> element with a "timer" attribute. If the 
> @timer = yes, I want to create 2 additional attributes for 
> the <step>. Please tell me where I'm going wrong...again.
> 
> Thanks...again.
> 
> Kathy
> 
> 
> <xsl:template match="@timer">
> 	<xsl:if test=".='yes'">
> 		<xsl:attribute name="Start"></xsl:attribute>
> 		<input type="button" value="Start"></input>
This will create an empty attribute named 'Start' and add a child element
<input .../>

> 		<xsl:attribute name="Finish"></xsl:attribute>
This will not work because you have already create a child element. You
can't create attributes after creating child nodes (elements, text,
comments,etc). You'll have to create the attributes before


> 		<input type="button" value="Finish"></input>
This will add a second <input .../> child element

> 	</xsl:if>
> </xsl:template>
> 

If you have something like:
<somenode timer="yes"/>

After applying that template you'll end with:
<somenode start="">
 <input type="button" value="Start"/>
 <input type="button" value="Finish"/>
</somenode>




 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.