Validation of XUpdate
I want to validate updates to a document made via XUpdate. At this point, I primarily wish to remove the ignorable white space from the updated document as it is updated. I have no experience with validation. I'm assuming that it is possible to validate an individual node using one of existing Schema engines, but I have no idea where to start. There are two methods to pursue. 1) Create an XML Schema for XUpdate, use nested XML Schemas. If this removes whitespace, and validates the XUpdate statement, I can then insert the result. There are some use cases of XUpdate, inserting a text node, where I am certian you need to look at the result. 2) Use a validation API that answers the question, "is this node, given this parsed schema, valid it it's current context?" This seems to be called "partial validation". If I pursue 1) then I'll have to learn a lot of new things before I can strip that whitespace. (It seems like I'll be hacking XML Schema for every update statement.) If I pursue 2) I'll be able to swap out schema implementations. I'm reading through javax.xml.validation for a crack at 2). It seems to take a node and validate all the children. I'm not sure if this is what I want. If I add an attribute to the root node of a large document, I don't need to validate the entire document, just the attributes of the newly modified node. And insight is appreciated. Cheers. -- Alan Gutierrez - alan@e... - http://engrm.com/blogometer/index.html - http://engrm.com/blogometer/rss.2.0.xml
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format