Re: [Re: [libxml++] Validation implemented]



Murray Cumming wrote:

another worthy addition would be to have all dom modification methods
(Node::insert() et al.) validate. So an attempt to remove a node or to
add one could be refused. That doesn't actually seem to be hard, as libxml2 provides functions to validate individual nodes (subtrees ?)...


Yes, that would be nice.

How would the API look like ? Should validation be on for parsing / dom
manipulation whenever a dtd is attached to the document and ommitted if
not ?

Alternatively, should the document have a flag indicating whether
modifications should be audited ?

Or should each modifying call get an additional bool parameter to
indicate 'do validate' ?

I guess we all agree that the last is not really an option. I tend to
think that the first (validate whenever a dtd is present) is best, at
least as the default behavior, while a 'suppress_validation()' method
could be used if the user wants not to validate.

Stefan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]