XML Schema for parent-child relation and reference elements
Hi I have a xml file with following strcuture. what should be the valid schema for same. The schema generated for the xml file using XSD.exe won't validate t开发者_如何学Gohe xml file if i change parent-id value to some non-existing id in department element.
The image for the xml strcuture is on following link --
http://4nic6g.bay.livefilestore.com/y1pT0fhWbJVN-tGaVUJXtF4wz4_qsvC_iBMvtXt364Ef3icT8725_N1nsY6qwqBPfMFCjttlc1tmospd5yYQHjzL9PO-HhJc9tk/image1.png?psid=1
Apart from self reference schema, I also required many-many relationship schema.
I think, i am able to found the answer for same. Not tested with valiating the incorrect xml file but the following link provides information on defining the schema for many-many relationships.
1. Using elements : http://en.wikibooks.org/wiki/XML_-_Managing_Data_Exchange/The_many-to-many_relationship
2. Using Attributes Many to many relationship (Based on ID/IDREF as previous link) "http://www.xfront.com/GlobalVersusLocal.html ( The Russian Doll Design )."
Another link is posted as string since I am not allowed to post more than 1 URL.
The xmlschema provided in "Russian Doll Design" get loaded properly in VS studio. The only thing is that I am not able to see the relations graphically. :(
Same logic should be applicable for self reference relations.
Regards Rajesh
精彩评论