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 Utsav Boobna <Ut...@lri.fr> on 2003/05/27 14:46:52 UTC

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 ?

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: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: parser help

Posted by "K. Venugopal" <k....@sun.com>.
Hi ,

Refer to following specs . 

http://www.w3.org/TR/DOM-Level-3-Val/validation.html
http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html


Regards
venu

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: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>  
>



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


Re: parser help

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
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" <Ut...@lri.fr>
To: <xe...@xml.apache.org>
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: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org