Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-28 Thread GMail
Hi,
thanks for checking in.

As far as I know, there is no solution for this problem yet.
Daniel recommended to debug into xmllib to find out what the problem might
be - I simply don't have the bandwidth to do that.
So, I opted for avoiding the problem as a whole by downgrading to 2.8.0.

I guess this makes the fix more urgent - it's a bit harded to downgrade
Ubuntu deployments.
Is this happening on a 32bit distribution, 64bit or both?

Best regards: Zoltán Ördögh


On Sun, Apr 28, 2013 at 6:29 AM, brezhoneg1 brezhon...@yahoo.fr wrote:

 Hi,

I just upgraded to Ubuntu13.04 that comes with libxml2.9.0, and I
 experience these exact same errors.
C++ programs that used to work very fine with previous versions now
 show all these errors when compiled on this
new Linux version. When using xmllint, everything's ok though. These
 programs load a DTD from a local file in the form of
 /home/user/prg/application.dtd then read XML files that use this DTD.

Was the problem eventually fixed for your case ? If so, what was the
 underlying issue, since it is most likely the same one ?

 Regards
 E. Lintari


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-28 Thread GMail
Hi,
not a lot of help I know, but this is all I have to offer right noww.

I think, Ubuntu does upgrades pretty well. I have upgraded from 9.x to 12.x
each release (have not tried 13.x yet) and I had only one minor problem
(with grub), so I'd like to think you can rule out the upgrade issue. But,
yes, do give it a try if you have the time - you never know.

It's the ghost in the machine :-)


Best regards: Zoltán Ördögh


On Sun, Apr 28, 2013 at 1:32 PM, brezhoneg1 brezhon...@yahoo.fr wrote:

  Hi

thanks a lot for your response

So far, it occurs on a Ubuntu13.04 32-bits (an upgrade from Ubuntu12.10
 which already was an upgrade from Ubuntu12.04). These two upgrades went
 without problems, but maybe a clean installation from scratch  would
  be better to avoid risks of silent misfunctioning due to a bad cleanup of
 a previous version. For 64 bits, I don't know yet (not tested), but I guess
 this bug is likely to be on all platforms, since you've got it on Windows
 too.

   Anyway, the programs run very well, except they emit hundreds of
 irrelevant error messages that will surely scare end users for nothing !

 Best Regards
 E. Lintari

 Le 28/04/2013 17:08, Zoltán Ördögh (GMail) a écrit :

 Hi,
 thanks for checking in.

 As far as I know, there is no solution for this problem yet.
 Daniel recommended to debug into xmllib to find out what the problem might
 be - I simply don't have the bandwidth to do that.
 So, I opted for avoiding the problem as a whole by downgrading to 2.8.0.

 I guess this makes the fix more urgent - it's a bit harded to downgrade
 Ubuntu deployments.
 Is this happening on a 32bit distribution, 64bit or both?

 Best regards: Zoltán Ördögh


 On Sun, Apr 28, 2013 at 6:29 AM, brezhoneg1 brezhon...@yahoo.fr wrote:

 Hi,

I just upgraded to Ubuntu13.04 that comes with libxml2.9.0, and I
 experience these exact same errors.
C++ programs that used to work very fine with previous versions now
 show all these errors when compiled on this
new Linux version. When using xmllint, everything's ok though. These
 programs load a DTD from a local file in the form of
 /home/user/prg/application.dtd then read XML files that use this DTD.

Was the problem eventually fixed for your case ? If so, what was the
 underlying issue, since it is most likely the same one ?

 Regards
 E. Lintari




___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-07 Thread GMail
Hi all,
just to let you know, I downgraded to 2.7.7 and it works like a charm.

Best regards: Zoltán Ördögh


On Sun, Apr 7, 2013 at 12:07 AM, Zoltán Ördögh (GMail) csi...@gmail.comwrote:

 Hi Daniel,
 thanks for responding over the weekend, much obliged.

 Please note that the problem is not the system ID; I replaced the full
 path to the relative one as I was sure that my full path would not work for
 anyone else.
 So, the DTD is in fact, found - how else would xmllint.exe be able to
 validate it? I messed up the DTD on purpose once just to see if there are
 errors - and there were, so xmllint can find the DTD for sure.

 The source of my frustrations are the validation errors that are produced
 by a seemingly correct code, validated and well-formed XML and DTD.

 The only thing I can think of is that the some build setting may be wrong
 - however I am not adept enough to discover that.

 Did anyone managed to get xmlReaderForFile(...) working on MSVC 2010
 without validation errors?

 Best regards: Zoltán Ördögh


 On Sat, Apr 6, 2013 at 11:05 PM, Daniel Veillard veill...@redhat.comwrote:

 On Sat, Apr 06, 2013 at 07:50:56PM -0400, Zoltán Ördögh (GMail) wrote:
  I saw this code in xmllint.c (removed conditionals that do not apply):
 [...]
  I tried using the exact same code but I still get the same validation
  errors on the first call to xmlTextReaderRead...
  It is vexing me...
  Any thoughts?

   See your xml and the system identifier you use for the DTD

   file:///./

 if I use that I get an error that the DTD fails to be loaded on linux
 and validation fails (xml and dtd being in the same directory) switching
 to
   ./testme.dtd

 works after that i.e. xmllint code succeeds

 file:// URIs are (or used to be) completely underspecified, and
 what you use there would mean on a Linux machine, the file testme.dtd
 which is in the . directory under to root of the filesystem of the
 localhost machine, i.e. /testme.dtd instead of ./testme.dtd
 What is does on Windows and why, I can't guess and I can't test,
 simply run your program under a debugger, since you have a reliable
 behaviour !

 Daniel

 --
 Daniel Veillard  | Open Source and Standards, Red Hat
 veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
 http://veillard.com/ | virtualization library  http://libvirt.org/



___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-07 Thread GMail
I checked 2.8.0 out of curiosity - that works, too.
It seems a bug has been introduced into 2.9.0 - and it apparently impacts
only MSVC 2010 (well, so far it seems I am the only one).

Best regards: Zoltán Ördögh


On Sun, Apr 7, 2013 at 2:19 AM, Zoltán Ördögh (GMail) csi...@gmail.comwrote:

 Hi all,
 just to let you know, I downgraded to 2.7.7 and it works like a charm.

 Best regards: Zoltán Ördögh


 On Sun, Apr 7, 2013 at 12:07 AM, Zoltán Ördögh (GMail) 
 csi...@gmail.comwrote:

 Hi Daniel,
 thanks for responding over the weekend, much obliged.

 Please note that the problem is not the system ID; I replaced the full
 path to the relative one as I was sure that my full path would not work for
 anyone else.
 So, the DTD is in fact, found - how else would xmllint.exe be able to
 validate it? I messed up the DTD on purpose once just to see if there are
 errors - and there were, so xmllint can find the DTD for sure.

 The source of my frustrations are the validation errors that are produced
 by a seemingly correct code, validated and well-formed XML and DTD.

 The only thing I can think of is that the some build setting may be wrong
 - however I am not adept enough to discover that.

 Did anyone managed to get xmlReaderForFile(...) working on MSVC 2010
 without validation errors?

 Best regards: Zoltán Ördögh


 On Sat, Apr 6, 2013 at 11:05 PM, Daniel Veillard veill...@redhat.comwrote:

 On Sat, Apr 06, 2013 at 07:50:56PM -0400, Zoltán Ördögh (GMail) wrote:
  I saw this code in xmllint.c (removed conditionals that do not apply):
 [...]
  I tried using the exact same code but I still get the same validation
  errors on the first call to xmlTextReaderRead...
  It is vexing me...
  Any thoughts?

   See your xml and the system identifier you use for the DTD

   file:///./

 if I use that I get an error that the DTD fails to be loaded on linux
 and validation fails (xml and dtd being in the same directory) switching
 to
   ./testme.dtd

 works after that i.e. xmllint code succeeds

 file:// URIs are (or used to be) completely underspecified, and
 what you use there would mean on a Linux machine, the file testme.dtd
 which is in the . directory under to root of the filesystem of the
 localhost machine, i.e. /testme.dtd instead of ./testme.dtd
 What is does on Windows and why, I can't guess and I can't test,
 simply run your program under a debugger, since you have a reliable
 behaviour !

 Daniel

 --
 Daniel Veillard  | Open Source and Standards, Red Hat
 veill...@redhat.com  | libxml Gnome XML XSLT toolkit
 http://xmlsoft.org/
 http://veillard.com/ | virtualization library  http://libvirt.org/




___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-07 Thread Csaba Raduly
Hi Zoltán,

