Re: [xml] [PATCH 0/2] uri: Don't spoil addresses when formatting them

2014-10-03 Thread Daniel Veillard
On Fri, Oct 03, 2014 at 10:44:52PM +0200, Martin Kletzander wrote:
> On Fri, Oct 03, 2014 at 06:26:56PM +0800, Daniel Veillard wrote:
> [...]
> >With that patch libvirt test suite passes again except one case:
> >
> >115) QEMU XML-2-ARGV disk-drive-network-gluster
> >...
> >Offset 295
> >Expect [//V]
> >Actual [V]
> > ...
> >FAILED
> >
> > I expect that to be a bug in the way the gluster/rdb driver builds
> >an URI since all other URI building work in a compatible fashion,
> >this need to be examined, but I don't consider this a libxml2 bug at
> >this point,
> >
> 
> Yes, I pushed a fix for this in libvirt:
> 
> commit 8f17d0eaae7ee2fa3e214b79b188fc14ed5aa1eb
> Author: Martin Kletzander 
> Date:   Fri Oct 3 18:27:01 2014 +0200
> 
>util: Prepare URI formatting for libxml2 >= 2.9.2
> 
> Thanks,

  Ah I see it !

   thanks :-) !

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] [PATCH 0/2] uri: Don't spoil addresses when formatting them

2014-10-03 Thread Martin Kletzander

On Fri, Oct 03, 2014 at 06:26:56PM +0800, Daniel Veillard wrote:
[...]

With that patch libvirt test suite passes again except one case:

