aspose file tools*
The moose likes XML and Related Technologies and the fly likes tag-value should be unique ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "tag-value should be unique ..." Watch "tag-value should be unique ..." New topic
Author

tag-value should be unique ...

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Jun 03, 2000
Posts: 5040
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


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
That is OK Madhav ,
But how can we do that , can you or anybody tell me ....

Thanks a lot .
Hasan Pasha
Greenhorn

Joined: Feb 23, 2005
Posts: 25
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

Joined: Feb 23, 2005
Posts: 25
I am sorry... I got your requirement wrong.
Will get back to you if I get a solution.
Hasan Pasha
Greenhorn

Joined: Feb 23, 2005
Posts: 25
Please take a look at the usage of xsd:unique element.
Hasan Pasha
Greenhorn

Joined: Feb 23, 2005
Posts: 25
This schema, I am sure will address your problem.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tag-value should be unique ...
 
Similar Threads
Unique constrain using XML Schema
hibernate one- to one unidirectional mapping
IBM practice test question 16
DOM validation PLEASE HELP
Nested Model Class + ModelDriven + Struts 2