Subject: RE: [xsl] default attribute values? From: Americo Albuquerque <aalbuquerque@xxxxxxxxxxxxxxxx> Date: Fri, 12 Jul 2002 19:14:09 +0100 |
you could use xsl:if's <input type='text' name='n' value='x'> <xsl:if test="@size"><xsl:attribute name="size"><xsl:value-of select="@size"/></xsl:attribute></xsl:if> <xsl:if test="@maxlength"><xsl:attribute name="maxlength"><xsl:value-of select="@maxlength"/></xsl:attribute></xsl:if> </input> -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Sent: Friday, July 12, 2002 6:56 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] default attribute values? 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. Don't dream it. Be it. ;):):-):):-):):-)8') Michael McGlothlin <mogmios@xxxxxxxxxxxxxxxxx> http://kavlon.org/projects/ 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] default attribute values?, Michael | Thread | RE: [xsl] default attribute values?, Michael |
Re: [xsl] XPath iteration?, Derek Davies | Date | RE: [xsl] JSP includes in XSLT, Guy McArthur |
Month |