115) QEMU XML-2-ARGV disk-drive-network-gluster
...
Offset 295
Expect [//V]
Actual [V]
 ...
FAILED

 I expect that to be a bug in the way the gluster/rdb driver builds
an URI since all other URI building work in a compatible fashion,
this need to be examined, but I don't consider this a libxml2 bug at
this point,



Yes, I pushed a fix for this in libvirt:

commit 8f17d0eaae7ee2fa3e214b79b188fc14ed5aa1eb
Author: Martin Kletzander 
Date:   Fri Oct 3 18:27:01 2014 +0200

   util: Prepare URI formatting for libxml2 >= 2.9.2

Thanks,
Martin


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


Re: [xml] libxslt test suite broken by recent libxml2 commit

2014-10-03 Thread Nick Wellnhofer
On Oct 3, 2014, at 11:11 , Daniel Veillard  wrote:

>> The other issue in the libxslt test suite is that the HTML docbook tests 
>> actually create documents with duplicate “name” attributes which are treated 
>> as IDs in HTML documents. This might be fixed in a newer version of 
>> docbook-xsl. But the easiest fix for now is to simply add the warning 
>> messages to the expected test output.
> 
> Yes, libxml2 ought to raise the error (non-fatal obviously), and I
> agree that's a case where the test data need to be modified to cope with
> it,

I successfully updated the libxslt test suite to the current docbook-xsl 
version 1.78.1 from 1.40 and this indeed fixes the problem. But the resulting 
commit is quite large:

551 files changed, 207340 insertions(+), 59510 deletions(-)

The libxslt tarball would grow by about 1 MB. Do you think this is acceptable?

Nick

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


Re: [xml] Shooting for a release of 2.9.2 within two weeks

2014-10-03 Thread Patrick Monnerat
Daniel Veillard wrote:

> I think the majority of those got applied, I fetched your commits:

I can see them at https://git.gnome.org/browse/libxml2

The repository at https://github.com/monnerat/libxml2 is a clone of
upstream git://git.gnome.org/libxml2 with master untouched and an
additional os400 branch with 14 commits introducing all the os400 stuff.

> Applying: For OS/400 we can't use NULL comparison for iconv_t
> Applying: Adds the os400 directory to dist for tarballs thinkpad:~/XML
->

Obviously, you started from the big patch I sent you last year (there is
no published branch for it on git.gnome.org).
If you forget this local branch and use the github one, it should be ok
with all your remark. The big patch has been split into several smaller
commits. In addition, some bugs/additions have been applied since then.
 
>  only those 2 remaining patches seems to not have been commited then,
the second one is a no brainer, on the other hand why use -1 for the
cast to (iconv_t) when would could use 0 (as NULL) was used previously,
any reason to not use
>   (iconv_t) 0
> instead of
>   (iconv_t) -1
> that would be way closer to the original, and less likely to raise an
unwanted ABI issue.

In the github branch, os400 sticks with your iconv_t use.

Starting in a github.com/monnerat/libxml2 fresh clone (os400 branch),
you should get:
$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: OS400: create architecture directory. Implement dlfcn
emulation.
Applying: doc/news.html: small update to avoid line join while
generating NEWS.
Applying: OS400: iconv functions compatibility wrappers and table
builder.
Applying: OS400: Easy character transcoding support
Applying: OS400: UTF8<-->EBCDIC wrappers for system and external library
calls
Applying: OS400: implement some macros as functions for ILE/RPG language
support (that as no macros).
Applying: OS400: ILE RPG language header files.
Applying: OS400: Add compilation scripts.
Applying: OS400: Add README: compilation directives and OS/400 specific
stuff.
Applying: OS400: include in distribution tarball.
Applying: OS400: implement XPath macros as procedures for ILE/RPG
support.
Applying: OS400: use C macros to implement equivalent RPG support
procedures.
Applying: OS400: Add some more C macros equivalent procedures.
Applying: os400: make-src.sh: create physical file with target CCSID

Sorry for misunderstanding.
Cheers,
Patrick
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange 0x0a char popping in generated XML

2014-10-03 Thread Daniel Veillard
On Fri, Oct 03, 2014 at 02:38:21PM +0200, Jean-Philippe Jacoupy wrote:
> The protocol, that use xml, that I have to work with refuses those.
> 
> They don't use the signing method defined in the XML because they specified
> their own method for certification.

  then it's not an XML compliant protocol, that's pretty bad design,
would you name the name of that protocol so that some public shame
can be casted on those who pushed for it ?

> The point is when you use xmlTextWriterSetIndent(writer, 0)
> before EVEN starting your document, I expect to get no indentation as
> stated here
> 
> ( http://xmlsoft.org/html/libxml-xmlwriter.html#xmlTextWriterSetIndent )
> 
> The first '\n' is indentation.
> 
> I modified the lib, but still reporting something that seems wrong for me.
> You'll find the patch as attachment and below.

  Sorry I won't change that behaviour. This will break people expecting
those for example in regression tests.
  indent is about adding those space in significant content it's
actually not the default, what you are doing is changing part where
it's not supposed to be significant.

  See for example the differences on xmllint with --pretty
for the value of 0 (no change), 1 (change adding significant content)
and 2 (change adding non significant content)

> --- libxml2-2.7.2/xmlwriter.cTue Mar 11 23:54:05 2008
> +++ libxml2-2.7.2/xmlwriter.cFri Aug 29 16:38:31 2014
> @@ -614,7 +614,12 @@
>  sum += count;
>  }
> 
> -count = xmlOutputBufferWriteString(writer->out, "?>\n");
> +if (writer->indent) {
> +count = xmlOutputBufferWriteString(writer->out, "?>\n");
> +}
> +else {
> +count = xmlOutputBufferWriteString(writer->out, "?>");
> +}
>  if (count < 0)
>  return -1;
>  sum += count;
> 
> As for the other one I remove it inside my code.

  The writer might be able to save without the XMLDecl which would could
then add by yourself without that line feed

Daniel
> 
> On Fri, Oct 3, 2014 at 1:11 PM, Daniel Veillard  wrote:
> 
> > On Fri, Oct 03, 2014 at 11:15:30AM +0200, Jean-Philippe Jacoupy wrote:
> > > On Fri, Oct 3, 2014 at 10:56 AM, Daniel Veillard 
> > > wrote:
> > >
> > > > On Tue, Aug 26, 2014 at 12:30:01PM +, Jean-Philippe Jacoupy wrote:
> > > > > Hello,
> > > > >
> > > > > I'm using libxml2 and I have a strange behaviour.
> > > > >
> > > > > I'm creating a full document in memory (using xmlTextWriter with a
> > > > xmlBuffer).
> > > > >
> > > > > I have called xmlTextWriterSetIndent with 0 as parameter.
> > > > >
> > > > > Whenever I get the buffer content (once I have called
> > > > > xmlTextWriterEndDocument) I get strange 0x0a inserted:
> > > > >  - 1 after the xml header
> > > > >  - 1 after the end of the xml document
> > > > >
> > > >
> > > >   It's not strange, that a new line character, which is present
> > > > as non-significant white space and will be ignored by XML parsers
> > > > and hence the whole tool chain consuming the output.
> > > >
> > > > Daniel
> > > >
> > > >
> > > Thanks for your response Daniel,
> > >
> > > But I still think the presence of those \n is bogus.
> > > Even if the XML parser will ignore the \n at reading (which is OK),
> > > when you have to cypher the document, the extras '\n' changes the result.
> > >
> > > Both of them prevent to generate a linearized xml. And that's the point
> > of
> > > this report.
> > >
> > > I mean this isn't a linearized xml:
> > >
> > > \n > > />\n
> > >
> > > Whereas this is a linearized xml:
> > >
> > >  > > />
> >
> >   If you want to sign the output, the is a canonical format and you
> > should use that. Libxml2 supports it !
> >
> > Considering "linearized" that's severely bogus you mean you have
> > recipient who won't parse anything with a line feed in it ?
> > Where did that definition come from ? What happen if one of you data
> > field has a content with a \n inside ? *That* is the the broken part.
> >
> > That's not an libxml2 issue , XML is here as a spec to define
> > interoperability, there is a number of place where that interop is
> > guaranteed even if you reformat the document, and there is equivalence
> > at the XML Infoset level. The two added \n are in those spaces.
> >
> > Daniel
> >
> > >
> > >
> > > > > I'm under Windows compiling with VS2008 against LibXML2 version 2.7.2
> > > > >
> > > > > PS:
> > > > > - As I searched the code of the libxml2, at the end of the
> > > > > xmlTextWriterStartDocument function I have found this:
> > > > >
> > > > > count = xmlOutputBufferWriteString(writer->out, "?>\n"); (L. 617)
> > > > >
> > > > > Shouldn't the '\n' be prefixed by a if (writer->indent) ?
> > > > >
> > > > >  - Found the other one in xmlTextWriterEndDocument I have found:
> > > > >
> > > > > if (!writer->indent) { (L. 701)
> > > > >
> > > > > instead of
> > > > >
> > > > > if (writer->indent) {
> > > > >
> > > > > as done in all the file.
> > > > >
> > > > > 

Re: [xml] Shooting for a release of 2.9.2 within two weeks

2014-10-03 Thread Daniel Veillard
On Fri, Oct 03, 2014 at 12:44:28PM +0200, Patrick Monnerat wrote:
> Hi Daniel,

  Hi Patrick,

> Would it be possible to merge the os400 subdirectory (os400 branch)?
> Your remarks have been taken into account as noted in my e-mail to the
> list of March 4, 2014.
> 
> https://github.com/monnerat/libxml2/tree/os400
> 
> Commits:
> 39354a70eb9290118aa401453916b6f58e313615
> f635e88460043fa02f852d3fc5ce829f34b44c44
> f8d8770c689ff8b3e5866884f1a08c4c47572574
> 961b595784d36e336ef7a87268d2e38e543bb6ca
> 624f6820a6e517152c82c93bd50e434853d1f4c9
> 4d2496f185e2ac9c5611e951e7dabab6dcc1b61d
> b7d7553cde3459aa2f3bce88a4ad9a64b32e048d
> 1c48f14f39ae879fa53618729e9255e4510c57dc
> 49b2b51fd64dc3a254c52f2bd7b67af738732303
> ff48b67bcbb03bfb52c06fe85a56a9a1ae9332e7
> eadbe4457adc9df4ad58f4493d19beaee85d1f15
> ae80c444228d4458ced8ec9c842959e5066438ab
> c316a29b2e7fd56b3e5fbede70be0b0691ba71cf
> cfa5e68c765a8de5163047b18f55b40a1dac5c23

  I think the majority of those got applied, I fetched your commits:

thinkpad:~/XML -> git checkout as400
error: pathspec 'as400' did not match any file(s) known to git.
thinkpad:~/XML -> git checkout as400/as400
error: pathspec 'as400/as400' did not match any file(s) known to git.
thinkpad:~/XML -> git checkout os400
Switched to branch 'os400'
thinkpad:~/XML -> git rebase master
First, rewinding head to replay your work on top of it...
Applying: For OS/400 we can't use NULL comparison for iconv_t
Applying: Adds the os400 directory to dist for tarballs
thinkpad:~/XML ->

  only those 2 remaining patches seems to not have been
commited then, the second one is a no brainer, on the other hand
why use -1 for the cast to (iconv_t) when would could use 0 (as NULL)
was used previously, any reason to not use
   (iconv_t) 0
instead of
   (iconv_t) -1
that would be way closer to the original, and less likely to
raise an unwanted ABI issue.

  thanks

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] Shooting for a release of 2.9.2 within two weeks

2014-10-03 Thread Patrick Monnerat
Hi Daniel,

Would it be possible to merge the os400 subdirectory (os400 branch)?
Your remarks have been taken into account as noted in my e-mail to the
list of March 4, 2014.

https://github.com/monnerat/libxml2/tree/os400

Commits:
39354a70eb9290118aa401453916b6f58e313615
f635e88460043fa02f852d3fc5ce829f34b44c44
f8d8770c689ff8b3e5866884f1a08c4c47572574
961b595784d36e336ef7a87268d2e38e543bb6ca
624f6820a6e517152c82c93bd50e434853d1f4c9
4d2496f185e2ac9c5611e951e7dabab6dcc1b61d
b7d7553cde3459aa2f3bce88a4ad9a64b32e048d
1c48f14f39ae879fa53618729e9255e4510c57dc
49b2b51fd64dc3a254c52f2bd7b67af738732303
ff48b67bcbb03bfb52c06fe85a56a9a1ae9332e7
eadbe4457adc9df4ad58f4493d19beaee85d1f15
ae80c444228d4458ced8ec9c842959e5066438ab
c316a29b2e7fd56b3e5fbede70be0b0691ba71cf
cfa5e68c765a8de5163047b18f55b40a1dac5c23

Thanks a lot.
Regards,
Patrick
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Strange 0x0a char popping in generated XML

2014-10-03 Thread Daniel Veillard
On Fri, Oct 03, 2014 at 11:15:30AM +0200, Jean-Philippe Jacoupy wrote:
> On Fri, Oct 3, 2014 at 10:56 AM, Daniel Veillard 
> wrote:
> 
> > On Tue, Aug 26, 2014 at 12:30:01PM +, Jean-Philippe Jacoupy wrote:
> > > Hello,
> > >
> > > I'm using libxml2 and I have a strange behaviour.
> > >
> > > I'm creating a full document in memory (using xmlTextWriter with a
> > xmlBuffer).
> > >
> > > I have called xmlTextWriterSetIndent with 0 as parameter.
> > >
> > > Whenever I get the buffer content (once I have called
> > > xmlTextWriterEndDocument) I get strange 0x0a inserted:
> > >  - 1 after the xml header
> > >  - 1 after the end of the xml document
> > >
> >
> >   It's not strange, that a new line character, which is present
> > as non-significant white space and will be ignored by XML parsers
> > and hence the whole tool chain consuming the output.
> >
> > Daniel
> >
> >
> Thanks for your response Daniel,
> 
> But I still think the presence of those \n is bogus.
> Even if the XML parser will ignore the \n at reading (which is OK),
> when you have to cypher the document, the extras '\n' changes the result.
> 
> Both of them prevent to generate a linearized xml. And that's the point of
> this report.
> 
> I mean this isn't a linearized xml:
> 
> \n />\n
> 
> Whereas this is a linearized xml:
> 
>  />

  If you want to sign the output, the is a canonical format and you
