XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Chris HolmesSubject: I'm sure the answer is simple...
Author: Chris Holmes
Date: 07 Feb 2007 08:45 AM
Hello All,

I have had to take over amending some XSLT and I know nothing!! I have picked up a few bits and pieces over a few weeks but there is one statement that I am struggling to get working as I wish. The statement is:

<xsl:if test="string(v2:referral-narrative-detail/@referral-answer-15)">

The test works fine where the data passed in the XML is text, but as soon as a number goes in it fails. Is there a way I can stop this, or is there a better way of performing this test?

Many thanks in advance for your help,

Chris

Postnext
Tony LavinioSubject: I'm sure the answer is simple...
Author: Tony Lavinio
Date: 07 Feb 2007 09:36 AM
What do you want the test to test?
It's not clear what your intent is.

What sort of values do you want to be true, and what sort false?
Or are you merely looking for the presence or absence of the attribute?

Postnext
Chris HolmesSubject: I'm sure the answer is simple...
Author: Chris Holmes
Date: 07 Feb 2007 09:40 AM
I am testing for the presence of any characters within that attribute, whether it be a string or a number. This will be displayed as text.

Many thanks for your response.

Postnext
Tony LavinioSubject: I'm sure the answer is simple...
Author: Tony Lavinio
Date: 07 Feb 2007 09:47 AM
Try <xsl:if test="v2:referral-narrative-detail/@referral-answer-15 != ''">

Posttop
Chris HolmesSubject: I'm sure the answer is simple...
Author: Chris Holmes
Date: 07 Feb 2007 10:16 AM
Thank you very much, I really appreciate your help. I know it probably seems really simple to you, but I've only just had a look at it!

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.