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

Re: Failing string() test fail

Subject: Re: Failing string() test fail
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 26 Jun 2009 09:10:17 +0100
Re:  Failing string() test fail
> Correct, one Yes.  That is what I would expect.  So wondering why I am
> having a problem with my XML source.

whatever the problem is, it is in a part of your source, or part of your
stylesheet that you haven't shown us, so it's hard to offer much help.
Perhaps a DTD is defaulting the attribute for example.


You didn't say whether you are using xslt 1 or 2.


in xslt 1 

 <xsl:if test="string(C/@test)">

is true if there is a test attribute with non empty value and false if
there is not.

in xslt 2


 <xsl:if test="string(C/@test)">

is false if there is no test attribute or if the single test attribute
has value "", it is true if theer is a single test attribute, and that
has non empty value, and it is an error if there are more than 1 test
attributes.

Unless you intent test="" to test as false, it's more common to just
have

 <xsl:if test="C/@test">


which in xslt 1 or 2 is true if there is a test attribute and false if
there is not.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

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.