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

Re: default attribute values?

Subject: Re: default attribute values?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 12 Jul 2002 12:05:11 -0700 (PDT)
 Re: default attribute values?
--- Michael <mogmios at mlug dot missouri dot edu> wrote:

> 
> Is there a way to ignore an attribute or give it a default value if
> one
> wasn't set?
> 
> For example I have
> <text name='n' value'x'/>
> and want to output
> <input type='text' name='n' value='x'/>
> but also want to allow for cases where size and/or maxlength
> attributes
> are
> passed through such as
> <input type='text' name='n' value='x' size='10' maxlength='20'/>
> .
> 
> Right now I'm producing
> <input type='text' name='n' value='x' size='' maxlength=''/>
> which obviously is not producing very nice output.
> 
> Thanks.
> 

Hi Michael,

This is one way for specifying default values of missing attributes:

  <input type="{name()}" name="{@name}" value="{@value}"
         size="{not(@size)*$vDefltSize + concat('0', @size)}"


Hope this helped.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

 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.