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

attribute management

Subject: attribute management
From: "bix xslt" <bix_xslt@xxxxxxxxxxx>
Date: Thu, 21 Nov 2002 16:10:45 +0000
attribute management
All,

I've run into some difficulty attempting to define an attribute. Essentially, I'm getting excess spaces, and I'd really like them removed while keeping the formatting the same for readability. Below is a sample xml and xslt.

Essentially, I'm trying to setup a 'default' set of options at the top of the xml file, and then specifics are found under the icon tags below.

Any help would be appreciated!
Thanks,
Brian

XML:

<content>
 <uri>
   <dir>./pics</dir>
   <root>btn</root>
   <img_ext>gif</img_ext>
   <link_ext>html</link_ext>
 </uri>
 <target>body</target>
 <icon id="cont_mot">
   <text>Motivation</text>
   <uri><root>mot</root></uri>
 </icon>
 <icon id="cont_req">
   <text>Requirements</text>
   <uri><root>req</root></uri>
 </icon>
</content>


XSLT:


 <xsl:template name="uri">
   <xsl:attribute name="background">
     <xsl:choose>
       <xsl:when test="./uri/dir">
         <xsl:value-of select="./uri/dir" />
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="/content/uri/dir" />
       </xsl:otherwise>
     </xsl:choose>/

     <xsl:choose>
       <xsl:when test="./uri/root">
         <xsl:value-of select="./uri/root" />
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="/content/uri/root" />
       </xsl:otherwise>
     </xsl:choose>.

     <xsl:choose>
       <xsl:when test="./uri/img_ext">
         <xsl:value-of select="./uri/img_ext" />
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="/content/uri/img_ext" />
       </xsl:otherwise>
     </xsl:choose>
   </xsl:attribute>
 </xsl:template>




_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



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.