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

Non Existent attribute, and other things.

Subject: Non Existent attribute, and other things.
From: Richard Mitchell <Richard.Mitchell@xxxxxxxxxxxxx>
Date: Mon, 12 Mar 2001 12:51:59 -0000
things that are non existent
Well I would have thought that a possibly non-existent
attribute is 0 or not would be

not(number(@value))

But that seems to return false when the attribute isn't
there. So I end up doing...

count(@value) = 0 or not(number(@value))

...which just seems a little awkward.

Also thanks for all of the help with the ancestor-or-self
business the other day. Because I was using the test so often
I have actually ended up putting it in a scripting tag ( sorry ).
As calling xsl:template xsl:with-param was just too much too often,
also could somebody explain what Jeni's suggestion meant when it
said...

key('Ps', $name)[count(.|$Ps) = count($Ps)]

...as I really don't understand it.


Finally I thought there was an equivalent to the C ?: notation
in XSL but I can't seem to find it. On several occasions in my
code I end with the same fragment.

		<xsl:variable name="shorter">
			<xsl:choose>
				<xsl:when test="@short">
					<xsl:value-of select="@short"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="@name"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<menu name="{$name}">

There must be a more succinct method.

Thanks for all the help but it looks like I won't be able
to persuade my company to send me to the XSLT conference so
hope you all have a good time.

Richard Mitchell
Software Developer
http://www.vbnonline.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.