This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tag-value should be unique ...

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have this XML file :



And I need to force that id should be unique for customers . can I do by schema . Can you please mention what I have to write in schema for this requirement ...

Thanks a lot .
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:
And I need to force that id should be unique for customers . can I do by schema . Can you please mention what I have to write in schema for this requirement ...



Yes you can. But if I were to write the schema I would make it an attribute instead of an element by itself. That's just me. From what you are describing, this seems like a property of the customer element. Hence, an attribute.

- m
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is OK Madhav ,
But how can we do that , can you or anybody tell me ....

Thanks a lot .
 
Hasan Pasha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here we go...
Try to add the max and min limit for N2 and N1 in the schema.



Dont get offended if I ask you a question...
Dint you come across such a requirement while preparing for the IBM test 141?
 
Hasan Pasha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry... I got your requirement wrong.
Will get back to you if I get a solution.
 
Hasan Pasha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take a look at the usage of xsd:unique element.
 
Hasan Pasha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This schema, I am sure will address your problem.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic