Re: [xml] Resuming maintenance

2022-01-11 Thread Daniel Veillard via xml
On Mon, Jan 10, 2022 at 03:20:09PM +0100, Nick Wellnhofer via xml wrote:
> Hello,
> 
> Thanks to a donation from Google, I'm able to resume maintenance of libxml2
> (and libxslt) for the remainder of 2022.

  Yay !  :-)

> My immediate plans are:
> 
> - Make a bug fix release fixing many regressions.
> - Establish a new release schedule, possibly with multiple branches being
>   maintained.
> - Move releases from the old FTP server to GNOME's Gitlab infrastructure.
> - Move documentation to GNOME infrastructure.
> - Set up an official way to sponsor libxml2 maintainers.

 So you want to reintegrate libxml2 within the GNOME framework ? TBH
now that I have very limited bandwidth that's probably the right thing
to do.
 Happy to help you any steps you may need to take over,

   thanks,

Daniel

> In the future I'll focus less on security improvements and more on typical
> maintenance duties like bug fixes and modernizing the code base in a few
> ways.
> 
> Thanks (again) to Google for making this possible.
> 
> Nick
> ___
> xml mailing list, project page  http://xmlsoft.org/
> xml@gnome.org
> https://mail.gnome.org/mailman/listinfo/xml

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Stepping down

2021-07-27 Thread Daniel Veillard via xml
On Thu, Jul 22, 2021 at 01:23:27PM +0200, Nick Wellnhofer via xml wrote:
> I never really asked for it but in the last years I became de-facto
> maintainer of both libxml2 and libxslt. Luckily, I was able to fund my
> involvement through Chrome VRP bug bounties and OSS-Fuzz integration
> rewards. Big thanks to Google for these outstanding programs.
> 
> Unfortunately, returns from security research are diminishing quickly and I
> see no way to obtain a minimal level of funding anymore. So I'm stepping
> down as contributor and maintainer.
> 
> Thanks to everyone who reported bugs and contributed patches!
> 
> Nick

  Hi Nick,

 that's quite infortunate, you did a really good job of taking care of
users bugs and requests those years. The libraries are not trivial
there is quite some complexity, and you managed to master that code,
not a small achievement !
 I'm really not able at that point to insure the same level of followup
for those projects myself, that's obvious for anybody monitoring those
lists lately.

   I will join the others thanking you for everything you provided,
I hope you have a good plan forward, obviously you have a lot of
technical skills while being able to act in a leading way !

Best wishes,

 sincerely,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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


[xml] Release of libxml2 2.9.12

2021-05-13 Thread Daniel Veillard via xml
  Oh well, a little bit of shame is better than a long lasting pain,
so 2.9.12 is out and it now includes everything to build outside of
a git checkout tree !

  Sorry about that, and thanks for reporting it !

Daniel

On Thu, May 13, 2021 at 08:14:04PM +0200, Daniel Veillard via xml wrote:
> On Thu, May 13, 2021 at 05:52:16PM +0200, Jan Tojnar wrote:
> > Hi, trying to build the package from the tarball on NixOS, it appears that
> > fuzz/fuzz.h is missing from the archive:
> > 
> > testFuzzer.c:13:10: fatal error: fuzz.h: No such file or directory
> >   13 | #include "fuzz.h"
> >  |  ^~~~
> > compilation terminated.
> > 
> > It appears to be available in the git repo, so perhaps it just needs to be
> > added to EXTRA_DIST or something?
> 
>   Arghhh, indeed :-(
> 
> Daniel
> 
> > On Thu, May 13 2021 at 15:54:55 +0200, Daniel Veillard via xml
> >  wrote:
> > >   P, I am way way behind, but now that CVE-2021-3541 is out I just
> > > pushed
> > > that long awaited release. libxml2 2.9.11 is tagged in git and a signed
> > > tarball is available at the usual place:
> > > 
> > > ftp://xmlsoft.org/libxml2/
> > > 
> > > 
> > >   This release incoporate the various security and quadatic patches that
> > > Nick has found and fixed, and CVE-2021-3541. There is also a very large
> > > list
> > > of bug fixes and improvement most of them from Nick too:
> > > 
> > > Security:
> > > - Patch for security issue CVE-2021-3541 (Daniel Veillard)
> > > Documentation:
> > > - Clarify xmlNewDocProp documentation (Nick Wellnhofer)
> > > Portability:
> > > - CMake: Only add postfixes if MSVC (Christopher Degawa)
> > > - Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer)
> > > - Use CMake PROJECT_VERSION (Markus Rickert)
> > > - Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson)
> > > - Add CI for CMake on MSVC (Markus Rickert)
> > > - Update minimum required CMake version (Markus Rickert)
> > > - Add variables for configured options to CMake config files (Markus
> > > Rickert)
> > > - Check if variables exist when defining targets (Markus Rickert)
> > > - Check if target exists when reading target properties (Markus Rickert)
> > > - Add xmlcatalog target and definition to config files (Markus Rickert)
> > > - Remove include directories for link-only dependencies (Markus Rickert)
> > > - Fix ICU build in CMake (Markus Rickert)
> > > - Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus
> > > Rickert)
> > > - Update CMake config files (Markus Rickert)
> > > - Add xmlcatalog and xmllint to CMake export (Markus Rickert)
> > > - Simplify xmlexports.h (Nick Wellnhofer)
> > > - Require dependencies based on enabled CMake options (Markus Rickert)
> > > - Use NAMELINK_COMPONENT in CMake install (Markus Rickert)
> > > - Add CMake files to EXTRA_DIST (Markus Rickert)
> > > - Add missing compile definition for static builds to CMake (Markus
> > > Rickert)
> > > - Add CI for CMake on Linux and MinGW (Markus Rickert)
> > > - Fix variable name in win32/configure.js (Nick Wellnhofer)
> > > - Fix version parsing in win32/configure.js (Nick Wellnhofer)
> > > - Fix autotools warnings (Nick Wellnhofer)
> > > - Update config.h.cmake.in (Markus Rickert)
> > > - win32: allow passing *FLAGS on command line (Michael Stahl)
> > > - Configure file xmlwin32version.h.in on MSVC (Markus Rickert)
> > > - List headers individually (Markus Rickert)
> > > - Add CMake build files (Markus Rickert)
> > > - Parenthesize Py_Check() in ifs (Miro Hrončok)
> > > - Minor fixes to configure.js (Nick Wellnhofer)
> > > Bug Fixes:
> > > - Fix null deref in legacy SAX1 parser (Nick Wellnhofer)
> > > - Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer)
> > > - Fix line numbers in error messages for mismatched tags (Nick
> > > Wellnhofer)
> > > - Fix htmlTagLookup (Nick Wellnhofer)
> > > - Propagate error in xmlParseElementChildrenContentDeclPriv (Nick
> > > Wellnhofer)
> > > - Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick
> > > Wellnhofer)
> > > - Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer)
> > > - Validate UTF8 in xmlEncodeEntities (Joel Hockey)
> > > - Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer)
> > > - Allow FP division by zero in xmlXPathInit (Nick Wellnhofer)
&g

Re: [xml] Release of libxml2 2.9.11

2021-05-13 Thread Daniel Veillard via xml
On Thu, May 13, 2021 at 05:52:16PM +0200, Jan Tojnar wrote:
> Hi, trying to build the package from the tarball on NixOS, it appears that
> fuzz/fuzz.h is missing from the archive:
> 
> testFuzzer.c:13:10: fatal error: fuzz.h: No such file or directory
>   13 | #include "fuzz.h"
>  |  ^~~~
> compilation terminated.
> 
> It appears to be available in the git repo, so perhaps it just needs to be
> added to EXTRA_DIST or something?

  Arghhh, indeed :-(

Daniel

> On Thu, May 13 2021 at 15:54:55 +0200, Daniel Veillard via xml
>  wrote:
> >   P, I am way way behind, but now that CVE-2021-3541 is out I just
> > pushed
> > that long awaited release. libxml2 2.9.11 is tagged in git and a signed
> > tarball is available at the usual place:
> > 
> > ftp://xmlsoft.org/libxml2/
> > 
> > 
> >   This release incoporate the various security and quadatic patches that
> > Nick has found and fixed, and CVE-2021-3541. There is also a very large
> > list
> > of bug fixes and improvement most of them from Nick too:
> > 
> > Security:
> > - Patch for security issue CVE-2021-3541 (Daniel Veillard)
> > Documentation:
> > - Clarify xmlNewDocProp documentation (Nick Wellnhofer)
> > Portability:
> > - CMake: Only add postfixes if MSVC (Christopher Degawa)
> > - Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer)
> > - Use CMake PROJECT_VERSION (Markus Rickert)
> > - Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson)
> > - Add CI for CMake on MSVC (Markus Rickert)
> > - Update minimum required CMake version (Markus Rickert)
> > - Add variables for configured options to CMake config files (Markus
> > Rickert)
> > - Check if variables exist when defining targets (Markus Rickert)
> > - Check if target exists when reading target properties (Markus Rickert)
> > - Add xmlcatalog target and definition to config files (Markus Rickert)
> > - Remove include directories for link-only dependencies (Markus Rickert)
> > - Fix ICU build in CMake (Markus Rickert)
> > - Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus
> > Rickert)
> > - Update CMake config files (Markus Rickert)
> > - Add xmlcatalog and xmllint to CMake export (Markus Rickert)
> > - Simplify xmlexports.h (Nick Wellnhofer)
> > - Require dependencies based on enabled CMake options (Markus Rickert)
> > - Use NAMELINK_COMPONENT in CMake install (Markus Rickert)
> > - Add CMake files to EXTRA_DIST (Markus Rickert)
> > - Add missing compile definition for static builds to CMake (Markus
> > Rickert)
> > - Add CI for CMake on Linux and MinGW (Markus Rickert)
> > - Fix variable name in win32/configure.js (Nick Wellnhofer)
> > - Fix version parsing in win32/configure.js (Nick Wellnhofer)
> > - Fix autotools warnings (Nick Wellnhofer)
> > - Update config.h.cmake.in (Markus Rickert)
> > - win32: allow passing *FLAGS on command line (Michael Stahl)
> > - Configure file xmlwin32version.h.in on MSVC (Markus Rickert)
> > - List headers individually (Markus Rickert)
> > - Add CMake build files (Markus Rickert)
> > - Parenthesize Py_Check() in ifs (Miro Hrončok)
> > - Minor fixes to configure.js (Nick Wellnhofer)
> > Bug Fixes:
> > - Fix null deref in legacy SAX1 parser (Nick Wellnhofer)
> > - Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer)
> > - Fix line numbers in error messages for mismatched tags (Nick
> > Wellnhofer)
> > - Fix htmlTagLookup (Nick Wellnhofer)
> > - Propagate error in xmlParseElementChildrenContentDeclPriv (Nick
> > Wellnhofer)
> > - Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick
> > Wellnhofer)
> > - Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer)
> > - Validate UTF8 in xmlEncodeEntities (Joel Hockey)
> > - Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer)
> > - Allow FP division by zero in xmlXPathInit (Nick Wellnhofer)
> > - Fix xmlGetNodePath with invalid node types (Nick Wellnhofer)
> > - Fix exponential behavior with recursive entities (Nick Wellnhofer)
> > - Fix quadratic behavior when looking up xml:* attributes (Nick
> > Wellnhofer)
> > - Fix slow parsing of HTML with encoding errors (Nick Wellnhofer)
> > - Fix null deref introduced with previous commit (Nick Wellnhofer)
> > - Check for invalid redeclarations of predefined entities (Nick
> > Wellnhofer)
> > - Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate)
> > - parser.c: shrink the input buffer when appropriate (Mike Dalessio)
> > - Fix infinite loop in HTML parser intro

[xml] Release of libxml2 2.9.11

2021-05-13 Thread Daniel Veillard via xml
  P, I am way way behind, but now that CVE-2021-3541 is out I just pushed
that long awaited release. libxml2 2.9.11 is tagged in git and a signed
tarball is available at the usual place:

ftp://xmlsoft.org/libxml2/


  This release incoporate the various security and quadatic patches that
Nick has found and fixed, and CVE-2021-3541. There is also a very large list
of bug fixes and improvement most of them from Nick too:

Security:
- Patch for security issue CVE-2021-3541 (Daniel Veillard)
Documentation:
- Clarify xmlNewDocProp documentation (Nick Wellnhofer)
Portability:
- CMake: Only add postfixes if MSVC (Christopher Degawa)
- Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer)
- Use CMake PROJECT_VERSION (Markus Rickert)
- Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson)
- Add CI for CMake on MSVC (Markus Rickert)
- Update minimum required CMake version (Markus Rickert)
- Add variables for configured options to CMake config files (Markus Rickert)
- Check if variables exist when defining targets (Markus Rickert)
- Check if target exists when reading target properties (Markus Rickert)
- Add xmlcatalog target and definition to config files (Markus Rickert)
- Remove include directories for link-only dependencies (Markus Rickert)
- Fix ICU build in CMake (Markus Rickert)
- Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert)
- Update CMake config files (Markus Rickert)
- Add xmlcatalog and xmllint to CMake export (Markus Rickert)
- Simplify xmlexports.h (Nick Wellnhofer)
- Require dependencies based on enabled CMake options (Markus Rickert)
- Use NAMELINK_COMPONENT in CMake install (Markus Rickert)
- Add CMake files to EXTRA_DIST (Markus Rickert)
- Add missing compile definition for static builds to CMake (Markus Rickert)
- Add CI for CMake on Linux and MinGW (Markus Rickert)
- Fix variable name in win32/configure.js (Nick Wellnhofer)
- Fix version parsing in win32/configure.js (Nick Wellnhofer)
- Fix autotools warnings (Nick Wellnhofer)
- Update config.h.cmake.in (Markus Rickert)
- win32: allow passing *FLAGS on command line (Michael Stahl)
- Configure file xmlwin32version.h.in on MSVC (Markus Rickert)
- List headers individually (Markus Rickert)
- Add CMake build files (Markus Rickert)
- Parenthesize Py_Check() in ifs (Miro Hrončok)
- Minor fixes to configure.js (Nick Wellnhofer)
Bug Fixes:
- Fix null deref in legacy SAX1 parser (Nick Wellnhofer)
- Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer)
- Fix line numbers in error messages for mismatched tags (Nick Wellnhofer)
- Fix htmlTagLookup (Nick Wellnhofer)
- Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer)
- Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer)
- Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer)
- Validate UTF8 in xmlEncodeEntities (Joel Hockey)
- Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer)
- Allow FP division by zero in xmlXPathInit (Nick Wellnhofer)
- Fix xmlGetNodePath with invalid node types (Nick Wellnhofer)
- Fix exponential behavior with recursive entities (Nick Wellnhofer)
- Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer)
- Fix slow parsing of HTML with encoding errors (Nick Wellnhofer)
- Fix null deref introduced with previous commit (Nick Wellnhofer)
- Check for invalid redeclarations of predefined entities (Nick Wellnhofer)
- Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate)
- parser.c: shrink the input buffer when appropriate (Mike Dalessio)
- Fix infinite loop in HTML parser introduced with recent commits (Nick 
Wellnhofer)
- Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer)
- Fix timeout when handling recursive entities (Nick Wellnhofer)
- Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer)
- Fix null deref in xmlStringGetNodeList (Nick Wellnhofer)
- use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio)
- htmlParseComment: treat `--!>` as if it closed the comment (Mike Dalessio)
- Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer)
- encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni)
- xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet->val" 
(Xiaoming Ni)
- Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer)
- Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer)
- Avoid quadratic checking of identity-constraints (Michael Matz)
- Fix building with ICU 68. (Frederik Seiffert)
- Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner)
- Fix xmlURIEscape memory leaks. (Elliott Hughes)
- Avoid call stack overflow with XML reader and recursive XIncludes (Nick 
Wellnhofer)
- Fix caret in regexp character group (Nick Wellnhofer)
- parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio)
- Fix memory leaks in XPointer string-range function (Nick Wellnhofer)
- 

Re: [xml] Could we have a new release?

2021-04-15 Thread Daniel Veillard via xml
On Wed, Apr 14, 2021 at 11:35:58AM +0200, Stefan Behnel wrote:
> Hi,
> 
> libxml2 2.9.10 has been around for almost 18 months now. There have been
> lots of fixes during that time, so, may I kindly ask what's hindering a new
> release?

  Maybe that I'm just too busy with "work", plus teh fact that there is
something I would need to get in before a release.

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] getting the output of string() in the xmllint shell

2019-12-21 Thread Daniel Veillard via xml
On Fri, Dec 20, 2019 at 12:46:23PM +0100, Gökçe Aydos wrote:
> I use xmllint in my command-line scripts. The default mode of xmllint
> does not support namespaces, so when I must deal with XML files with
> namespaces I use the --shell mode of xmllint.

  That sounds ... wrong

> I noticed that the xpath command in the shell behaves differently than
> the *xmllint --xpath* on the command line. For example if I want to
> extract only the string portion of an attribute I use:
> 
>   xmllint --xpath "string(//node)"

  hum ... //node doesn't address attributes