On Sun, Apr 7, 2013 at 8:30 AM, Zoltán Ördögh  wrote:
 I checked 2.8.0 out of curiosity - that works, too.
 It seems a bug has been introduced into 2.9.0 - and it apparently impacts
 only MSVC 2010 (well, so far it seems I am the only one).

I tried your example with Cygwin's xmllint and with my homemade
validator based on Xerces-C. Both passed successfully.

$ xmllint.exe --version
xmllint: using libxml version 20900
   compiled with: Threads Tree Output Push Reader Patterns Writer
SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer
XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas
Schematron Modules Debug Zlib Lzma

$ xmllint.exe --noout --valid testme.xml
no output

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
Ok, it boots. Which means it must be bug-free and perfect.  -- Linus Torvalds
People disagree with me. I just ignore them. -- Linus Torvalds
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-07 Thread GMail
Hi Csaba,
thank you for checking!

xmllint works flawlessly in 2.9.0 here as well - as I have indicated in the
original email.

As a quick recap:
 - I use pretty much the same code to read the XML using XMLReader as
xmllint: xmlReaderForFile(...) followed by an xmlTextReaderRead (...)
 - For the exact same documents and source code:
- libxml 2.9.0 gives a validation errors on MSVC 2010 (the validation
error appears for every single attribute and element).
- libxml 2.8.0 and below works perfectly.
 - My conclusion: a bug has been introduced in 2.9.0 that prevents
validation on MSVC 2010.

Best regards: Zoltán Ördögh


On Sun, Apr 7, 2013 at 5:02 AM, Csaba Raduly rcs...@gmail.com wrote:

 Hi Zoltán,

 On Sun, Apr 7, 2013 at 8:30 AM, Zoltán Ördögh  wrote:
  I checked 2.8.0 out of curiosity - that works, too.
  It seems a bug has been introduced into 2.9.0 - and it apparently impacts
  only MSVC 2010 (well, so far it seems I am the only one).

 I tried your example with Cygwin's xmllint and with my homemade
 validator based on Xerces-C. Both passed successfully.

 $ xmllint.exe --version
 xmllint: using libxml version 20900
compiled with: Threads Tree Output Push Reader Patterns Writer
 SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer
 XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas
 Schematron Modules Debug Zlib Lzma

 $ xmllint.exe --noout --valid testme.xml
 no output

 Csaba
 --
 GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
 The Tao of math: The numbers you can count are not the real numbers.
 Life is complex, with real and imaginary parts.
 Ok, it boots. Which means it must be bug-free and perfect.  -- Linus
 Torvalds
 People disagree with me. I just ignore them. -- Linus Torvalds

___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-07 Thread John Brown
On Saturday, April 6, 2013 11:15 AM, Zoltán Ördögh wrote:
On Sat, Apr 6, 2013 at 4:18 AM, John Brown johnbrown_...@yahoo.com wrote:


[1]C:\Temp\TestMestart file:///./testme.xml
The system cannot find the file file:///./testme.xml.

[2]C:\Temp\TestMestart file:///c:/temp/testme/testme.xml

C:\Temp\TestMe

Command [2] causes the XML file to be opened in my default
XML file editor. For what it is worth, I am on Windows 8.


Does it work if you change your DOCTYPE to
!DOCTYPE XMLTestMe SYSTEM testme.dtd ?




Hi John,
thanks for the reply.


I am not sure why'd you use that command line though; the file:/// 
 prefix is not needed when you use it from the shell.



I said that I believed that a relative path in a file: URL
was invalid. My command line showed that Windows would not
launch the file with the attempted relative path
file:///./testme.xml, but it worked when I specified the
absolute path
file:///c:/temp/testme/testme.xml.


By now I amsure that you have seen that Danniel also says
that relative paths are illegal, although that does not 
tell you why xmllint accepts it but your program does not.

Regards,
John Brown.

___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-06 Thread GMail
I saw this code in xmllint.c (removed conditionals that do not apply):

