Creating a document from a subtree and parsing it will not work if the root
element of the subtree is not a legal root element of the document (doesn't
have a doctype associated with it, or is not a global element in an XML
Schema or something equivalent for other schema languages).  If the root of
the subtree is a legal document root, then you can serialize it to a string
or file or stream and parse.

There are new validation interfaces being specified in DOM Level 3, but I
don't think they've been implemented in Xerces yet. (I'm a couple of
versions behind, so my information may be out of date.)  If you're thinking
about modifying the parser to support validation of DOM edits, following the
new spec might
  1.  Give something back to the Xerces project (which may or may not be
welcome -- I'm not a participant).
  2.  Relieve you of the necessity of maintaining your modifications once
Xerces provided the functionality.

Jeff
----- Original Message ----- 
From: "Utsav Boobna" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 27, 2003 5:46 AM
Subject: parser help


> Hi,
>     Given a DOM tree I would like to check the validity of the
> subtree of a given node, by the parser. One way which I can think of is to
> write the XML document corresponding to it and then parse it. will it
> work? is there some better and effective way of doing it ?


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

Reply via email to