From: Michael W. <wes...@ja...> - 2013-07-12 12:21:35
|
Minskybelieve wrote: I have limited knowledge of XUpdate. > > As mentioned, one of the requirements is to ensure that the XML > generated/updated conforms to a XML Schema. Can XUpdate ensure that the > update conforms to a XML Schema? > Based on what you've said so far, you're relying on the client side application to do the validation with XMLBeans. Validating on the server side is always a very good idea, and eXist has ways of doing this. The main method of validation is, as Dmitriy points out, explained here: http://en.wikibooks.org/wiki/XQuery/Validating_a_document Once your schema is registered with the eXist system and you enable schema validation, XUpdate will fail for any update that breaks the schema. As with anything, this has its advantages and disadvantages. For example, sometimes one may temporarily break a schema while adding pieces of a document in sequence. An alternative would be to leave validation off and write a RESTful interface that accepts a document segment, validates just that, then uses XUpdate to add/update the fragment to/of the appropriate document in the appropriate place. If properly written, validation of where the document is placed and/or the rest of the document should not be necessary. If you plan on using eXist to its full potential, you need to learn to think in XQuery, XPath, and XUpdate. These are very elegant languages that are purpose-built to manipulate XML data. XMLBeans is a completely different way of thinking, object oriented. I used it back in its 1.0 days. It does have some parallels to XPath, but I much prefer to live fully within XQuery now. -- Michael Westbay Writer/System Administrator http://www.japanesebaseball.com/ |