By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,309 Members | 1,196 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,309 IT Pros & Developers. It's quick & easy.

DOM Validation "on-the-fly"

P: n/a
Hello,

I have a (java) DOM object that adheres to an XML schema. I want to
manipulate it in code, but to ensure that the object still sticks to
the schema (ie, validation during the life-cycle of the DOM object, not
just upon initial parsing). Is this possible?

My investigation so far has revealed that DOM3 does provide validation
mechanisms for this, but no current parsers implement them. I've
picked up on something called the "post-schema-validation infoset"
(PSVI), but it looks like another full-blown API to learn - I just want
(ideally) a flag to indicate that I want the DOM object to reject
changes that cause it to become invalid.

I've also seem many other postings on this kind of question, but there
have never been any replies... Is this the kind of question that shows
I haven't grasped what XML and friends are all about and you're
laughing at my lack of understanding (I am new to this and am trying to
teach myself)? Should I really have another DOM object with the XSD
document in and use that to manually validate the other object?

Does anybody have any clues regarding this?

Ghee

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Ghee wrote:

I have a (java) DOM object that adheres to an XML schema. I want to
manipulate it in code, but to ensure that the object still sticks to
the schema (ie, validation during the life-cycle of the DOM object, not
just upon initial parsing). Is this possible?


Java 1.5 allows you to (re)validate a document against a schema by using
the javax.xml.validation namespace with SchemaFactory, Schema, Validator
objects and the validate method of Validator.
I don't see any features in there however to find out whether a certain
change is allowed in the way DOM Level 3 validation supports it.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.