XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 14th, 2003, 09:20 AM
shacham shacham is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: STL
Posts: 13 shacham User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy validating XML values in XSLT

I have this line in my XML:
<folder code="0" title="Error code: E501" img="folder14.gif"/>

In my XLST I need to check if the "code"value is "0", and then do something.

The "code" item is mandatory.

Currently, I only check whether it exists like this:
<xsl:if test="@code"><xsl:attribute.....do somthing...</xsl:attribute></xsl:if>

So how do I check the value of "code"?

Is it like this?
<xsl:if test="@code>0"> or do i need to use the <xsl:value-of select="@code"/> ?

Reply With Quote
  #2  
Old May 14th, 2003, 12:01 PM
waldthau waldthau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Colorado
Posts: 46 waldthau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
You should be able to use <xsl:if test="@code>0">...</xsl:if> to test if the value of the code attribute is greater than 0.
__________________
- MW

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > validating XML values in XSLT


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway