Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > <Need Help>How to read an element based on condition in XSLT?

Thread Tools

<Need Help>How to read an element based on condition in XSLT?

njsimha njsimha is offline
Junior Member
Join Date: Sep 2008
Posts: 3
I have the following question:

XML snippet:





I want to check that elem4 must be present under template1 only if the value of subelem1 is < 60.If this condition fails then a error message has to be displayed.

I did the template match as follows:
<xsl:template match="/root/template1/elem3/subelem[. >60 ]/> but how to check the existense of elem4?

Please reply me how to achieve this in XSLT?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with while condition OR condition Bill W. Ruby 13 05-09-2011 09:42 PM
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
XPath expression for element based on content of other element withsame parent Ian Wilson XML 2 07-26-2007 04:11 PM
Find the first element that meets the condition Python 3 02-25-2007 05:44 PM
Condition outside loop or separate loop for different condition? - Java 12 06-15-2005 08:50 AM