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 August 29th, 2003, 10:07 AM
verolaet verolaet is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: France/Paris
Posts: 30 verolaet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 30 sec
Reputation Power: 6
Smile XSD Schema + if else

Does anyone know how to add "mutually exclusive" attributes n a schema?

I precise, for instance, the <elem> can have the attribute att1="" only and only if it havn't got a att2="" one.
On the contrary the <elem> can have the attribute att2="" only and only if it havn't got a att1="" one.

Thanks a lot to whom will give me a solution!!

Reply With Quote
  #2  
Old September 2nd, 2003, 01:28 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
You're trying to set mutual exclusion through setting attributes? as in if attr1="" and attr2="" then set attr1="locked"?

you can't do that

if user one opens up the XML document, reads that both are "", and then user two opens up the XML document and reads both are "", then user one sets attr1="locked" and user two then sets attr2="locked" then mutual exclusion is broken. If your deriving this XML document from a DB you should do operations there since XML is generally meant for marshalling data. You'll need to find an outside component for locking a file on a computer, I can't think of any that are built in off the top of my head.....that's my 2 cents.

Reply With Quote
  #3  
Old September 2nd, 2003, 03:39 AM
verolaet verolaet is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: France/Paris
Posts: 30 verolaet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 30 sec
Reputation Power: 6
I'm not sure to understand your reply (thanks for it anyway!)

What I'm looking for is effectively a check mutually exclusive attributes.

But I don't understand you talking about user 1 and user 2.

I try to have a shema which validates:
<elem att1="anyvalue" /> =OK
<elem att2="anyvalue" /> =OK
<elem att1="anyvalue" att2="anyvalue" /> = NOK

Is that what you've understand?

Reply With Quote
  #4  
Old September 2nd, 2003, 08:56 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
that's absolutely what i was thinking. But i was thinking you'd
have it
<elem att1="" att2=""/> =OK
<elem att1="anyvalue" att2=""/> =OK
<elem att2="anyvalue" att1=""/> =OK
<elem att1="anyvalue" att2="anyvalue" /> = NOK

anyway you put it, this cannot and will not work. In this case, the mutually exclusive area is the XML document. The point of mutual exclusion is to keep the document locked for one user so the users do not mess up any alterations and changes one user makes. The problem with attributes acting as a semaphore is they will not work. When I open this XML document, it is loaded into memory on my computer. You also load this document at virtually the same time. Lets say att1="ilk" and att2="" so that we should be able to alter it. We both read that att1 and 2 are not both set to OK. If i then write att2="df" and att1="lkj" then no user should be able to access this document. However, since user 2 (you) already read the variables, you then sets att2="kj" and already we have a problem, user 2 has overwritten data that user 1 has written, and this will continue as both users edit and update the document.
I know of no way to lock a document without some component/feature add in. If this XML document is being handled from a SQL server, i'd recommend editing alll info from the DB instead, then generate the XML file.

Last edited by unatratnag : September 2nd, 2003 at 12:27 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSD Schema + if else


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 3 hosted by Hostway