473,569 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<xsl:if> problem

I tried to do this :
<xsl:if test="ToutCompr is">
some output
</xsl:if>

ToutCompris is a boolean element in my XML file

My problem is the output is parse even when ToutCompris is false
I tried <xsl:if test="ToutCompr is = true"> and it does'nt work
either

What's the right way to do this ?

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #1
2 1731
websls wrote:
I tried to do this :
<xsl:if test="ToutCompr is">
some output
</xsl:if>

ToutCompris is a boolean element in my XML file


XSLT 1.0 doesn't support XSD schema types.

Try

<xsl:if test="ToutCompr is='true' or ToutCompris='1' ">
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #2
>I tried to do this :
<xsl:if test="ToutCompr is">
some output
</xsl:if>

ToutCompris is a boolean element in my XML file


What do you mean by "boolean element"? As far as I know, everything in
a XML file is pretty much text strings only.

What does your <ToutCompris> element look like exactly?

If it's something like

<ToutCompris>tr ue</ToutCompris>

then your check would have to be:

<xsl:if test="ToutCompr is = 'true'">

Put the 'true' in single quotes, to tell XSL it's a string you're
comparing to - otherwise, it'll look for a XPath expression called
"true" (and won't find anything).

Marc

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1415
by: Vijay singh | last post by:
Hi wonder if anybody can clear by doubt XML file : <score id="1"> <film>A Little Princess</film> <composer>Patrick Doyle</composer>
3
3137
by: Blaise Garant | last post by:
Hi I've made a stylesheet to transform my data into XSL-FO. This stylesheet used to work with MSXSL 4.0 but I've got some issues in ..NET. First, I changed removed all the "node-set()" function since they're not used anymore. But now, I used an <xsl:apply-templates/> and for some reason, it works in some situation but not in others. I...
5
2325
by: Luke Vogel | last post by:
Hi all, Probably a really basic question, but I cant find an answer ... I have an xml file of books something like: <product> <isbn>0-735-61374-5</isbn> <title>Microsoft Visual Basic Step By Step</title> <author>Michael Halvorsen</author> <subject>Programming</subject>
3
14271
by: tldisbro | last post by:
Hello All, I am trying to use the returned value of the <fo:page-number> element/function in my <xsl:if> test condition. But am unsuccessful in doing so. Is it possible to use it in this fashion with a conversion or correct syntax? I would like to test the current page number and see if it is even or odd - and if it is odd I would like to...
5
1220
by: ina | last post by:
Hello guys, My name is ina and I have a problem with a file xlst. I am newbie and sorry for this question, probably must be very simple. I have this xml file <?xml version="1.0"?> <Datasource> <cars><car><car_Short_Name>OPEL</car_Short_Name><car_Contracts><CtoF_Contract
2
13682
by: riceyeh | last post by:
Hi, What does <xsl:if test="not($values)"mean? What I do not understand is $values? Here, means array? And . = $value means current node is equal to the variable value? So the total meaning is "if not exists of value in array of values" ? But the result of '. = $value' is a boolean value, so '$values' should not mean "the value in values"....
5
3405
by: jhurrell | last post by:
I have been having some trouble getting my XSL style sheet to parse correctly. I have some XML outputted from an SQL-Server, that I then need to turn into multiple HTML files. This I have done with moderate success using Saxon and <xsl:result-document>, but Saxon is throwing an error and I don't know how to resolve it. Maybe someone can offer...
4
2429
by: mark4asp | last post by:
I'm getting a problem with this code and I think the offending linke is : <xsl:if test="$folder = 'Search'"> I want to test the value of the Folder element for a value of precisely "Search" and include the extra html as shown below if the test passes. The rest of the code validates and so, I hope, works. What am I doing so very wrong...
8
5644
by: Hoi Wong | last post by:
With the XSLT 1.0 engine that I was forced to use, I have to parse old XML scripts where the number (to be parsed and saved into $EPISODE_NUMBER_RAW) that I want to parse is written with a comma seperator if it goes beyond 3 digits. i.e. the variable might be parsed as a string '1,324' or a number 56, depending on which XML file I have. I...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.