static void streamFile(char *filename) {
xmlTextReaderPtr reader;
int ret;
reader = xmlReaderForFile(filename, NULL, options);

if (reader != NULL) {
if (valid)
xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
else
xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);

/*
 * Process all nodes in sequence
 */
if ((timing)  (!repeat)) {
startTimer();
}
ret = xmlTextReaderRead(reader);
while (ret == 1) {
if ((debug)
   )
processNode(reader);
ret = xmlTextReaderRead(reader);
}
if ((timing)  (!repeat)) {
if (valid)
endTimer(Parsing and validating);
else
endTimer(Parsing);
}

if (valid) {
if (xmlTextReaderIsValid(reader) != 1) {
xmlGenericError(xmlGenericErrorContext,
Document %s does not validate\n, filename);
progresult = XMLLINT_ERR_VALID;
}
}
/*
 * Done, cleanup and status
 */
xmlFreeTextReader(reader);
if (ret != 0) {
fprintf(stderr, %s : failed to parse\n, filename);
progresult = XMLLINT_ERR_UNCLASS;
}
} else {
fprintf(stderr, Unable to open %s\n, filename);
progresult = XMLLINT_ERR_UNCLASS;
}
}

I tried using the exact same code but I still get the same validation
errors on the first call to xmlTextReaderRead...
It is vexing me...
Any thoughts?

Thank you!

Best regards: Zoltán Ördögh


On Sat, Apr 6, 2013 at 2:00 AM, Zoltán Ördögh (GMail) csi...@gmail.comwrote:

 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


___
xml 

Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-06 Thread Daniel Veillard
On Sat, Apr 06, 2013 at 07:50:56PM -0400, Zoltán Ördögh (GMail) wrote:
 I saw this code in xmllint.c (removed conditionals that do not apply):
[...]
 I tried using the exact same code but I still get the same validation
 errors on the first call to xmlTextReaderRead...
 It is vexing me...
 Any thoughts?

  See your xml and the system identifier you use for the DTD

  file:///./

if I use that I get an error that the DTD fails to be loaded on linux
and validation fails (xml and dtd being in the same directory) switching
to
  ./testme.dtd

works after that i.e. xmllint code succeeds

file:// URIs are (or used to be) completely underspecified, and
what you use there would mean on a Linux machine, the file testme.dtd
which is in the . directory under to root of the filesystem of the
localhost machine, i.e. /testme.dtd instead of ./testme.dtd
What is does on Windows and why, I can't guess and I can't test,
simply run your program under a debugger, since you have a reliable
behaviour !

Daniel

-- 
Daniel Veillard  | Open Source and Standards, Red Hat
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange validation errors in libxml 2.9.0 with MSVC 2010

2013-04-06 Thread GMail
Hi Daniel,
thanks for responding over the weekend, much obliged.

Please note that the problem is not the system ID; I replaced the full path
to the relative one as I was sure that my full path would not work for
anyone else.
So, the DTD is in fact, found - how else would xmllint.exe be able to
validate it? I messed up the DTD on purpose once just to see if there are
errors - and there were, so xmllint can find the DTD for sure.

The source of my frustrations are the validation errors that are produced
by a seemingly correct code, validated and well-formed XML and DTD.

The only thing I can think of is that the some build setting may be wrong -
however I am not adept enough to discover that.

Did anyone managed to get xmlReaderForFile(...) working on MSVC 2010
without validation errors?

Best regards: Zoltán Ördögh


On Sat, Apr 6, 2013 at 11:05 PM, Daniel Veillard veill...@redhat.comwrote:

 On Sat, Apr 06, 2013 at 07:50:56PM -0400, Zoltán Ördögh (GMail) wrote:
  I saw this code in xmllint.c (removed conditionals that do not apply):
 [...]
  I tried using the exact same code but I still get the same validation
  errors on the first call to xmlTextReaderRead...
  It is vexing me...
  Any thoughts?

   See your xml and the system identifier you use for the DTD

   file:///./

 if I use that I get an error that the DTD fails to be loaded on linux
 and validation fails (xml and dtd being in the same directory) switching
 to
   ./testme.dtd

 works after that i.e. xmllint code succeeds

 file:// URIs are (or used to be) completely underspecified, and
 what you use there would mean on a Linux machine, the file testme.dtd
 which is in the . directory under to root of the filesystem of the
 localhost machine, i.e. /testme.dtd instead of ./testme.dtd
 What is does on Windows and why, I can't guess and I can't test,
 simply run your program under a debugger, since you have a reliable
 behaviour !

 Daniel

 --
 Daniel Veillard  | Open Source and Standards, Red Hat
 veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
 http://veillard.com/ | virtualization library  http://libvirt.org/

___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml