473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Condition-clause in XSLT using .Net System.Xml

Hi.

I'm trying to execute a simple <xsl:if>-clause with a
condition that reads: a<1
In MSXML 4 the clause <xsl:if test="a &lt; 1">do
something...</xsl:if> works fine.
But in .Net Xml it just doesn't work. I can't use the real
character (<) because the XSLT wont be a valid XML.
And if I use the encoded representation (&lt;) it wont
compute at all.

Anybody got a clue what to do???

// Magus - Il Dottore
Nov 11 '05 #1
4 3944
Magus wrote:
I'm trying to execute a simple <xsl:if>-clause with a
condition that reads: a<1
In MSXML 4 the clause <xsl:if test="a &lt; 1">do
something...</xsl:if> works fine.
But in .Net Xml it just doesn't work. I can't use the real
character (<) because the XSLT wont be a valid XML.
And if I use the encoded representation (&lt;) it wont
compute at all.


Sounds weird. &lt; is exactly the same as < and of course works. Show us
reporoducible sample.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
It is weird.
Just make a simple XSLT file containíng.

<xsl:template match="root">
<root>
<xsl:if test="@a &lt; 5">
<element />
</xsl:if>
</root>
</xsl:template>

then write some simple C# code and use the System.Xml
assembly to transform the simple XML-document
<root a="4" />

the result should be <root><element /></root>

What result do you get?

/Magus
-----Original Message-----
Magus wrote:
I'm trying to execute a simple <xsl:if>-clause with a
condition that reads: a<1
In MSXML 4 the clause <xsl:if test="a < 1">do
something...</xsl:if> works fine.
But in .Net Xml it just doesn't work. I can't use the real character (<) because the XSLT wont be a valid XML.
And if I use the encoded representation (<) it wont
compute at all.
Sounds weird. < is exactly the same as < and of course

works. Show us reporoducible sample.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

.

Nov 11 '05 #3
M
Try using
1>a
....instead.

///M

"Magus" <il**************@hotmail.con> wrote in message
news:04****************************@phx.gbl...
Hi.

I'm trying to execute a simple <xsl:if>-clause with a
condition that reads: a<1
In MSXML 4 the clause <xsl:if test="a &lt; 1">do
something...</xsl:if> works fine.
But in .Net Xml it just doesn't work. I can't use the real
character (<) because the XSLT wont be a valid XML.
And if I use the encoded representation (&lt;) it wont
compute at all.

Anybody got a clue what to do???

// Magus - Il Dottore

Nov 11 '05 #4
Problem solved.
I applied the latest SP and voila.
There was something wrong with my installation.

Thanx anyways for your attention.

/Magus
-----Original Message-----
It is weird.
Just make a simple XSLT file containíng.

<xsl:template match="root">
<root>
<xsl:if test="@a < 5">
<element />
</xsl:if>
</root>
</xsl:template>

then write some simple C# code and use the System.Xml
assembly to transform the simple XML-document
<root a="4" />

the result should be <root><element /></root>

What result do you get?

/Magus
-----Original Message-----
Magus wrote:
I'm trying to execute a simple <xsl:if>-clause with a
condition that reads: a<1
In MSXML 4 the clause <xsl:if test="a < 1">do
something...</xsl:if> works fine.
But in .Net Xml it just doesn't work. I can't use the real character (<) because the XSLT wont be a valid XML.
And if I use the encoded representation (<) it wont
compute at all.


Sounds weird. < is exactly the same as < and of course

works. Show us
reporoducible sample.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

.

.

Nov 11 '05 #5

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

Similar topics

4
by: Tristan | last post by:
Is there any support for a negative condition in If statements in PHP. Some tutorials ive found say that you can use the if!(condition)cmd; syntax. however i always get an error when i use that....
1
by: Joel | last post by:
As my registry start condition was working fine, now it's not working anymore Here are the kind of parameter I use in VSNEt2003: A) Registry : Name : Pipo; Property : PROP1; RegKey...
5
by: Lisa J. | last post by:
Heloe I would like to be able to pass a condition of an IF statement as parameter as follow aStr=†(A=1) and (B=2)†if aFunc(“aStrâ€) then …. End if
3
by: Ben R. | last post by:
In an article I was reading (http://www.ftponline.com/vsm/2005_06/magazine/columns/desktopdeveloper/), I read the following: "The ending condition of a VB.NET for loop is evaluated only once,...
3
by: Yohan | last post by:
Hello, I have a question concerning the template classes and their parameters. Is it possible to set a condition on the template parameters in a way that could block the compilation if the...
5
by: das | last post by:
hello all, this might be simple: I populate a temp table based on a condition from another table: select @condition = condition from table1 where id=1 in my stored procedure I want to do...
0
by: Rob R. Ainscough | last post by:
I'm pretty frustrated right now, but I'm unable to get a Launch Condition to work at all in my Condition statement of a Registry entry. (working on a Deployment Project) 1. In Launch...
3
by: jm.suresh | last post by:
Hi, I have a list and I want to find the first element that meets a condition. I do not want to use 'filter', because I want to come out of the iteration as soon as the first element is found. I...
0
by: RN1 | last post by:
I have a DataGrid with an EditCommandColumn. In the EditCommand sub of the DataGrid, there is an If condition. This If condition is True for some rows in the DataGrid whereas it is False for the...
0
by: Vajrala Narendra | last post by:
Hi all, TO my .net setup project i want to add a launch condition for crystal report installation. In my prerequisities i selected Crystal reports fro basic visual studio 2008 (x64, x86) in my...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.