[xml] Strange validation errors in libxml 2.9.0 with MSVC 2010
- From: Zoltán Ördögh (GMail) <csimbi gmail com>
- To: xml gnome org
- Subject: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010
- Date: Sat, 6 Apr 2013 02:00:48 -0400
Hi all,
I've been using libxml 2.7.7 in the past with BCB6 and it was working fine.
Now I use libxml 2.9.0 with MSVC 2010 (_MSC_VER = 1600) and I get strange validation errors when I try to read the file back that I wrote out before.
I am getting a bit frustrated because I am using the exact same code as I did in BCB6 and despite all my efforts, it always fails.
When I validate the XML with a third-party tool, it all checks out just fine.
When I run: "
xmllint.exe --valid testme.xml", it simply dumps the XML back without any validation errors.
For some reason, libxml 2.9.0 on MSVC 2010 won't validate it (even though it's from the same build as
xmllint.exe itself).
This is the code that opens the file:
#include "libxml/xmlreader.h".
.
.
m_pxmlTextReader=xmlReaderForFile(sXML.c_str(), NULL, XML_PARSE_COMPACT | XML_PARSE_BIG_LINES | XML_PARSE_DTDVALID);
if(m_pxmlTextReader)
{
if(xmlTextReaderRead(m_pxmlTextReader)==1 && xmlTextReaderIsValid(m_pxmlTextReader)==1)
{
// processing
}
...
"
// processing" is never reached due to the validation errors.
I attached a simple XML with the DTD that can be used to test it in case you're willing to give it a go.
I captured the errors I see in output.txt, please find it attached.
As you can see from the output, the DTD is found but for some reason, libxml can't match it vs. the XML file.
I don't think it's relevant but this is the libxml config that I use at the moment:
Config command:
cscript configure.js iconv=no static=yes debug=yes compiler=msvc prefix=..\..\..\libxml2
Build commands:
call "C:\Program Files (x86)\MSVS10\VC\vcvarsall.bat"
nmake /f Makefile.msvc
nmake /f Makefile.msvc install
Config output:
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
libxml2 version: 2.9.0
Created Makefile.
Created config.h.
XML processor configuration
---------------------------
Trio: no
Thread safety: native
FTP client: yes
HTTP client: yes
HTML processor: yes
C14N support: yes
Catalog support: yes
DocBook support: yes
XPath support: yes
XPointer support: yes
XInclude support: yes
iconv support: no
icu support: no
iso8859x support: no
zlib support: no
lzma support: no
Debugging module: yes
Memory debugging: no
Runtime debugging: no
Regexp support: yes
Module support: yes
Tree support: yes
Reader support: yes
Writer support: yes
Walker support: yes
Pattern support: yes
Push support: yes
Validation support: yes
SAX1 support: yes
Legacy support: yes
Output support: yes
XML Schema support: yes
Schematron support: yes
Python bindings: no
Win32 build configuration
-------------------------
Compiler: msvc
C-Runtime option: /MD
Embed Manifest: no
Debug symbols: yes
Static xmllint: yes
Install prefix: ..\..\..\libxml2
Put tools in: $(PREFIX)\bin
Put headers in: $(PREFIX)\include
Put static libs in: $(PREFIX)\lib
Put shared libs in: $(PREFIX)\bin
Include path: .
Lib path: .
I guess it must be something I have overlooked.
Thank you!
Best regards: Zoltán Ördögh
Attachment:
output.txt
Description: Text document
Attachment:
testme.dtd
Description: Binary data
Attachment:
testme.xml
Description: Text Data
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]