should use that. Libxml2 supports it !

Considering "linearized" that's severely bogus you mean you have
recipient who won't parse anything with a line feed in it ?
Where did that definition come from ? What happen if one of you data
field has a content with a \n inside ? *That* is the the broken part.

That's not an libxml2 issue , XML is here as a spec to define
interoperability, there is a number of place where that interop is
guaranteed even if you reformat the document, and there is equivalence
at the XML Infoset level. The two added \n are in those spaces.

Daniel

> 
> 
> > > I'm under Windows compiling with VS2008 against LibXML2 version 2.7.2
> > >
> > > PS:
> > > - As I searched the code of the libxml2, at the end of the
> > > xmlTextWriterStartDocument function I have found this:
> > >
> > > count = xmlOutputBufferWriteString(writer->out, "?>\n"); (L. 617)
> > >
> > > Shouldn't the '\n' be prefixed by a if (writer->indent) ?
> > >
> > >  - Found the other one in xmlTextWriterEndDocument I have found:
> > >
> > > if (!writer->indent) { (L. 701)
> > >
> > > instead of
> > >
> > > if (writer->indent) {
> > >
> > > as done in all the file.
> > >
> > > ___
> > > xml mailing list, project page  http://xmlsoft.org/
> > > xml@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/xml
> >
> > --
> > 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/
> >
> 
> 
> 
> -- 
> Cordialement,
> JACOUPY Jean-Philippe

-- 
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] How do I use LATEST_LIBXML2?

2014-10-03 Thread Daniel Veillard
On Wed, Oct 01, 2014 at 11:59:36AM -0700, ols6...@sbcglobal.net wrote:
> I'm attempting to use libxml2 on a Windows system, and I want to compile the
> source code myself.
> 
> When I go to the libxml downloads page, I see that 2.9.1 is the latest
> version. If I download that version, I get a 5 MB file LATEST_LIBXML2.
> 
> My question is, how do I extract the source files, documentation, etc from
> this file? Or is this not the correct file?

  it's a pointer to a gzipped tarball,

just fetch libxml2-2.9.1.tar.gz

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] [PATCH 0/2] uri: Don't spoil addresses when formatting them

