Utsav Boobna wrote:
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 ?

also, at some stage if it is found that a particular subtree is invalid then, 
I would like to substitute its children by few different elements and then 
repeatedly check its validation for different combination of children, so 
I think writing an XML document each time wont be effective.
	 will some modification in the parser be helpful?

Utsav


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

  
My suggestion would be to serialize the node into a SAXParser object, inserting its respective DOCTYPE statement before it.  Have your object doing the work implement org.xml.sax.ErrorHandler and you will catch all the errors of the child node as the parser validates the contents against the DTD.  This method would allow you to catch more than one error, you don't have to be creating/deleting files and you can stick to just manipulating the one DOM.
--
   Anthony Rabaa
   Software Developer & Network Administrator
   AMCon Research Inc.
   Ottawa, Ontario, Canada
   http://www.amconresearch.net

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

Reply via email to