> When I want to do the same in the shell, I must use the *xpath* command,
> because the *cat* command only supports node addresses.
> 
>   xpath "string(//node)"
> 
> Unfortunately the xpath command gives an output like:
> 
>   Object is a string : http://purl.obolibrary.org/obo/DOID_8545...
> 
> Is it possible to get a clean output with xmllint without using other tools?

  your request is very confusing but you should be able to get the string
value of the attributes directly by using an XPath looking for that attribute

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Memory leak problem

2019-12-21 Thread Daniel Veillard via xml
  Hi Eric,

sorry, I'm very late to the thread, but in case you still have issues:

 1/ yes xmlFreeDoc is the right way to free the whole memory of the
document, you may be missing freeing other bits left and right if you
don't use it
 2/ you can debug memory allocation by running valgrind but there is another
libxml2 only way:
- recompile after configuring with --with-mem-debug , when doing so
  xmlFree() and free() are not interchangeable anymore but all allocations
  by libxml2 are tracked
- xmlMemoryDump() then saves to a .memorylist file all the allocations
  made by libxml2 which were not freed by libxml2 you can also call it
  from a debugger to track dynamically
that's how I removed most leaks in libxml2
 3/ valgrind is indeed the simplest tool if you can't recompile or
if you mixed alloc and frees from the C library and libxml2 layers
I would still encourage to avoid that mixing, some of the special features
of the libxml2 DOM tree are that sometimes the same string should be freed
sometime it can't e.g. textual node content.
 4/ the library use a dictionary which can be reused accross documents
and only xmlCleanupParser() frees that up but you should be very careful
about in threaded context or in programs potentially using libxml2 in
other modules.

  that said I hope your problem is solved now, sorry for being so late

Daniel

