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

RE: breaking up <tags> is hard to do

Subject: RE: breaking up <tags> is hard to do
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Tue, 22 Feb 2000 15:08:10 -0700
RE: breaking up <tags> is hard to do
> I'm trying to set an opening tag attribute based on the value 
> of my input; simple enough except that my closing tag needs
> to be outside of my select template.

Nope, it needs to be inside the template :)

Usually this question is asked in regards to constructing HTML tables, when
one wants to end a row with </tr> and start a new one with <tr> after having
generated some number of <td>...</td> cells in between.

Stop thinking about tags and start thinking about nodes.

The answer in your case is easy. Try this:

<xsl:template match="/">
  <Transaction>
    <EnrollmentRequest>
       <xsl:attribute name="servicetype">
         <xsl:choose>
           <xsl:when test="Transaction/LIN/LIN03='EL'">ELECTRIC</xsl:when>
           <xsl:otherwise>GAS</xsl:otherwise>
         </xsl:choose>
       </xsl:attribute>
       <!-- ... other stuff ... -->
    </EnrollmentRequest>
  </Transaction>
</xsl:template>
 


 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.