Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Reusing XSD information for full and update record

From: Greg <gdab71@-------.------->
To: NULL
Date: 7/9/2009 9:55:00 AM
Hi everyone!

I want to exchange full and partial records with XML. Example:

<person>
  <id>12</id>
  <lastname>Miller</lastname>
  <firstname>Bob</firstname>
</person>

Another type of element to change that record's person's first name:

<personUpdate>
  <id>12</id>
  <firstname>John</firstname>
</personUpdate>

So in the full record, all elements must be present, while the update 
version only has to contain the id, and everything else is optional 
(well, there should be at least one element).

In the schema definition, I don't have to have different element types 
for a full record and an update record, but I'm doing that right now, 
with the same sequence of child elements (id, lastname, firstname), only 
that in the update version, there is minOccurs=0 maxOccurs=1 for 
everything but the id while in the full version both attributes are 1 to 
make all elements mandatory.

Is there a better way to express this? Whenever fields are added, 
removed or modified I have to edit .xsd files in two places, the type of 
the full and the update record. This is error-prone.

Thanks in advance!


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent