In last blog , we have some problems and their solution, in this thread, we are going to solve more specific problems. Define id Like Attribute? < xs:attribute name = "id" type = "xs:ID" /> Define ref Like Attribute? < xs:attribute name = "ref" type = "xs:IDREF" /> Default Value for Element? Short answer is no, xsd doesn’t provide this functionality. Attributes can be set with a default value because it is relative simple, while elements can nested and combined, which is much more complex and hard to provide a default content. As far as we know, there also exists no alternatives to provide a default value for a missing element. In order to provide this functionality, we add much more code when combined with jaxb. Define key & keyref We define them in following steps: First, we must define key & keyref in element body; Second, define key in following format: < key id = ID ...
Learn programming, still on the way