On Sat, Nov 23, 2019 at 10:53:01AM -0700, Eric Eberhard wrote:
> I have used libxml2 since it was libxml so I can't believe I am having this
> problem.  I'm looking for someone smarter than me to help out.
> 
>  
> 
> I use only the DOM (memory) parser, and an old version at that:
> libxml2-2.7.3
> 
>  
> 
> I have a program that makes many XML files.  They, alone, are not a problem.
> But when a large amount are made (100s) it gets a memory error.
> 
>  
> 
> After each XML document I make I write them to disk and then free them
> (meaning I thought I was freeing ALL the memory).  This is not the case so I
> assume I am not coding it correctly.  This is what I am doing .
> 
>  
> 
> The node is passed to this function  (xmlNodePtr) named freeMe(xmlNsPtr
> node)
> 
>  
> 
> Void freeMe(xmlNSPtr node) {
> 
>  
> 
> xmlNsPtr next; 
> 
>  xmlNsPtr cur;  
> 
>   
> 
>  cur = node->ns;
> 
>  while (cur) {  
> 
>  next = cur->next;  
> 
>   if (cur->href) xmlFree((char *) cur->href);
> 
>   if (cur->prefix) xmlFree((char *) cur->prefix);
> 
>   cur->href = NULL;  
> 
>   cur->prefix = NULL;
> 
>xmlFree((char *)cur); 
> 
>   cur = next; 
> 
> }
> 
> node->ns = NULL; 
> 
>  
> 
> if (node->type == XML_ELEMENT_NODE ||   
> 
>  node->type == XML_XINCLUDE_START || 
> 
>   node->type == XML_XINCLUDE_END) {  
> 
>  cur = node->nsDef;  
> 
>  while (cur) {   
> 
>  next = cur->next;  
> 
>   if (cur->href) xmlFree((char *) cur->href); 
> 
>if (cur->prefix) xmlFree((char *) cur->prefix
> 
>cur->href = NULL;   
> 
>cur->prefix = NULL; 
> 
>xmlFree((char *)cur);
> 
> 
>  cur = next; 
> 
>  }   
> 
>  node->nsDef = NULL;  
> 
> If (node->children)
> 
> 
> FreeMe(node->children);//recursive
> 
> } 
> 
> 
> 
> xmlFreeDoc(node);
> 
>  
> 
> //done I think freeing up all memory
> 
>  
> 
> I LEFT out the tests for NULLS and error checking and other silly things so
> it would not be too long.
> 
>  
> 
> It also repeats mostly the exact same code if the node is NS so I won't bore
> you.  Don't use NS much anyway.
> 
>  
> 
> Problem is, something is not free()'d up.  
> 
>  
> 
> So besides the main node and NS is there something else I have to free()?
> Better, is there a function that I can pass the node and it free()'s
> everything for me?
> 
>  
> 
> Any help - even sample code - would be much appreciated!  Free horse back
> ride in AZ for a winner?
> 
>  
> 
> E
> 
>  
> 
>  
> 
> 
> 
>  
> 
>  
> 
>  
> 
>  
> 
> Eric S Eberhard
> 
> VICS (Vertical Integrated Computer Systems)
> 
> Voice: 928 567 3529

Re: [xml] Entering freeze for libxml2-2.9.10

2019-11-03 Thread Daniel Veillard via xml
On Thu, Oct 31, 2019 at 10:06:51PM +0100, Stefan Behnel wrote:
> Hi,
> 
> sorry to be late to the party. Let me note that the release tests fine with
> lxml, just with two test failures due to changed (and apparently more
> accurate) error texts/IDs. I'll adapt the tests in lxml.
> 
> Thank you for the release, Daniel!
> 
> Stefan

  Okay, good to know :-)

   thanks Stefan !

Daniel

> 
> Daniel Veillard schrieb am 28.10.19 um 21:26:
> > On Tue, Oct 29, 2019 at 07:40:34AM +1300, David Warring wrote:
> >> The tests for newish Raku (Perl 6) bindings are fine with 
> >> libxml2-2.9.10-rc1
> >> https://github.com/p6-xml/LibXML-p6
> > 
> >   Okay seems we have a good one ! Thanks David
> > 
> > BTW is lxml current maintainer around, that may be one good way to validate
> > that one and the libxslt 1.1.34 rc2 too, Stefan or Martijn are you around ?
> > 
> > Daniel
> > 
> >> - David
> >>
> >> On Thu, Oct 24, 2019 at 5:53 AM Daniel Veillard via xml 
> >> wrote:
> >>
> >>>   Took a while but it's time to assemble a new release,
> >>> I tagged it in git and pushed signed tarball and rpms to the
> >>> usual place:
> >>>
> >>>ftp://xmlsoft.org/libxml2/
> >>>
> >>> I will try to make an rc2 during the week-end, and then we can
> >>> roll up the release by mid next week.
> >>>
> >>>  In the meantime please give it some testing,
> >>>
> >>>thanks,
> >>>
> >>> Daniel
> >>>
> >>> --
> >>> Daniel Veillard  | Red Hat Developers Tools
> >>> http://developer.redhat.com/
> >>> 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
> >>>
> > 
> 
> ___
> xml mailing list, project page  http://xmlsoft.org/
> xml@gnome.org
> https://mail.gnome.org/mailman/listinfo/xml

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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


[xml] Release of libxml2-2.9.10

2019-10-30 Thread Daniel Veillard via xml
   It's out ! Tagged in git and with signed tarball and rpms
at the usual place:

  ftp://xmlsoft.org/libxml2/


  This is a relatively large release, Nick fixed a number of bugs and improved
the code in many areas, among other things removing some recursive behaviour
of the code in various places. Includes various portability fixes,
documentation updates and cleanups:

Documentation:
- Fix a few more typos ("fonction") (Nick Wellnhofer)
- Large batch of typo fixes (Jared Yanovich)
- Fix typos: tree: move{ -> s}, reconcil{i -> }ed, h{o -> e}ld by... (Jan 
Pokorný)
- Fix typo: xpath: simpli{ -> fi}ed (Jan Pokorný)
- Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump (Jan 
Pokorný)
- Fix comments in test code (zhouzhongyuan)
- fix comment in testReader.c (zhouzhongyuan)

Portability:
- Fix some release issues on Fedora 30 (Daniel Veillard)
- Fix exponent digits when running tests under old MSVC (Daniel Richard G)
- Work around buggy ceil() function on AIX (Daniel Richard G)
- Don't call printf with NULL string in runtest.c (Daniel Richard G)
- Switched from unsigned long to ptrdiff_t in parser.c (Stephen Chenney)
- timsort.h: support older GCCs (Jérôme Duval)
- Make configure.ac work with older pkg-config (Nick Wellnhofer)
- Stop defining _REENTRANT on some Win32 platforms (Nick Wellnhofer)
- Fix nanohttp.c on MinGW (Nick Wellnhofer)
- Fix Windows compiler warning in testC14N.c (Nick Wellnhofer)
- Merge testThreadsWin32.c into testThreads.c (Nick Wellnhofer)
- Fix Python bindings under Windows (Nick Wellnhofer)

Bug Fixes:
- Another fix for conditional sections at end of document (Nick Wellnhofer)
- Fix for conditional sections at end of document (Nick Wellnhofer)
- Make sure that Python tests exit with error code (Nick Wellnhofer)
- Audit memory error handling in xpath.c (Nick Wellnhofer)
- Fix error code in xmlTextWriterStartDocument (Nick Wellnhofer)
- Fix integer overflow when counting written bytes (Nick Wellnhofer)
- Fix uninitialized memory access in HTML parser (Nick Wellnhofer)
- Fix memory leak in xmlSchemaValAtomicType (Nick Wellnhofer)
- Disallow conditional sections in internal subset (Nick Wellnhofer)
- Fix use-after-free in xmlTextReaderFreeNodeList (Nick Wellnhofer)
- Fix Regextests (Nick Wellnhofer)
- Fix empty branch in regex (Nick Wellnhofer)
- Fix integer overflow in entity recursion check (Nick Wellnhofer)
- Don't read external entities or XIncludes from stdin (Nick Wellnhofer)
- Fix Schema determinism check of ##other namespaces (Nick Wellnhofer)
- Fix potential null deref in xmlSchemaIDCFillNodeTables (zhouzhongyuan)
- Fix potential memory leak in xmlBufBackToBuffer (Nick Wellnhofer)
- Fix error message when processing XIncludes with fallbacks (Nick Wellnhofer)
- Fix memory leak in xmlRegEpxFromParse (zhouzhongyuan)
- 14:00 is a valid timezone for xs:dateTime (Nick Wellnhofer)
- Fix memory leak in xmlParseBalancedChunkMemoryRecover (Zhipeng Xie)
- Fix potential null deref in xmlRelaxNGParsePatterns (Nick Wellnhofer)
- Misleading error message with xs:{min|max}Inclusive (bettermanzzy)
- Fix memory leak in xmlXIncludeLoadTxt (Wang Kirin)
- Partial fix for comparison of xs:durations (Nick Wellnhofer)
- Fix null deref in xmlreader buffer (zhouzhongyuan)
- Fix unability to RelaxNG-validate grammar with choice-based name class (Jan 
Pokorný)
- Fix unability to validate ambiguously constructed interleave for RelaxNG (Jan 
Pokorný)
- Fix possible null dereference in xmlXPathIdFunction (zhouzhongyuan)
- fix memory leak in xmlAllocOutputBuffer (zhouzhongyuan)
- Fix unsigned int overflow (Jens Eggerstedt)
- dict.h: gcc 2.95 doesn't allow multiple storage classes (Nick Wellnhofer)
- Fix another code path in xmlParseQName (Nick Wellnhofer)
- Make sure that xmlParseQName returns NULL in error case (Nick Wellnhofer)
- Fix build without reader but with pattern (Nick Wellnhofer)
- Fix memory leak in xmlAllocOutputBufferInternal error path (Nick Wellnhofer)
- Fix unsigned integer overflow (Nick Wellnhofer)
- Fix return value of xmlOutputBufferWrite (Nick Wellnhofer)
- Fix parser termination from "Double hyphen within comment" error (David 
Warring)
- Fix call stack overflow in xmlFreePattern (Nick Wellnhofer)
- Fix null deref in previous commit (Nick Wellnhofer)
- Fix memory leaks in xmlXPathParseNameComplex error paths (Nick Wellnhofer)
- Check for integer overflow in xmlXPtrEvalChildSeq (Nick Wellnhofer)
- Fix xmllint dump of XPath namespace nodes (Nick Wellnhofer)
- Fix float casts in xmlXPathSubstringFunction (Nick Wellnhofer)
- Fix null deref in xmlregexp error path (Nick Wellnhofer)
- Fix null pointer dereference in xmlTextReaderReadOuterXml (Nick Wellnhofer)
- Fix memory leaks in xmlParseStartTag2 error paths (Nick Wellnhofer)
- Fix memory leak in xmlSAX2StartElement (Nick Wellnhofer)
- Fix commit "Memory leak in xmlFreeID (xmlreader.c)" (Nick Wellnhofer)
- Fix NULL pointer deref in xmlTextReaderValidateEntity (Nick Wellnhofer)
- Memory leak in xmlFreeTextReader (Nick 

Re: [xml] Entering freeze for libxml2-2.9.10

2019-10-28 Thread Daniel Veillard via xml
On Tue, Oct 29, 2019 at 07:40:34AM +1300, David Warring wrote:
> The tests for newish Raku (Perl 6) bindings are fine with libxml2-2.9.10-rc1
> https://github.com/p6-xml/LibXML-p6

  Okay seems we have a good one ! Thanks David

BTW is lxml current maintainer around, that may be one good way to validate
that one and the libxslt 1.1.34 rc2 too, Stefan or Martijn are you around ?

Daniel

> - David
> 
> On Thu, Oct 24, 2019 at 5:53 AM Daniel Veillard via xml 
> wrote:
> 
> >   Took a while but it's time to assemble a new release,
> > I tagged it in git and pushed signed tarball and rpms to the
> > usual place:
> >
> >ftp://xmlsoft.org/libxml2/
> >
> > I will try to make an rc2 during the week-end, and then we can
> > roll up the release by mid next week.
> >
> >  In the meantime please give it some testing,
> >
> >thanks,
> >
> > Daniel
> >
> > --
> > Daniel Veillard  | Red Hat Developers Tools
> > http://developer.redhat.com/
> > 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
> >

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Entering freeze for libxml2-2.9.10

2019-10-28 Thread Daniel Veillard via xml
On Mon, Oct 28, 2019 at 02:07:28PM -0400, Mike Dalessio wrote:
> Hi all,
> 
> Just FYI - the Nokogiri (Ruby gem wrapping libxml2) test pipelines are all
> *green* with 2.9.10-rc1.
> 
> See
> https://ci.nokogiri.org/teams/nokogiri-core/pipelines/nokogiri-libxml-2.9.10
> for
> details, but RC1 looks good from here.

  Another good news, thanks Mike !

Daniel

> -m
> 
> 
> On Mon, Oct 28, 2019 at 10:12 AM Daniel Veillard via xml 
> wrote:
> 
> > On Mon, Oct 28, 2019 at 02:35:06PM +0100, Christoph M. Becker wrote:
> > > Hi,
> > >
> > > On 28.10.2019 at 10:06, Daniel Veillard via xml wrote:
> > >
> > > >   In the absence of feedback or changes since RC1, I am not pushing
> > > > an RC2 for libxml2-2.9.10, assume a final release for Wed or Thursday,
> > > >
> > > >   in the meantime, please give it a try !
> > >
> > > I just ran the php-src test suite for all relevant PHP extensions using
> > > libxml2, and I detected no regression compared to 2.9.9 (besides some
> > > minor] error reporting difference regarding a broken XML file[1).
> > >
> > > So RC1 looks good to me.  Thanks!
> > >
> > > [1]
> > > <
> > https://github.com/php/php-src/blob/php-7.3.11/ext/dom/tests/not_well_formed.xml
> > >
> > >
> > > Regards,
> > > Christoph
> >
> >   Cool, thanks for the report Christoph !
> >
> > Daniel
> >
> > --
> > Daniel Veillard  | Red Hat Developers Tools
> > http://developer.redhat.com/
> > 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
> >

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Entering freeze for libxml2-2.9.10

2019-10-28 Thread Daniel Veillard via xml
On Wed, Oct 23, 2019 at 06:53:07PM +0200, Daniel Veillard via xml wrote:
>   Took a while but it's time to assemble a new release,
> I tagged it in git and pushed signed tarball and rpms to the
> usual place:
> 
>ftp://xmlsoft.org/libxml2/
> 
> I will try to make an rc2 during the week-end, and then we can
> roll up the release by mid next week.
> 
>  In the meantime please give it some testing,
> 
>thanks,
> 
> Daniel

  In the absence of feedback or changes since RC1, I am not pushing
an RC2 for libxml2-2.9.10, assume a final release for Wed or Thursday,

  in the meantime, please give it a try !

   Thanks

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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


[xml] Entering freeze for libxml2-2.9.10

2019-10-23 Thread Daniel Veillard via xml
  Took a while but it's time to assemble a new release,
I tagged it in git and pushed signed tarball and rpms to the
usual place:

   ftp://xmlsoft.org/libxml2/

I will try to make an rc2 during the week-end, and then we can
roll up the release by mid next week.

 In the meantime please give it some testing,

   thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] [PATCH] Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump

2019-08-23 Thread Daniel Veillard via xml
  ACK :-)


