aspose file tools*
The moose likes XML and Related Technologies and the fly likes want to set a primary key element in xml schema file 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 "want to set a primary key element in xml schema file" Watch "want to set a primary key element in xml schema file" New topic
Author

want to set a primary key element in xml schema file

kiran manohar
Ranch Hand

Joined: Sep 28, 2003
Posts: 49
hi,
we got a situation where we got an object which will give a set of records.we have to convert this object to xml schema and at the same time we need to convert xml schema to a set of objects where we got a problem of setting a primary key value for a record in an object and vice versa.
Can we set a primary key to an element in a schema file which will be validated with an xml file.any response will be appreciated.
Regards
Kiranmanohar
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You can use the <unique> element in your schema file for validating that the value is unique in the document, but somehow I feel that's not what you're looking for...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
kiran manohar
Ranch Hand

Joined: Sep 28, 2003
Posts: 49
hi lasse,
we want examples for <unique> element, can u please forward,
thanks
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I'd suggest googling. Here are a couple of search results that provide some kind of example:
http://www.xml.com/pub/a/2000/12/13/schemas/part2.html?page=2
http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_keys_st4.html
http://lists.xml.org/archives/xml-dev/200303/msg00775.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: want to set a primary key element in xml schema file