Hi Andre,
I took your example.xsd and example.xml (incorrect version) and ran them
through the SAX2Count sample and I get:
Fatal Error at file d:\bugs\example.xml, line 4, char 9
Message: Expected end of tag 'b'
If I change the </x> to </b> I get an error message about 'a' is missing:
Error at file d:\bugs\example.xml, line 6, char 11
Message: Element 'b' is not valid for content model: '((a,b),c)'
Can you try running the SAX2Count sample and see if you get similar errors?
I am using the development version of xercesc on the 2.7 branch of svn but
I think you should get the same results with xercesc 2.6 or 2.7. If you do
get the same errors, look at the SAX2Count sample and see how it is
different than your code...
Regards,
David A. Cargill
XML Parser Development
IBM Toronto Lab
(905) 413-2371, tie 969
[EMAIL PROTECTED]
Andre Heynatz
<[EMAIL PROTECTED]>
To
11/29/2005 03:14 [email protected]
PM cc
Subject
Please respond to Re: no validation of elements?
c-users
David Bertoni wrote:
>> m_parser->setProperty(XMLUni::fgXercesScannerName,
>> (void *)XMLUni::fgSGXMLScanner); // only schema
>> support needed
>
>
> What happens if you use IGXMLScanner instead of SGXMLScanner? Since
> SGXMLScanner is not used that often, I wouldn't be surprised if there
> are some bugs there.
>
> Dave
Setting the property to fgIGXMLScanner does not help. Not setting the
fgXercesScannerName property does not help either. Changing the charset to
US-ASCII in both files does not influence things. I really wonder why it
does not work, as it is such a basic feature. As I am new to XML Schema, I
would like to hear if such verification for elements can be expected. Then
I would like to enable some debugging. I have to add quite a bit of error
handling in the application if this cannot be done by the parser.
Let's see what I have:
$ ldd /usr/lib/libxerces-c.so.27
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7be4000)
libicuuc.so.34 => /usr/lib/libicuuc.so.34 (0xb7add000)
libicudata.so.34 => /usr/lib/libicudata.so.34 (0xb726f000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7193000)
libm.so.6 => /lib/tls/libm.so.6 (0xb716e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7163000)
libc.so.6 => /lib/tls/libc.so.6 (0xb702b000)
/lib/ld-linux.so.2 (0x80000000)
libicu is used, and the tls variants of some libs, as I use kernel 2.6
(2.6.13.2 and 2.6.13.4). glibc 2.3.5 is installed on the Debian/x86-32
systems. All libs and the application are compiled with g++ 4.0.
André Heynatz