Daniel

On Thu, Jul 11, 2019 at 08:00:39PM +0200, Jan Pokorný via xml wrote:
> At least when merely public API is to be leveraged, one cannot use
> xmlBufCreate function that would otherwise be a clear fit, and relying
> on some invariants wrt. how some other struct fields will get
> initialized along the construction/filling such parent struct and
> (ab)using that instead does not appear clever, either.
> 
> Hence, instruct people what's the Right Thing for the moment, that is,
> make them use xmlNodeDumpOutput instead (together with likewise public
> xmlAllocOutputBuffer).
> 
> Going forward, it's questionable what do with xmlBuf* family of
> functions that are once public, since they, for any practical purpose,
> cannot be used by the library clients (that's how I've run into this).
> 
> Signed-off-by: Jan Pokorný 
> ---
> 
> Hello Daniel, Nick, and others,
> 
> I've run into a source of frustration based on an unset advice
> in the documentation that I hope to remove with this change.
> Or did I overlook something?  Thanks for pulling otherwise!
> 
> (Indeed, there could be substantially bigger cut, like possibly
> retargeting xmlBufCreate as public, etc. but no wonders if there's
> not much will for that once the status quo lasted so long...)
> 
> -- Jan (Poki)
> 
>  doc/libxml2-api.xml  | 2 +-
>  doc/libxml2-refs.xml | 6 +++---
>  xmlsave.c| 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
> index 9cf6c72e..ccba52f2 100644
> --- a/doc/libxml2-api.xml
> +++ b/doc/libxml2-api.xml
> @@ -11778,7 +11778,7 @@ Could we use @subtypes for this?'/>
>  
>  
>defined(LIBXML_OUTPUT_ENABLED)
> -  Dump an XML node, recursive behaviour,children are printed too. 
> Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 
> or xmlKeepBlanksDefault(0) was called Since this is using xmlBuffer 
> structures it is limited to 2GB and somehow deprecated, use xmlBufNodeDump() 
> instead.
> +  Dump an XML node, recursive behaviour,children are printed too. 
> Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 
> or xmlKeepBlanksDefault(0) was called. Since this is using xmlBuffer 
> structures it is limited to 2GB and somehow deprecated, use 
> xmlNodeDumpOutput() instead.
>
>
>
> diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml
> index 3fe0876f..3109bac4 100644
> --- a/doc/libxml2-refs.xml
> +++ b/doc/libxml2-refs.xml
> @@ -31120,9 +31120,6 @@
>  
>
>  
> -
> -  
> -
>  
>
>  
> @@ -31493,6 +31490,9 @@
>
>
>  
> +
> +  
> +
>  
>
>  
> diff --git a/xmlsave.c b/xmlsave.c
> index f7173ebb..bf805330 100644
> --- a/xmlsave.c
> +++ b/xmlsave.c
> @@ -2186,9 +2186,9 @@ xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr 
> doc,
>   *
>   * Dump an XML node, recursive behaviour,children are printed too.
>   * Note that @format = 1 provide node indenting only if xmlIndentTreeOutput 
> = 1
> - * or xmlKeepBlanksDefault(0) was called
> + * or xmlKeepBlanksDefault(0) was called.
>   * Since this is using xmlBuffer structures it is limited to 2GB and somehow
> - * deprecated, use xmlBufNodeDump() instead.
> + * deprecated, use xmlNodeDumpOutput() instead.
>   *
>   * Returns the number of bytes written to the buffer or -1 in case of error
>   */
> -- 
> 2.22.0
> 
> ___
> xml mailing list, project page  http://xmlsoft.org/
> xml@gnome.org
> https://mail.gnome.org/mailman/listinfo/xml

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Exponential running time in RELAX NG matching of optional attributes

2019-08-23 Thread Daniel Veillard via xml
On Mon, Jul 22, 2019 at 11:59:42AM +0200, Jan Pokorný via xml wrote:
> On 27/06/19 14:15 +0200, Nikolai Weibull via xml wrote:
> > The following RELAX NG schema requires exponential running time when
> > matching attributes (15 attributes is where my computer begins to
> > show the symptoms, this may vary with your set-up):
> > 
> > a.rng:
> > 
> > 
> > http://relaxng.org/ns/structure/1.0;>
> >   
> > 
> >   a
> >   
> >  > ns="">a
> >  > ns="">b
> >  > ns="">c
> >  > ns="">d
> >  > ns="">e
> >  > ns="">f
> >  > ns="">g
> >  > ns="">h
> >  > ns="">i
> >  > ns="">j
> >  > ns="">k
> >  > ns="">l
> >  > ns="">m
> >  > ns="">n
> >  > ns="">o
> >   
> > 
> >   
> > 
> > 
> > a.xml:
> > 
> > 
> >  > l="12" m="13" n="14" o="15"/>
> > 
> > % time xmllint --noout --relaxng a.rng a.xml
> > real: 3.175, user: 3.147, system: 0.014 (99%)
> > 
> > Changing the group to an interleave, that is,
> > 
> > b.rng:
> > 
> > 
> > http://relaxng.org/ns/structure/1.0;>
> >   
> > 
> >   a
> >   
> >  > ns="">a
> >  > ns="">b
> >  > ns="">c
> >  > ns="">d
> >  > ns="">e
> >  > ns="">f
> >  > ns="">g
> >  > ns="">h
> >  > ns="">i
> >  > ns="">j
> >  > ns="">k
> >  > ns="">l
> >  > ns="">m
> >  > ns="">n
> >  > ns="">o
> >   
> > 
> >   
> > 
> > 
> > gives
> > 
> > % time xmllint --noout --relaxng b.rng a.xml
> > real: 0.008, user: 0.003, system: 0.002 (54%)
> > 
> > Making the attributes required instead of optional also fixes the issue:
> > 
> > c.rng:
> > 
> > 
> > http://relaxng.org/ns/structure/1.0;>
> >   
> > 
> >   a
> >   
> > a
> > b
> > c
> > d
> > e
> > f
> > g
> > h
> > i
> > j
> > k
> > l
> > m
> > n
> > o
> >   
> > 
> >   
> > 
> > 
> > % time xmllint --noout --relaxng c.rng a.xml
> > real: 0.008, user: 0.003, system: 0.002 (55%)
> > 
> > The problem seems to be that xmlRelaxNGValidateDefinition keeps
> > adding states that I feel don’t need checking, but I can’t figure
> > out how to avoid this from happening.

  Hum, I'm way behind  sorry

yes that sounds like there is a graph generation issue, best is to compile
the regexp support with things like DEBUG_REGEXP_GRAPH enabled and trace down
with pencil and paper what kind of graph it generates. That's how most of that 
code
ended up being debugged 

> 
> I can only nod to your analysis, ran into similar observations
> in the past, and they were likewise XML attributes (that parameters to
> fence device instances boil down to) related:

> https://bugzilla.redhat.com/show_bug.cgi?id=1224378#c7
> 
> Callgrind proved to be a useful tool to get better quantitative numbers.

  yup but that's way down

> > Daniel, do you have any input on this?  I’d gladly work on fixing
> > this, but I feel that I need some guidance as to what’s going wrong
> > and perhaps also how to fix it.
> 
> Would be nice to get libxml's RelaxNG validation support closer
> to parity with jing (the only other freely available validator I am
> aware of that can be directly used for a peer comparison), for sure.

  well jing use an orthogonal approach, derivating the document graph directly
while libxml2 uses validation structure derivation instead (when it can't 
compile
down to a regexp). In that case it should be regexp based.
  The two will performs massively differently on different problems.

Daniel

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


-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Extremely small doubt in libxml2

2019-08-01 Thread Daniel Veillard via xml
On Wed, Jul 31, 2019 at 10:00:22PM +0530, Akash Opensource wrote:
> Can you please help on this. ??
> My guess is encoding in UTF-8
> 

  Can't remember, depending on which buffer it is encoding of byte flow may 
not be UTF-8 there. 
  All this is relatively tricky code, written 15-20 years ago, I suggest to
not touch it unless you have an issue with it !

Daniel

> On Sun, Jul 28, 2019, 4:31 PM Akash Opensource  wrote:
> 
> > Hi Veillard and Support Team,
> >
> > Thanks for the wonderful code of libxml2 written by you and the team.
> > It's a boon to software developers and teachers.
> >
> > I have a doubt regarding xmlParserInputBufferGrow() function in libxml2.
> > I checked all the latest version of libxml2, but I don't see a explanation
> > to a line len != 4.
> >
> > Also I searched everywhere that value never goes to 4.
> > Can you please help me in providing any info related to this, why it is 4 ?
> >
> > [image: image.png]
> >
> > Thanks & Regards,
> > _OpenSourceGuy
> >
> >
> > 
> >  I’m
> > protected online with Avast Free Antivirus. Get it here — it’s free
> > forever.
> > 
> > <#m_-1191387292809308158_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >



