> I need to validate an element aganist schema rather than the 
> whole document.

Currently, it is not possible to revalidate a singe element within the
DOM tree. 
The best way of achieving what you want is using DOM Level 3
normalizeDocument that allows to revalidate a document in memory [1].
You can setup the schema on the <key> element using xsi:schemaLocation
attributes and register your own error handler that will ignore errors
for <SOAPENV:Envelope>, <SOAPBODY:Body> elements (the validator will
complain that declaration for those is not found). 

If you really want to revalidate a single node.. you can create a new
document, use adoptNode to move a single element you want to revalidate
to a new document, use DOM L3 normalizeDocument on the new document to
revalidate just that single node. Then, if needed, you can use adoptNode
again to move back the element to the original document.

 
[1] http://xml.apache.org/xerces2-j/faq-dom.html#faq-7

Hope it helps,
-- 
Elena Litani / IBM Toronto

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

Reply via email to