2014-10-03 Thread Daniel Veillard
On Mon, Sep 29, 2014 at 10:09:57AM +0200, Martin Kletzander wrote:
> [resending because it appears that my previous posting haven't reached
>  the list]
> 
> Since commit 8eb55d782a2b9afacc7938694891cc6fad7b42a5, when you parse
> and save an URI that has no server (or similar) part, two slashes
> after the 'schema:' get lost.  It means 'uri:///noserver' is turned
> into 'uri:/noserver'.
> 
> This can break some applicatication that rely on those slashes to be
> in (e.g. libvirt).  This micro-series proposes 2 different approaches
> to fixing this that have one slight difference.  Approach 1 adds a
> field "slashes_used" into the xmlURI structure that is set to 1 if and
> only if double slashes were skipped when parsing.  The other approach
> simply checks whether path is absolute (starting with '/' and adds
> those two slashes when that condition is true.
> 
> The difference is that the second approach changes 'uri:/only/path' to
> 'uri:///only/path', but doesn't fiddle with the structure insides.
> 
> The probelm is caused by adaptations in RFC 3986 being ambiguously
> implemented in uri.c; for example after skipping "//", the parsing can
> follow almost the same rules or for example after skipping first '/'
> in the path the code can be exactly the same but there are more
> functions for that.  Nevertheless this series aims to fix the issue
> caused by commit 8eb55d782a2b9afacc7938694891cc6fad7b42a5 and leaves
> these cleanups to be done as a follow-up patch later on.
> 
> I'm Cc'ing the author of 8eb55d782a2b9afacc7938694891cc6fad7b42a5 in
> order for him to be able to check this patch and let me (us) know
> whether the approaches proposed here are also usable as a fix for
> their use case.

  Okay I think I have a better option:

basically
   foo:///only/path

means a host of "" while

   foo:/only/path

means no host at all

  So the best fix IMHO is to fix the URI parser to record the first
case and an empty host string and the second case as a NULL host string

 I would not revert the initial patch, we should not 'invent' those
slash, but we should instead when parsing keep the information that
it's a host based path and that foo:/// means the presence of a host
but an empty one.

Once applied the resulting patch below, all cases seems to be saved
properly:

thinkpad:~/XML -> ./testURI uri:/noserver
uri:/noserver
thinkpad:~/XML -> ./testURI uri:///noserver
uri:///noserver
thinkpad:~/XML -> ./testURI uri://server/foo
uri://server/foo
thinkpad:~/XML -> ./testURI uri:/noserver/foo
uri:/noserver/foo
thinkpad:~/XML -> ./testURI uri:///
uri:///
thinkpad:~/XML -> ./testURI uri://
uri://
thinkpad:~/XML -> ./testURI uri:/
uri:/
thinkpad:~/XML ->

  If you revert the initial patch that last case fails

The problem is that I don't want to change the xmlURI structure to
minimize ABI breakage, so I could not extend the field. The natural
solution is to denote that uri:/// has an empty host by making
the uri server field an empty string which works very well but breaks
applications (like libvirt ;-) who blindly look at uri->server
not being NULL to try to reach it !
Simplest was to stick the port to -1 in that case, instead of 0
application don't bother looking at the port of there is no server
string, this makes the patch more complex than a 1 liner, but
is better for ABI.

With that patch libvirt test suite passes again except one case:

115) QEMU XML-2-ARGV disk-drive-network-gluster
... 
Offset 295
Expect [//V]
Actual [V]
  ...
FAILED

  I expect that to be a bug in the way the gluster/rdb driver builds
an URI since all other URI building work in a compatible fashion,
this need to be examined, but I don't consider this a libxml2 bug at
this point,

  thanks,

Daniel

diff --git a/uri.c b/uri.c
index d4dcd2f..ff47abb 100644
--- a/uri.c
+++ b/uri.c
@@ -759,6 +759,8 @@ xmlParse3986HierPart(xmlURIPtr uri, const char **str)
 cur += 2;
ret = xmlParse3986Authority(uri, &cur);
if (ret != 0) return(ret);
+   if (uri->server == NULL)
+   uri->port = -1;
ret = xmlParse3986PathAbEmpty(uri, &cur);
if (ret != 0) return(ret);
*str = cur;
@@ -1106,7 +1108,7 @@ xmlSaveUri(xmlURIPtr uri) {
}
}
 } else {
-   if (uri->server != NULL) {
+   if ((uri->server != NULL) || (uri->port == -1)) {
if (len + 3 >= max) {
 temp = xmlSaveUriRealloc(ret, &max);
 if (temp == NULL) goto mem_error;
@@ -1143,22 +1145,24 @@ xmlSaveUri(xmlURIPtr uri) {
}
ret[len++] = '@';
}
-   p = uri->server;
-   while (*p != 0) {
-   if (len >= max) {
-temp = xmlSaveUriRealloc(ret, &max);
-if (temp == NULL) goto mem_error;
-ret = temp;
+   if (uri->server != NULL) {
+   p = uri->server;
+   while (*p 

Re: [xml] libxslt test suite broken by recent libxml2 commit

2014-10-03 Thread Daniel Veillard
On Sun, Sep 28, 2014 at 03:36:15PM +0200, Nick Wellnhofer wrote:
> Some further notes:
> 
> > First of all, I wonder why I get the warning without the --valid option.
> 
> This is because some ID checks are made regardless of the --valid option. 
> Makes sense.
> 
> > Second, I can’t see why the id attribute would be already defined.
> 
> This is because an external entity is parsed using the original document as 
> context doc:
> 
> 
> https://git.gnome.org/browse/libxml2/tree/parser.c?id=33f658c969501bb246f8d4c6d21772948c7bc965#n12987
> 
> Then, when entities are replaced, the ID values have already been added to 
> the doc. This should probably be fixed in libxml2 but I’m not sure what’s the 
> best approach.
> 
> The other issue in the libxslt test suite is that the HTML docbook tests 
> actually create documents with duplicate “name” attributes which are treated 
> as IDs in HTML documents. This might be fixed in a newer version of 
> docbook-xsl. But the easiest fix for now is to simply add the warning 
> messages to the expected test output.

  Yes, libxml2 ought to raise the error (non-fatal obviously), and I
agree that's a case where the test data need to be modified to cope with
it,

  thanks for raising this !

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] [PATCH] Add methods for python3 iterator

2014-10-03 Thread Daniel Veillard
  thanks !

patch looks good, applied and pushed :-)

Daniel

On Sat, Sep 27, 2014 at 09:56:03PM -0700, Ron Angeles wrote:
> xmlCoreDepthFirstItertor and xmlCoreBreadthFirstItertr only
> implement a python2-compatible iterator interface. The next()
> method has been changed to __next__(). An alias has been
> defined to keep python2 compatibility.
> ---
>  python/libxml.py | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/python/libxml.py b/python/libxml.py
> index e507e0f..2466cc9 100644
> --- a/python/libxml.py
> +++ b/python/libxml.py
> @@ -530,7 +530,7 @@ class xmlCoreDepthFirstItertor:
>  self.parents = []
>  def __iter__(self):
>  return self
> -def next(self):
> +def __next__(self):
>  while 1:
>  if self.node:
>  ret = self.node
> @@ -542,6 +542,7 @@ class xmlCoreDepthFirstItertor:
>  except IndexError:
>  raise StopIteration
>  self.node = parent.next
> +next = __next__
>  
>  #
>  # implements the breadth-first iterator for libxml2 DOM tree
> @@ -552,7 +553,7 @@ class xmlCoreBreadthFirstItertor:
>  self.parents = []
>  def __iter__(self):
>  return self
> -def next(self):
> +def __next__(self):
>  while 1:
>  if self.node:
>  ret = self.node
> @@ -564,6 +565,7 @@ class xmlCoreBreadthFirstItertor:
>  except IndexError:
>  raise StopIteration
>  self.node = parent.children
> +next = __next__
>  
>  #
>  # converters to present a nicer view of the XPath returns
> -- 
> 1.8.5.5
> ___
> xml mailing list, project page  http://xmlsoft.org/
> xml@gnome.org
> https://mail.gnome.org/mailman/listinfo/xml

-- 
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] libxml2: generate a libxml2-config.cmake file

2014-10-03 Thread Daniel Veillard
On Sun, Aug 31, 2014 at 12:26:41AM +0200, Samuel Martin wrote:
> Hi,
> 
> 
> libxml2 has some optional dependencies (e.g. zlib).
> 
> When building a project using CMake as build-system, it is sometimes
> hard to track the libxml2 dependendies and the required ldflags,
> especially when statically linking the binaries.
> 
> To make this step easier, libxml2 already an xml2-config script and a
> libxml-2.0.pc.
> Is it possible to also generate a libxml2-config.cmake file?

  That's rather uncommon. What it is supposed to look like ?

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 0x0a char popping in generated XML

2014-10-03 Thread Daniel Veillard
On Tue, Aug 26, 2014 at 12:30:01PM +, Jean-Philippe Jacoupy wrote:
> Hello, 
> 
> I'm using libxml2 and I have a strange behaviour. 
> 
> I'm creating a full document in memory (using xmlTextWriter with a 
> xmlBuffer). 
> 
> I have called xmlTextWriterSetIndent with 0 as parameter. 
> 
> Whenever I get the buffer content (once I have called
> xmlTextWriterEndDocument) I get strange 0x0a inserted: 
>  - 1 after the xml header
>  - 1 after the end of the xml document
> 

  It's not strange, that a new line character, which is present
as non-significant white space and will be ignored by XML parsers
and hence the whole tool chain consuming the output.

Daniel

> I'm under Windows compiling with VS2008 against LibXML2 version 2.7.2
> 
> PS: 
> - As I searched the code of the libxml2, at the end of the
> xmlTextWriterStartDocument function I have found this: 
> 
> count = xmlOutputBufferWriteString(writer->out, "?>\n"); (L. 617)
> 
> Shouldn't the '\n' be prefixed by a if (writer->indent) ? 
> 
>  - Found the other one in xmlTextWriterEndDocument I have found: 
> 
> if (!writer->indent) { (L. 701)
> 
> instead of 
> 
> if (writer->indent) {
> 
> as done in all the file. 
> 
> ___
> xml mailing list, project page  http://xmlsoft.org/
> xml@gnome.org
> https://mail.gnome.org/mailman/listinfo/xml

-- 
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


[xml] Shooting for a release of 2.9.2 within two weeks

2014-10-03 Thread Daniel Veillard
  A new release is badly needed, I have a number of pending patches,
and fixes, I plan to get them applied, then enter a testing time
say from mid-next week after having a release candidate, and
hopefully push 2.9.2 in the middle of the month.
  If on Monday you have patches which didn't got feeback or being
pushed to git, please reply to this message so I don't forget
something. Also get ready to spend some time testing starting mid
next week,

 thanks,

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