-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Installing libxml2 as an Os400 service program doesn't work anymore

2019-03-13 Thread Daniel Veillard via xml
On Wed, Mar 13, 2019 at 06:17:18PM +0100, Roberto Bizzozero via xml wrote:
> Hello, I tried to install the LIBXML2 and service program on a V7R3M0 IBMi
> machine, but it failed to compile it, basically for the 100 char limit of
> the source file but also for other problems concerning the OS400 version.
> 
> I fixed it in a branch I created, I attach the diff files, if you are
> interested.
> 
> Also, here it is the issue I've opened on the Gitlab repository:
> 
> https://gitlab.gnome.org/GNOME/libxml2/issues/48
> 
> Thanks,
> 
> Roberto.

  Hi Patrick,

since you authored the OS/400 configuration, could you have a look at
Roberto's pathes, they seems fine to me but it would be better if someone
using libxml2 on that systems could double check,

  thanks,

Daniel


-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Entering freeze for release of libxml2-2.9.9

2019-01-04 Thread Daniel Veillard via xml
  Hi Mike,

On Thu, Dec 13, 2018 at 04:37:53PM -0500, Mike Dalessio wrote:
> Hi Daniel,
> 
> I'm curious if you have an updated release schedule for 2.9.9 final?
> 
> Thanks much for coordinating this release.
> 
> -m

  Sorry it's out now, between work, Xmas with familly haeading to my place
and a short trip, it got delayed,

Daniel

> 
> On Thu, Nov 29, 2018 at 4:58 PM Daniel Veillard via xml 
> wrote:
> 
> >   I pushed RC2 in git and pushed signed tarball and rpms to the usual
> > place:
> >
> >ftp://xmlsoft.org/libxml2
> >
> > we have a couple of issues which were raised against rc1 and not completely
> > solved, depending on how we resolve those and if no new ones pop-up I
> > will either push an rc3 around Monday or proceed to 2.9.9 release.
> >
> >   So please ocntinue to give it some testing,
> >
> >thanks everybody,
> >
> > Daniel
> >
> > --
> > Daniel Veillard  | Red Hat Developers Tools
> > http://developer.redhat.com/
> > 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
> >

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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


[xml] Release of libxml2-2.9.9

2019-01-03 Thread Daniel Veillard via xml
  Happy New Year,

 the release is finally out, I just tagged it in git and pushed signed
tarball and rpms to the usual place:

  ftp://xmlsoft.org/libxml2/

this is a mixed release, it includes security fixes, bug fixes as well
as improvement and portability fixes for cygwin:


Security:
- CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick 
Wellnhofer)
- CVE-2018-14404 Fix nullptr deref with XPath logic ops (Nick Wellnhofer)

Documentation:
- reader: Fix documentation comment (Mohammed Sadiq)

Portability:
- Fix MSVC build with lzma (Nick Wellnhofer)
- Variables need 'extern' in static lib on Cygwin (Michael Haubenwallner)
- Really declare dllexport/dllimport for Cygwin (Michael Haubenwallner)
- Merge branch 'patch-2' into 'master' (Nick Wellnhofer)
- Change dir to $THEDIR after ACLOCAL_PATH check autoreconf creates aclocal.m4 
in $srcdir (Vitaly Buka)
- Improve error message if pkg.m4 couldn't be found (Nick Wellnhofer)
- NaN and Inf fixes for pre-C99 compilers (Nick Wellnhofer)

Bug Fixes:
- Revert "Support xmlTextReaderNextSibling w/o preparsed doc" (Nick Wellnhofer)
- Fix building relative URIs (Thomas Holder)
- Problem with data in interleave in RelaxNG validation (Nikolai Weibull)
- Fix memory leak in xmlSwitchInputEncodingInt error path (Nick Wellnhofer)
- Set doc on element obtained from freeElems (Nick Wellnhofer)
- Fix HTML serialization with UTF-8 encoding (Nick Wellnhofer)
- Use actual doc in xmlTextReaderRead*Xml (Nick Wellnhofer)
- Unlink node before freeing it in xmlSAX2StartElement (Nick Wellnhofer)
- Check return value of nodePush in xmlSAX2StartElement (Nick Wellnhofer)
- Free input buffer in xmlHaltParser (Nick Wellnhofer)
- Reset HTML parser input pointers on encoding failure (Nick Wellnhofer)
- Don't run icu_parse_test if EUC-JP is unsupported (Nick Wellnhofer)
- Fix xmlSchemaValidCtxtPtr reuse memory leak (Greg Hildstrom)
- Fix xmlTextReaderNext with preparsed document (Felix Bünemann)
- Remove stray character from comment (Nick Wellnhofer)
- Remove a misleading line from xmlCharEncOutput (Andrey Bienkowski)
- HTML noscript should not close p (Daniel Veillard)
- Don't change context node in xmlXPathRoot (Nick Wellnhofer)
- Stop using XPATH_OP_RESET (Nick Wellnhofer)
- Revert "Change calls to xmlCharEncInput to set flush false" (Nick Wellnhofer)

Improvements:
- Fix "Problem with data in interleave in RelaxNG validation" (Nikolai Weibull)
- cleanup: remove some unreachable code (Thomas Holder)
- add --relative to testURI (Thomas Holder)
- Remove redefined starts and defines inside include elements (Nikolai Weibull)
- Allow choice within choice in nameClass in RELAX NG (Nikolai Weibull)
- Look inside divs for starts and defines inside include (Nikolai Weibull)
- Add compile and libxml2-config.cmake to .gitignore (Nikolai Weibull)
- Stop using doc-charset outside parser code (Nick Wellnhofer)
- Add newlines to 'xmllint --xpath' output (Nick Wellnhofer)
- Don't include SAX.h from globals.h (Nick Wellnhofer)
- Support xmlTextReaderNextSibling w/o preparsed doc (Felix Bünemann)
- Don't instruct user to run make when autogen.sh failed (林博仁(Buo-ren Lin))
- Run Travis ASan tests with "sudo: required" (Nick Wellnhofer)
- Improve restoring of context size and position (Nick Wellnhofer)
- Simplify and harden nodeset filtering (Nick Wellnhofer)
- Avoid unnecessary backups of the context node (Nick Wellnhofer)
- Fix inconsistency in xmlXPathIsInf (Nick Wellnhofer)

  Thanks everybody for your help for this release and especially Nick who
did most of the work on patches and integration !

   Enjoy the new release,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Entering freeze for release of libxml2-2.9.9

2018-11-29 Thread Daniel Veillard via xml
  I pushed RC2 in git and pushed signed tarball and rpms to the usual
place:

   ftp://xmlsoft.org/libxml2

we have a couple of issues which were raised against rc1 and not completely
solved, depending on how we resolve those and if no new ones pop-up I
will either push an rc3 around Monday or proceed to 2.9.9 release.

  So please ocntinue to give it some testing,

   thanks everybody,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Entering freeze for release of libxml2-2.9.9

2018-11-29 Thread Daniel Veillard via xml
On Fri, Nov 23, 2018 at 11:12:13PM +0100, Nick Wellnhofer wrote:
> On 23/11/2018 22:38, Nick Wellnhofer wrote:
> > On 23/11/2018 20:51, Shlomi Fish wrote:
> > > I am getting a failure in one of the tests of
> > > https://github.com/shlomif/perl-XML-LibXML - it works fine with 2.9.8:
> > 
> > Can you check if it's caused by one of the following commits?
> 
> Nevermind, it's this commit:
> 
> https://gitlab.gnome.org/GNOME/libxml2/commit/bfec41b3de1cbd35e547b57c80ae3a5101f8891c
> 
> It seems that XML::LibXML implements its own workaround for
> xmlTextReaderNextSibling only being supported on preparsed documents:
> 
> https://github.com/shlomif/perl-XML-LibXML/blob/master/LibXML.xs#L8667
> 
> The function now claims to work without preparsed documents, so the
> workaround isn't used. But apparently there's problem with the commit. I'm
> CC'ing the author. If we can't get this fixed, let's revert.

  Nick,

I let you double check this post RC2, we can either delay or just revert,
tell me what you think,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Entering freeze for release of libxml2-2.9.9

