You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Scott Cantor <ca...@osu.edu> on 2006/02/17 20:15:35 UTC
In-memory validation at all on the horizon?
Just a planning question...is there any code in 3.0 or planned for 3.0 at
this point that would do XSD validation of a DOM as opposed to only up front
during parsing?
TIA...
-- Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: In-memory validation at all on the horizon?
Posted by Gareth Reakes <ga...@embracemobile.com>.
Hey,
> Reading over what I wrote yesterday, I had thought you were asking a
> different question so I'll try again. The schema validator sits in front
> of the DOM builder in the parser's pipeline [1]. The document is validated
> as it's parsed not afterwards. In Xerces-J, in-memory validation works by
> walking the DOM [2]; converting it to XNI events which are then passed to
> the same schema validator component which is used in a parsing context.
That fits with what I thought was going on. Its also the way that I
think C should go with things. The pipeline that J has is something that
has much potential.
Gareth
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: In-memory validation at all on the horizon?
Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Gareth Reakes <ga...@embracemobile.com> wrote on 02/17/2006 04:37:51 PM:
> Hey,
>
> >
> > One reason I wondered is that apparently (if the person who told me is
> > correct) Xerces-J now does "validate-on-parse" internally by doing the
> > validate on the DOM it built. Essentially making it "free" for them to
> > expose that feature, I guess.
> >
> > I take it Xerces-C does *not* do this? Otherwise, it doesn't seem like
it
> > would be a lot of work, which leads me to believe it does not.
>
> No, and I did not think that Xerces-J did either. If so, then it would
> not work for SAX. Michael, does Xerces-J do validation on a parsed DOM
> rather than during parse for some reason now?
Reading over what I wrote yesterday, I had thought you were asking a
different question so I'll try again. The schema validator sits in front
of the DOM builder in the parser's pipeline [1]. The document is validated
as it's parsed not afterwards. In Xerces-J, in-memory validation works by
walking the DOM [2]; converting it to XNI events which are then passed to
the same schema validator component which is used in a parsing context.
> Cheers,
>
> Gareth
>
>
> --
> Gareth Reakes, Managing Director Parthenon Computing
> +44-1865-811184 http://www.parthcomp.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
[1] http://xerces.apache.org/xerces2-j/xni-design.html#pipeline
[2]
http://svn.apache.org/viewcvs.cgi/xerces/java/trunk/src/org/apache/xerces/jaxp/validation/DOMValidatorHelper.java?view=markup
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: In-memory validation at all on the horizon?
Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Gareth Reakes <ga...@embracemobile.com> wrote on 02/17/2006 04:37:51 PM:
> Hey,
>
> >
> > One reason I wondered is that apparently (if the person who told me is
> > correct) Xerces-J now does "validate-on-parse" internally by doing the
> > validate on the DOM it built. Essentially making it "free" for them to
> > expose that feature, I guess.
> >
> > I take it Xerces-C does *not* do this? Otherwise, it doesn't seem like
it
> > would be a lot of work, which leads me to believe it does not.
>
> No, and I did not think that Xerces-J did either. If so, then it would
> not work for SAX. Michael, does Xerces-J do validation on a parsed DOM
> rather than during parse for some reason now?
It's your choice. You can validate while parsing and in memory using
either the JAXP 1.3 Validation API [1] or Document.normalizeDocument()
[2].
> Cheers,
>
> Gareth
>
>
> --
> Gareth Reakes, Managing Director Parthenon Computing
> +44-1865-811184 http://www.parthcomp.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
[1]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/package-summary.html
[2] http://xerces.apache.org/xerces2-j/faq-dom.html#faq-9
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
RE: In-memory validation at all on the horizon?
Posted by Scott Cantor <ca...@osu.edu>.
> No, and I did not think that Xerces-J did either. If so, then it would
> not work for SAX. Michael, does Xerces-J do validation on a parsed DOM
> rather than during parse for some reason now?
Note that the specific context would be JAXP 1.3 behavior, if that makes a
difference.
TIA for the clarification.
-- Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: In-memory validation at all on the horizon?
Posted by Gareth Reakes <ga...@embracemobile.com>.
Hey,
>
> One reason I wondered is that apparently (if the person who told me is
> correct) Xerces-J now does "validate-on-parse" internally by doing the
> validate on the DOM it built. Essentially making it "free" for them to
> expose that feature, I guess.
>
> I take it Xerces-C does *not* do this? Otherwise, it doesn't seem like it
> would be a lot of work, which leads me to believe it does not.
No, and I did not think that Xerces-J did either. If so, then it would
not work for SAX. Michael, does Xerces-J do validation on a parsed DOM
rather than during parse for some reason now?
Cheers,
Gareth
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
RE: In-memory validation at all on the horizon?
Posted by Scott Cantor <ca...@osu.edu>.
> No. Its something that is asked for a fair bit but its a lot of work.
I have no doubt of that!
> Hopefully someone out there will want it enough to contribute it! We are
> here to help if anyone does want to.
One reason I wondered is that apparently (if the person who told me is
correct) Xerces-J now does "validate-on-parse" internally by doing the
validate on the DOM it built. Essentially making it "free" for them to
expose that feature, I guess.
I take it Xerces-C does *not* do this? Otherwise, it doesn't seem like it
would be a lot of work, which leads me to believe it does not.
-- Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: In-memory validation at all on the horizon?
Posted by Gareth Reakes <ga...@embracemobile.com>.
Hey,
Scott Cantor wrote:
> Just a planning question...is there any code in 3.0 or planned for 3.0 at
> this point that would do XSD validation of a DOM as opposed to only up front
> during parsing?
No. Its something that is asked for a fair bit but its a lot of work.
Hopefully someone out there will want it enough to contribute it! We are
here to help if anyone does want to.
Gareth
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org