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:
  #1  
Old July 12th, 2004, 03:34 AM
hkaste hkaste is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 hkaste User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XML schema question about conditions

Hi XML wizards,

Is it possible to make elements in an XML schema mandatory depending on the attribute value in a previous element?

For example if an attribute in the root element has value '+' then element <add> is mandatory but element <sub> must not occur in the XML file. However if the attribute has value '-' element <sub> is mandatory but <add> must not occur in the XML file.

Best regards, HKaste

Reply With Quote
  #2  
Old July 12th, 2004, 04:20 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8
At the moment you can't do this with XML schema alone. You can check that there's only <add> or <sub>, but you can't "prohibit" one or the other. With XML schema 1.1 this will change though.

-Miska-

P.S. For more FAQ's on XML schema check this link out:
http://www.schemavalid.com/faq/xml-schema.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML schema question about conditions


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 2 hosted by Hostway
Stay green...Green IT