2018-11-29 Thread Daniel Veillard via xml
On Mon, Nov 26, 2018 at 11:48:37AM +0100, Nikolai Weibull via xml wrote:
> Hi!
> 
> Stefan Behnel, 2018-11-25 15:37:
> 
> > Nikolai Weibull schrieb am 24.11.18 um 00:12:
> 
> > > Yes, it seems that my patch for data in interleaves was added and
> > > this may be the cause of these issues. The regression tests didn’t
> > > display them, so this is something different. Could we perhaps get a
> > > minimal test that breaks?
> 
> > Here is what I could come up with so far. Since it's heavily stripped
> > down,
> > it probably isn't very reasonable anymore. The original schema is here:
> 
> Thank you!  As far as my tests go, with the patches that I’ve provided, this
> validates without any issues.  I really hope we can get my patches from the
> merge request into master so that this issue can be fixed.

  TBH it's weird it fails to validate for me with 2.9.8, with 2.9.9-rc1 and
with 2.9.9-rc1 with the data interleave patch reverted ...
I'm getting quite confused and starting to wonder if the schema I got
from github is correct (github interface serves me first ahn html page,
then I have to guess to use raw, to dwoload that and pray that it is actually
the data one is supposed to use.

---
thinkpad2:~/XML -> ./xmllint --relaxng iso-schematron.rng fail_to_validate.xml 

http://purl.oclc.org/dsdl/schematron;>
Open Model

 BBB element is not present
 CCC element is not present


fail_to_validate.xml:2: element title: Relax-NG validity error : Expecting 
element ns, got title
fail_to_validate.xml:1: element schema: Relax-NG validity error : Expecting an 
element ns, got nothing
fail_to_validate.xml:2: element title: Relax-NG validity error : Expecting 
element p, got title
fail_to_validate.xml:1: element schema: Relax-NG validity error : Expecting an 
element p, got nothing
fail_to_validate.xml:2: element title: Relax-NG validity error : Expecting 
element let, got title
fail_to_validate.xml:3: element rule: Relax-NG validity error : Invalid 
sequence in interleave
fail_to_validate.xml:3: element rule: Relax-NG validity error : Element schema 
failed to validate content
fail_to_validate.xml fails to validate
thinkpad2:~/XML -> 
---

  the "email patch" from gitlab seems to get me back to some sanity there,
it still makes it a mess to review and apply cleanly.

  The 4 patches looks sensible, seems to not introduce regression in existing
tests, the behaviour seems to be exactly the same with Stefan's tests so
I will assume that's unrelated or I didn't get the tests correctly.
I will push them to RC2 and if Stephan still has troubles with it can you please
send mail to the error case as attachments.

  thanks !

Daniel
   
-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Entering freeze for release of libxml2-2.9.9

2018-11-24 Thread Daniel Veillard via xml
On Sat, Nov 24, 2018 at 12:14:06AM +0100, Nikolai Weibull wrote:
> Hi!
> 
> Daniel Veillard via xml, 2018-11-22 18:32:
> 
> >   I have just tagged the Release Candidate 1 in git and pushed a
> > signed
> > tarball and signed rpms to the usual place:
> 
> Could we please get merge request 10 into
> 
> https://gitlab.gnome.org/GNOME/libxml2/merge_requests/10

 Okay that looks different from the other patch for interleaves I applied
earlier. Could you provide a little bit more description, seems it avoid
creating a choice child of a choice element among other things, correct ?

> this release?  It fixes various issues with the RELAX NG code and it even
> has tests!

 I have never been fond of the github interface and it seems gitlab is kind
of mimicking it, In general I will fetch the raw patch, make sure this applies
to master and make sure all commits are linear (c.f. from a gitk viewpoint).
 Nick there seems to be 7 merge requests, maybe we need to go though those
before I push an RC2,

   thanks for raising this Nikolai, and for your contributions :-)

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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


[xml] Entering freeze for release of libxml2-2.9.9

2018-11-22 Thread Daniel Veillard via xml
  I have just tagged the Release Candidate 1 in git and pushed a signed
tarball and signed rpms to the usual place:

  ftp://xmlsoft.org/libxml2/

