logo       

Re: Validate DOM document in memory using DOM level 3: msg#00037

text.xml.xerces-j.devel

Subject: Re: Validate DOM document in memory using DOM level 3

Hi Michael / All,
 
Thank you for your reply. I have successfully revalidate my in-memory DOM against a schema using the normalizeDocument() in my test progam.

From the article:

http://www-106.ibm.com/developerworks/xml/library/x-keydom2.html

I know that if I want to use the revalidating feature of DOM level3, the node must be created using the namespace-aware method, like createElementNS(). But in my project, the code is already there, and the node is created using the Level 1 method, that is createElement(). I still want to use this new feature of DOM level 3, so is there any better way to by pass my problem? Or do you have any suggestions?
 
Thanks,
 
Mike

Michael Glavassevich <mrglavas@xxxxxxxxxx> wrote:

Hi Mike,

Yes, you want to call normalizeDocument() but first you have setup the DOMConfiguration (see the 'schema-location', 'schema-type' and 'validate' parameters) [1] so that the DOM will be validated when this method is called.

[1] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMConfiguration

Mike Hao <mike_jjhao@xxxxxxxxx> wrote on 08/25/2004 02:07:07 PM:

> Hi Neil,

>  
> Thank you for your quick response.
>  
> Which method should I use for this kind of validation? normalizeDocument()?
>  
> Thanks,
> Mike
>  
>
> Neil Delima <nddelima@xxxxxxxxxx> wrote:

>
>
>
>
> Hi Mike,
>
> See [1]
>
> Mike Hao wrote on 08/25/2004 11:10:08 AM:
>
> > I am trying to validate an in-memory DOM document using the DOM
> > level 3 functionality. And I am following the instruction in this page:
> >
> > http://xml.apache.org/xerces2-j/faq-dom.html#domparser
> >
> > My questions are:
> >
> > 1. Do I have to create a LSParser?
> Nope, it's not necessary to create an LSParser.
>
> > 2. Which Document class should I use? The one in the dom3-xml-apis.jar
> > or just the normal one?
> org.w3c.dom.Document.
>
> > 3. Where or How to get the APIs document of the DOM level 3
> functionalities?
> To build and access DOM Level 3 see [2].
>
> [1] http://xml.apache.org/xerces2-j/faq-dom.html#faq-9
> [2] http://xml.apache.org/xerces2-j/faq-dom.html#faq-6
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xxxxxxxxxxxxxx
> For additional commands, e-mail: xerces-j-dev-help@xxxxxxxxxxxxxx

> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!


Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@xxxxxxxxxx

E-mail: mrglavas@xxxxxxxxxx


Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise