[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-c-users
Subject:    Re: XercesDOMParser and DOMLSParser Schema validation is not the same
From:       Michael Glavassevich <mrglavas () ca ! ibm ! com>
Date:       2011-09-26 20:57:58
Message-ID: OF9AEB78EB.54F090ED-ON85257917.007313DF-85257917.00732C00 () ca ! ibm ! com
[Download RAW message or body]


Alberto responded to your question on the list a few days ago. See [1].

Thanks.

[1] http://markmail.org/message/2vgbbgyrv46iixda

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

unique_suresh <uniquesuresh@gmail.com> wrote on 09/26/2011 04:45:29 PM:

> Guys Please suggest. I am waiting for input you.
>
> Thanks in advance.
>
> -Suresh
>
>
> unique_suresh wrote:
> >
> > Hi All,
> >
> >  I am new to Xerces lib and XML approach here. I have created XSD and
also
> > I created test.xml file. Where I want to validate xml with test.xsd
file.
> > Here I want to provide namespace p for all the elements by default and
> > including attributes. However I have got two sample code from internet
I
> > am trying to run both of them.
> >
> > Xerces Version used : 3.1.1
> > OS : Linux
> >
> > Files : test.xml test.xsd
> >
> > Code :
> > load-grammar-dom uses DOMLSParser class to load grammer and validate
xml.
> > SchemaValidator.cpp uses XercesDOMParser class to load grammer and
> > validate xml.
> >
> >
> > Here is my problem,
> >
> > 1. Using DOMLSParser validate works fine I dont see any issues with the
> > code / files
> >
> >
> > Output:
> >  ./load-grammar-dom test.xsd test.xml
> > loading test.xsd
> > parsing test.xml
> > Validation successful !!!
> >
> >
> > 2. Using XercesDOMParser I am getting error message saying " At line 2
> > Column 89, no declaration found for element 'p:test_in' . I dont
> > understand that one approach says xml is fine this approach says
something
> > wrong. Please help
> >
> > Output:
> >  ./SchemaValidator test.xsd test.xml
> > ===> At line 2 Column 89, no declaration found for element 'p:test_in'
> > <====
> > XML file doesn't conform to the schema
> >
> >
> > Question :
> > 1. Why DOMLSParser works but XercesDOMParser complaining about element.
> > 2. can you someone explaining to me that difference between DOMLSParser
> > and XercesDOMParser classes and their pros and cons.
> >
> > PS : I am very new to xml and xerces lib. Any help would appropriated.
> >
> > Attachments :
> > -------------
> >  http://old.nabble.com/file/p32503845/test.xml test.xml
> >  http://old.nabble.com/file/p32503845/test.xsd test.xsd
> >  http://old.nabble.com/file/p32503845/SchemaValidator.cpp
> > SchemaValidator.cpp
> >  http://old.nabble.com/file/p32503845/load-grammar-dom.cpp
> > load-grammar-dom.cpp
> >
> >
> > Thanks
> > Suresh.
> >
> >
> >
>
> --
> View this message in context: http://old.nabble.com/XercesDOMParser-
>
and-DOMLSParser-Schema-validation-is-not-the-same-tp32503845p32503968.html
> Sent from the Xerces - C - Users mailing list archive at Nabble.com.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic