Stam wrote:

Hello! I am using Apache Xerces (from JAXP) to create DOM documents. I do not want to create them parsing XML documents but rather I want to create "empty" documents an add nodes "manually". Each time I add a node to the DOM I want to validate it in respect to a certain XML Schema. Is it possible? (I know that validation can be done when creating a DOM from an XML document)

Thanx in advance

Stam

It is possible, although it is not so easy. First, the XML may not be valid after adding just one node, for example when you have rule as: E-> A.B | nothing (like E can contain both A and B, or none of them), then you must add both A and B. To validate a document you may use XML Schema API (XSModel, XSLoader, XS*), or just serialize the document and then parse again :-). However when you use the API, you may find some hints how the document should be edited correctly.
Sincerely,
Martin Vysny


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to