You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Mark Brucks <br...@j3s.us> on 2004/02/26 17:48:51 UTC

key/keyref and validation

I asked this question earlier in the month, and got no responses.  
Although the lack of response is probably because the question is 
related to the 'experimental' DOM3 validation implementation, I'd like 
to stimulate the discussion while the implemention is still experimental 
and there's a chance to influence how it works.  If users agree that the 
implementation should be changed, I'll be glad to submit proposed 
changes for adoption.  I'd also like to know if nobody is using the DOM3 
validation feature and I'm the only one interested in this topic (which 
means this isn't a user topic but a developer topic...)

Here's my previous post...

We are using the key/keyref  mechanism, but are experiencing some 
difficulties dealing with validation errors.  We are using the method 
CoreDocumentImpl.normalizeDocument() to validate the document, and are 
collecting the org.w3c.dom.DOMError instances that are passed to our 
handleError() method (implementation of the org.w3c.dom.DOMErrorHandler 
interface).

Our problem is that when a keyref has no corresponding key defined, the 
DOMError instances seem to associate the error with the element in the 
document containing the key/keyref constraint and not the element that 
contains the illegal reference value.  We are using 
DOMError.getLocation().getRelatedNode() to get the invalid node for the 
error.  The returned node is always the node containing the key/keyref 
constraint (which in our case happens to be the root node).  Is this the 
expected association for this type of validation error?  If so, then how 
do we determine which element contains the invalid reference?

thanks - Mark Brucks




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org