(also available as http://xmlsoft.org/download/)

Please give it some testing, if we need to make changes I will likely push
an RC2 mid next week, and if everything goes well I will push 2.9.9 final
end of next week.
It would be good to have people who uses it though PHP, Ruby, Java, to verify
that this doesn't introduce problems in those stacks.

  thanks in advance,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Problem with data in interleave in RELAX NG validation

2018-11-22 Thread Daniel Veillard via xml
On Sun, Oct 14, 2018 at 09:02:29PM +0200, Nikolai Weibull via xml wrote:
> Hi!
> 
> OK, I managed to decode it somewhat.  The issue seems to be that we build
> groups of what can be matched by the interleave, but that these groups don’t
> include data, list, and value elements, only element and text elements.

  this may be an oversight when going from the RNG data model to what
is the libxml2 insternal structures reflecting this. Among the mismatches
are also TEXT vs CDATA which are separated in libxml2 model and unified as
simple text nodes in the RelaxNG one.

> This patch extends xmlRelaxNGGetElements so that it can return these
> elements for us in xmlRelaxNGComputeInterleaves.  Then we make sure to
> updatexmlRelaxNGNodeMatchesList as well so that it accepts the correct
> types.

  That sounds reasonable

> The testsuite passes and my test below does as well.
> 
> I’m a bit surprised that interleaves simply wouldn’t allow for data, list,
> and value elements previously, so I’m wondering if there was a reason for
> the code to be the way it was and that the fix should be placed somewhere
> else or if it was simply an oversight.  Either way, this does seem to be the

  I honnestly can't remember !

> correct solution. If someone could confirm that this solution is what we’re
> looking for, I’ll add some proper test cases and apply another merge request
> on git.gnome.org.

  This indeed seems to be working, would you mind sending patches to add
regression tests for this, that way I can incorporate those into an upcoming
release.

   thanks a lot !

Daniel

> Best regards,
>  Nikolai
> 
> ---
> relaxng.c | 16 
> 1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/relaxng.c b/relaxng.c
> index 8306e546..3ed03ff4 100644
> --- a/relaxng.c
> +++ b/relaxng.c
> @@ -3993,7 +3993,7 @@ xmlRelaxNGGenerateAttributes(xmlRelaxNGParserCtxtPtr
> ctxt,
>  * xmlRelaxNGGetElements:
>  * @ctxt:  a Relax-NG parser context
>  * @def:  the definition definition
> - * @eora:  gather elements (0) or attributes (1)
> + * @eora:  gather elements (0), attributes (1) or elements and text (2)
>  *
>  * Compute the list of top elements a definition can generate
>  *
> @@ -4019,7 +4019,12 @@ xmlRelaxNGGetElements(xmlRelaxNGParserCtxtPtr ctxt,
> while (cur != NULL) {
> if (((eora == 0) && ((cur->type == XML_RELAXNG_ELEMENT) ||
>  (cur->type == XML_RELAXNG_TEXT))) ||
> -((eora == 1) && (cur->type ==
> XML_RELAXNG_ATTRIBUTE))) {
> +((eora == 1) && (cur->type == XML_RELAXNG_ATTRIBUTE)) ||
> +((eora == 2) && ((cur->type == XML_RELAXNG_DATATYPE) ||
> + (cur->type == XML_RELAXNG_ELEMENT) ||
> + (cur->type == XML_RELAXNG_LIST) ||
> + (cur->type == XML_RELAXNG_TEXT) ||
> + (cur->type == XML_RELAXNG_VALUE {
> if (ret == NULL) {
> max = 10;
> ret = (xmlRelaxNGDefinePtr *)
> @@ -4374,7 +4379,7 @@ xmlRelaxNGComputeInterleaves(void *payload, void
> *data,
> if (cur->type == XML_RELAXNG_TEXT)
> is_mixed++;
> groups[nbgroups]->rule = cur;
> -groups[nbgroups]->defs = xmlRelaxNGGetElements(ctxt, cur,
> 0);
> +groups[nbgroups]->defs = xmlRelaxNGGetElements(ctxt, cur, 2);
> groups[nbgroups]->attrs = xmlRelaxNGGetElements(ctxt, cur,
> 1);
> nbgroups++;
> cur = cur->next;
> @@ -9280,7 +9285,10 @@ xmlRelaxNGNodeMatchesList(xmlNodePtr node,
> xmlRelaxNGDefinePtr * list)
> return (1);
> } else if (((node->type == XML_TEXT_NODE) ||
> (node->type == XML_CDATA_SECTION_NODE)) &&
> -   (cur->type == XML_RELAXNG_TEXT)) {
> +   ((cur->type == XML_RELAXNG_DATATYPE) ||
> +(cur->type == XML_RELAXNG_LIST) ||
> +(cur->type == XML_RELAXNG_TEXT) ||
> +(cur->type == XML_RELAXNG_VALUE))) {
> return (1);
> }
> cur = list[i++];
> -- 
> 2.19.1
> 
> 
> Nikolai Weibull, 2018-10-13 00:23:
> 
> > Hi!
> > 
> > This remains unfixed.  I have absolutely no idea what’s going on in
> > the interleave validation code.  Daniel, could you please put together
> > some minor documentation on how the interleave validation code works?
> > It’s very complicated.
> > 
> > Thank you,
> > 
> >  Nikolai
> > 
> > Nikolai Weibull, 2018-09-09 21:26:
> > 
> > > Hi!
> > > 
> > > Given the following input RELAX NG grammar:
> > > 
> > > http://relaxng.org/ns/structure/1.0;
> > > datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes;>
> > >  
> > >
> > >  
> > >
> > >
> > >  
> > >
> > >  
> > > 
> > > 
> > > and the following input document a.xml:
> > > 
> > > c
> > > 
> > > xmllint reports:
> > > 
> > > a.xml:1: element a: Relax-NG validity error : 

Re: [xml] Problem with data in interleave in RELAX NG validation

2018-11-22 Thread Daniel Veillard via xml
On Sat, Oct 13, 2018 at 12:23:09AM +0200, Nikolai Weibull via xml wrote:
> Hi!
> 
> This remains unfixed.  I have absolutely no idea what’s going on in the
> interleave validation code.  Daniel, could you please put together some
> minor documentation on how the interleave validation code works?  It’s very
> complicated.
> 
> Thank you,
> 
>  Nikolai

  Hi Nikolai,

I must admit  I don't think I really touched that code for 10 years, it's a bit
hard :-) ... Some of the points behind the RNG implementation of libxml2
are:

  1/ I didn't used the derivation method suggested by James Clark, the problem
 is that if you want to validate an extremely large document, you end up
 building potentially an extremely large in memory derivation data
  2/ where possible, I switch the generated RNG data structure to a normal
 regexp and then use that to validate the subtree, reuses existing
 code, goes way faster due to regexp compilation, but it's certainly
 confusing when trying to understand how it all work !
  3/ based on the above I build streaming RNG validation when people want
 do do RNG validation without full in-memory tree 

so yes deciphering that code both from compilation and runtime is... hard
sorry about that :-)

There is also a known issue with validating interleaves of interleaves, I have
a mess there, it's something on the back of my mind for a decade but
surprizingly few people seems to hit it (or they just used Jing !)

Daniel

> Nikolai Weibull, 2018-09-09 21:26:
> 
> > Hi!
> > 
> > Given the following input RELAX NG grammar:
> > 
> > http://relaxng.org/ns/structure/1.0;
> > datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes;>
> >  
> >
> >  
> >
> >
> >  
> >
> >  
> > 
> > 
> > and the following input document a.xml:
> > 
> > c
> > 
> > xmllint reports:
> > 
> > a.xml:1: element a: Relax-NG validity error : Element a has extra
> > content: text
> > a.xml fails to validate
> > 
> > Changing the interleave to a group solves the issue, so the problem is
> > with how interleaves are validated.
> > 
> > I looked at xmlRelaxNGValidateInterleave() and I sadly have no idea
> > what’s going on.  Please point me in the right direction and I’ll
> > gladly write a patch.
> > 
> >  Nikolai
> 
> ___
> xml mailing list, project page  http://xmlsoft.org/
> xml@gnome.org
> https://mail.gnome.org/mailman/listinfo/xml

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Serialization of documents without encoding

2018-11-15 Thread Daniel Veillard via xml
On Thu, Sep 27, 2018 at 02:22:55PM +0200, Nick Wellnhofer wrote:
> On 27/09/2018 10:59, Roumen Petrov wrote:
> > Let consider case as "file" mode.
> 
> > Let consider case as "stream" code.
> 
> I'm not only talking about xmllint but the serialization API (xmlSave*,
> xmlNodeDump*) in general.
> 
> > Now about above test samples . if content is stored in file xmllint
> > works fine with encoding(=codeset=charset).
> > 
> > $ cat test-noencoding.xml
> > Käse
> 
> No, it doesn't work fine:
> 
> $ xmllint test-noencoding.xml
> 
> Kse
> 
> > (2) Next a-umlaut character is encoded in hexadecimal. Minor
> > inconsistency between "stream" and "file" mode.
> 
> As shown above, "file" mode can also produce unwanted numeric character
> references.
> 
> > (3) Problem is that in "scream" mode xmllint application ignores value
> > of encode argument:
> > $ echo 'Käse' | xmllint - --encode UTF-8
> > 
> > Kse
> 
> Right, there is an inconsistency in xmllint. But that's not my point.
> 
> >  From my point of view (1) and (2) are minor non-important issues. Only
> > (3) could be fixed with low priority.
> 
> Unneeded numeric character references in UTF-8 output are not a minor issue.
> If you're working with non-Latin scripts, it makes serialized XML files
> unreadable for humans and blows up the file size.

  Not breaking a decade os programs who may be expecting that behaviour sounds
far more important to me honnestly.

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Serialization of documents without encoding

2018-11-15 Thread Daniel Veillard via xml
On Tue, Sep 25, 2018 at 01:19:51PM +0200, Nick Wellnhofer wrote:
> libxml2 serializes documents without an encoding declaration differently
> than documents with an explicit UTF-8 encoding:
> 
> $ echo 'Käse' |xmllint -
> 
> Kse
> 
> $ echo 'Käse' |xmllint -
> 
> Käse
> 
> Since the encoding should default to UTF-8, can anyone explain why this
> decision was made?

  Because using the codepoint is part of the core XML spec, there is no
way this can be screwed up when people are doing manipulations like
cutting parts of an XML document, pasting it somewhere else where the
context may be differemt. So if you don't explicitely ask for an encoding
libxml2 will deliver the most resilient serialization possible and that
means using codepoint, except where not possible (and then specifics about
attributes serialization, etc ...)
  Please keep it that way, you have no idea what people may have done
and unless this really fixes an issue I would be very reluctant to change
this behaviour.

 thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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] Serialization of documents without encoding

2018-11-15 Thread Daniel Veillard via xml
 Sorry I ddin't watch my xml folder for a while ... a bit busy


On Sat, Oct 06, 2018 at 07:32:00PM +0300, Roumen Petrov wrote:
> Hi Nick,
> 
> Nick Wellnhofer wrote:
> > On 25/09/2018 14:36, Nick Wellnhofer wrote:
> > > The whole situation is a mess. I'd love to change the code so that
> > > non-ASCII chars are always encoded as UTF-8, but I'm scared to break
> > > things.
> 
> Long time ago I did some test with html -
> http://roumenpetrov.info/tests/charset/ .
> 
> The case is quite similar - encoding could be defined externally in HTTP
> header

  Except it usually doesn't work so tons of workarounds need to be applied.

> Content-Type: text/html; charset=ISO8859-5
> ...
> and in the same time in HTML header (internal)
> ...
> 
> 
> 
>   
> 
> 
> ...
> If I remember well (10-15 ago) Internet Explorer prefer internal while other
> browsers prefer external encoding.

  yup it was a mess. I heard horror stories from various parties
implementing even XML support in browsers.

> 
> I create similar test to check what is situation with xml
> http://roumenpetrov.info/tests/charset/index-xml.html and dis some tests (
> ( browsers - Firefox, Opera, Chromium, Konqueror ).
> 
> The test show that all(1) browsers could read xml in following case :
> - HTTP header without charset, i.e. Content-Type: text/html;
> - XML prolog with encoding, i.e. 
> 
> Without encoding in prolog only file in UTF-8 codeset could be read (no
> surprise).
> 
> Behavior of some browsers depend from file suffix . This is reason to test
> to use  .xml and .none suffixes.
> 
> Mix between charset and encoding fail as expected exept in case
> charset=iso8859-1 where some browsers show properly content.
> 
> 
> Based on tests I think that switch to UTF-8 encoded content by default is
> good to have encoding in prolog. It is less risky.
> 
> 
> > This is the change I have in mind:
> > 
> > https://github.com/nwellnhof/libxml2/commit/53551ec2f6a2ef03bfcfb6d73b6fd18dc70ba15d
> 
> Ok to remove "Special escaping routines" but patch shows that in regression
> tests prolog remains as "".
> I'm not sure that such code modification is save.
> 

  That kind of things can backfire *very* easilly.
What is the problem we are trying to solve.
Some people are likely to expect the behaviour of going back to codepoint
when no encoding is specified outside of the ascii range.

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
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