From Jonathan.Bartels at gmail.com Fri Jan 2 11:16:29 2009 From: Jonathan.Bartels at gmail.com (Jonathan Bartels) Date: Fri, 2 Jan 2009 08:16:29 -0800 (PST) Subject: [libxml-devel] Namespace issue with validate_schema? Message-ID: <3b037798-399d-4a64-b12e-c00b97e37ce3@d32g2000yqe.googlegroups.com> This is likely a PEBKAC issue rather than a bug. I hope I'm submitting to the right list. I'm getting different validation results from libxml in Ruby than I am from a command-line tool (xmllint). I'm using a schema definition from ASTM to validate the output, for what it cost me the schema should be correct. I'm using libxml 0.9.4. The XML I'm validating is: ************** a4941200-bb14-012b-4b05-001a6b46d85c English V1.0 2009-01-02T11:02:13-05:00 ************* The code and output from libxml is: ************** schema_doc = XML::Document.file("#{RAILS_ROOT}/ADJE2369.18405.xml") schema = XML::Schema.document(schema_doc) @@ccr.validate_schema(schema) Error: Element 'CCRDocumentObjectID': This element is not expected. Expected is ( {urn:astm-org:CCR}CCRDocumentObjectID ). at :0. LibXML::XML::Error: Error: Element 'CCRDocumentObjectID': This element is not expected. Expected is ( {urn:astm-org:CCR} CCRDocumentObjectID ). at :0. from /home/jon/EXTENSION/Core/branches/TrustBearer/lib/ccr.rb:86:in `validate_schema' from /home/jon/EXTENSION/Core/branches/TrustBearer/lib/ccr.rb:86:in `validate' from (irb):1 ************ The command and output from xmllint is: ******* jon at TPX-70002:~$ xmllint --schema ~/Documents/books\ \&\ guides/CCR/ ADJE2369.18405.xml ./test_ccr.xml ./test_ccr.xml:2: element ContinuityOfCareRecord: Schemas validity error : Element '{urn:astm-org:CCR}ContinuityOfCareRecord': Missing child element(s). Expected is ( {urn:astm-org:CCR}Patient ). ./test_ccr.xml fails to validate ************* I expect a failure, since I haven't added a required node yet (Patient), but I'm trying to reconcile the discrepancy between xmllint and libxml. I believe the namespace declaration in the root node is correct, I would expect since xmlns="urn:astm-org:CCR" is declared that it would be used on the root node and all children. Is this a usage error on my part? Am I misusing libxml or is the xml incorrect? If this is a bug, has it been patched? If not, what information can I provide to help get it fixed? Thanks for your help and thanks for creating and publishing libxml for Ruby! From jpalermo at pivotallabs.com Wed Jan 7 15:18:42 2009 From: jpalermo at pivotallabs.com (Joseph Palermo) Date: Wed, 7 Jan 2009 12:18:42 -0800 (PST) Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 Message-ID: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> We are using some code that utilizes libxml and creates XML documents. Using 0.9.5 everything is fine. Using 0.9.6 or 0.9.7, the more we use this code, the higher our memory usage gets. Seems likely that a memory leak was introduced in 0.9.6. We are seeing this same behavior on OS X and Gentoo. From cfis at savagexi.com Wed Jan 7 16:08:09 2009 From: cfis at savagexi.com (Charlie Savage) Date: Wed, 07 Jan 2009 14:08:09 -0700 Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> Message-ID: <496519B9.5000007@savagexi.com> Hi Joseph, > We are using some code that utilizes libxml and creates XML > documents. Using 0.9.5 everything is fine. Using 0.9.6 or 0.9.7, the > more we use this code, the higher our memory usage gets. > > Seems likely that a memory leak was introduced in 0.9.6. We are > seeing this same behavior on OS X and Gentoo. Can you be more specific? Do you know what code is causing the problem? Can can put together a test case? If you can identify the code that is causing the issue, then it should be easy enough to fix. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From cfis at savagexi.com Wed Jan 7 16:11:59 2009 From: cfis at savagexi.com (Charlie Savage) Date: Wed, 07 Jan 2009 14:11:59 -0700 Subject: [libxml-devel] Namespace issue with validate_schema? In-Reply-To: <3b037798-399d-4a64-b12e-c00b97e37ce3@d32g2000yqe.googlegroups.com> References: <3b037798-399d-4a64-b12e-c00b97e37ce3@d32g2000yqe.googlegroups.com> Message-ID: <49651A9F.3080005@savagexi.com> > This is likely a PEBKAC issue rather than a bug. I hope I'm submitting > to the right list. > > I'm getting different validation results from libxml in Ruby than I am > from a command-line tool (xmllint). I'm using a schema definition from > ASTM to validate the output, for what it cost me the schema should be > correct. I'm using libxml 0.9.4. > > > I expect a failure, since I haven't added a required node yet > (Patient), but I'm trying to reconcile the discrepancy between xmllint > and libxml. Yeah, that sure is interesting. My first thought is if libxml-ruby is using the same version of libmxl that xmllint is using? Is this on Windows, Linux, OS X or some other OS? > Is this a usage error on my part? Am I misusing libxml or is the xml > incorrect? > > If this is a bug, has it been patched? If not, what information can I > provide to help get it fixed? I see the xml you are validating, but can you provide the schema? Mind submitting a bug report at ruby forge? http://rubyforge.org/tracker/?group_id=494 Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From jpalermo at pivotallabs.com Wed Jan 7 16:38:46 2009 From: jpalermo at pivotallabs.com (Joseph Palermo) Date: Wed, 7 Jan 2009 13:38:46 -0800 (PST) Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: <496519B9.5000007@savagexi.com> References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> <496519B9.5000007@savagexi.com> Message-ID: On Jan 7, 1:08 pm, Charlie Savage wrote: > Hi Joseph, > > > We are using some code that utilizes libxml and creates XML > > documents. Using 0.9.5 everything is fine. Using 0.9.6 or 0.9.7, the > > more we use this code, the higher our memory usage gets. > > > Seems likely that a memory leak was introduced in 0.9.6. We are > > seeing this same behavior on OS X and Gentoo. > > Can you be more specific? Do you know what code is causing the problem? > Can can put together a test case? If you can identify the code that > is causing the issue, then it should be easy enough to fix. > > Charlie > > smime.p7s > 4KViewDownload > I'll see if I can put something together, we know it's in the to_solr_doc from acts_as_solr somewhere. From jpalermo at pivotallabs.com Wed Jan 7 17:09:46 2009 From: jpalermo at pivotallabs.com (Joseph Palermo) Date: Wed, 7 Jan 2009 14:09:46 -0800 (PST) Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> <496519B9.5000007@savagexi.com> Message-ID: <9f0e67ce-7c52-4deb-ad67-e728d8e90670@x16g2000prn.googlegroups.com> On Jan 7, 1:38 pm, Joseph Palermo wrote: > On Jan 7, 1:08 pm, Charlie Savage wrote: > > > > > Hi Joseph, > > > > We are using some code that utilizes libxml and creates XML > > > documents. Using 0.9.5 everything is fine. Using 0.9.6 or 0.9.7, the > > > more we use this code, the higher our memory usage gets. > > > > Seems likely that a memory leak was introduced in 0.9.6. We are > > > seeing this same behavior on OS X and Gentoo. > > > Can you be more specific? Do you know what code is causing the problem? > > Can can put together a test case? If you can identify the code that > > is causing the issue, then it should be easy enough to fix. > > > Charlie > > > smime.p7s > > 4KViewDownload > > I'll see if I can put something together, we know it's in the > to_solr_doc from acts_as_solr somewhere. Looks like the problem is in to_s on Node 10000.times do node = XML::Node.new 'node' node.to_s end If I run that on 0.9.5 my memory usage is fine, if I run it on 0.9.6 it balloons. From cfis at savagexi.com Wed Jan 7 19:06:47 2009 From: cfis at savagexi.com (Charlie Savage) Date: Wed, 07 Jan 2009 17:06:47 -0700 Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: <9f0e67ce-7c52-4deb-ad67-e728d8e90670@x16g2000prn.googlegroups.com> References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> <496519B9.5000007@savagexi.com> <9f0e67ce-7c52-4deb-ad67-e728d8e90670@x16g2000prn.googlegroups.com> Message-ID: <49654397.1040303@savagexi.com> Hi Joseph, >> I'll see if I can put something together, we know it's in the >> to_solr_doc from acts_as_solr somewhere. > > Looks like the problem is in to_s on Node > > 10000.times do > node = XML::Node.new 'node' > node.to_s > end Nice work - that's a great test case. So if I I run this code: 10000000.times do node = XML::Node.new 'node' #node.to_s end I see no issues. Adding the .to_s does seem to cause a problem. Are you actually doing so many to_s calls in your code? Anyway, will have to look and see if there is anything obvious in the part of the bindings. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From cfis at savagexi.com Wed Jan 7 19:33:37 2009 From: cfis at savagexi.com (Charlie Savage) Date: Wed, 07 Jan 2009 17:33:37 -0700 Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: <49654397.1040303@savagexi.com> References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> <496519B9.5000007@savagexi.com> <9f0e67ce-7c52-4deb-ad67-e728d8e90670@x16g2000prn.googlegroups.com> <49654397.1040303@savagexi.com> Message-ID: <496549E1.7080201@savagexi.com> >> Looks like the problem is in to_s on Node >> >> 10000.times do >> node = XML::Node.new 'node' >> node.to_s >> end > > > Anyway, will have to look and see if there is anything obvious in the > part of the bindings. And fixed in trunk. It was caused by the addition of encoding support in the last couple of releases. The new code forgot to release the internal libxml output buffer. Thanks for the heads-up on this. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From aaron.patterson at gmail.com Wed Jan 7 19:36:10 2009 From: aaron.patterson at gmail.com (Aaron Patterson) Date: Wed, 7 Jan 2009 16:36:10 -0800 Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: <49654397.1040303@savagexi.com> References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> <496519B9.5000007@savagexi.com> <9f0e67ce-7c52-4deb-ad67-e728d8e90670@x16g2000prn.googlegroups.com> <49654397.1040303@savagexi.com> Message-ID: <6959e1680901071636h7e13fa8etec540d3019734dac@mail.gmail.com> 2009/1/7 Charlie Savage : > Hi Joseph, > >>> I'll see if I can put something together, we know it's in the >>> to_solr_doc from acts_as_solr somewhere. >> >> Looks like the problem is in to_s on Node >> >> 10000.times do >> node = XML::Node.new 'node' >> node.to_s >> end > > Nice work - that's a great test case. > > So if I I run this code: > > 10000000.times do > node = XML::Node.new 'node' > #node.to_s > end > > I see no issues. > > Adding the .to_s does seem to cause a problem. Are you actually doing so > many to_s calls in your code? > > Anyway, will have to look and see if there is anything obvious in the part > of the bindings. Looks like the xmlOutputBufferPtr never gets freed. This might do the trick: Index: ext/libxml/ruby_xml_node.c =================================================================== --- ext/libxml/ruby_xml_node.c (revision 693) +++ ext/libxml/ruby_xml_node.c (working copy) @@ -570,10 +570,16 @@ xmlNodeDumpOutput(output, xnode->doc, xnode, level, indent, encoding); xmlOutputBufferFlush(output); + VALUE string = Qnil; + if (output->conv) - return rb_str_new2((const char*) output->conv->content); + string = rb_str_new2((const char*) output->conv->content); else - return rb_str_new2((const char*) output->buffer->content); + string = rb_str_new2((const char*) output->buffer->content); + + xmlOutputBufferClose(output); + + return string; } -- Aaron Patterson http://tenderlovemaking.com/ From jpalermo at pivotallabs.com Wed Jan 7 19:54:38 2009 From: jpalermo at pivotallabs.com (Joseph Palermo) Date: Wed, 7 Jan 2009 16:54:38 -0800 (PST) Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: <49654397.1040303@savagexi.com> References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> <496519B9.5000007@savagexi.com> <9f0e67ce-7c52-4deb-ad67-e728d8e90670@x16g2000prn.googlegroups.com> <49654397.1040303@savagexi.com> Message-ID: <977fcc3f-ce0b-4186-8b4d-c4581e4a2db9@e1g2000pra.googlegroups.com> On Jan 7, 4:06 pm, Charlie Savage wrote: > Hi Joseph, > > >> I'll see if I can put something together, we know it's in the > >> to_solr_doc from acts_as_solr somewhere. > > > Looks like the problem is in to_s on Node > > > 10000.times do > > node = XML::Node.new 'node' > > node.to_s > > end > > Nice work - that's a great test case. > > So if I I run this code: > > 10000000.times do > node = XML::Node.new 'node' > #node.to_s > end > > I see no issues. > > Adding the .to_s does seem to cause a problem. Are you actually doing > so many to_s calls in your code? > > Anyway, will have to look and see if there is anything obvious in the > part of the bindings. > > Charlie > > smime.p7s > 4KViewDownload We had a batch job where we had to update ~300,000 records which caused a solr_save for each one which does the to_s. We don't have a lot of extra memory on our hosting provider so it showed up pretty quick. Thanks for being so responsive. From cfis at savagexi.com Thu Jan 8 00:42:35 2009 From: cfis at savagexi.com (Charlie Savage) Date: Wed, 07 Jan 2009 22:42:35 -0700 Subject: [libxml-devel] Memory leak with 0.9.6 and 0.9.7 In-Reply-To: <6959e1680901071636h7e13fa8etec540d3019734dac@mail.gmail.com> References: <094ea38a-2cc7-4423-b497-499f9a3e69f2@x16g2000prn.googlegroups.com> <496519B9.5000007@savagexi.com> <9f0e67ce-7c52-4deb-ad67-e728d8e90670@x16g2000prn.googlegroups.com> <49654397.1040303@savagexi.com> <6959e1680901071636h7e13fa8etec540d3019734dac@mail.gmail.com> Message-ID: <4965924B.6060104@savagexi.com> Hey Aaron, > Looks like the xmlOutputBufferPtr never gets freed. Yup, exactly right. I posted a fix to trunk and sent another email to the list, but somehow it never made it through. > Index: ext/libxml/ruby_xml_node.c > =================================================================== > --- ext/libxml/ruby_xml_node.c (revision 693) > +++ ext/libxml/ruby_xml_node.c (working copy) > @@ -570,10 +570,16 @@ > xmlNodeDumpOutput(output, xnode->doc, xnode, level, indent, encoding); > xmlOutputBufferFlush(output); > > + VALUE string = Qnil; > + > if (output->conv) > - return rb_str_new2((const char*) output->conv->content); > + string = rb_str_new2((const char*) output->conv->content); > else > - return rb_str_new2((const char*) output->buffer->content); > + string = rb_str_new2((const char*) output->buffer->content); > + > + xmlOutputBufferClose(output); > + > + return string; > } > Yup, trunk updated to do exactly this. Thanks for the patch. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From Jonathan.Bartels at gmail.com Thu Jan 8 09:43:57 2009 From: Jonathan.Bartels at gmail.com (Jonathan Bartels) Date: Thu, 8 Jan 2009 06:43:57 -0800 (PST) Subject: [libxml-devel] Namespace issue with validate_schema? In-Reply-To: <49651A9F.3080005@savagexi.com> References: <3b037798-399d-4a64-b12e-c00b97e37ce3@d32g2000yqe.googlegroups.com> <49651A9F.3080005@savagexi.com> Message-ID: > Yeah, that sure is interesting. My first thought is if libxml-ruby is > using the same version of libmxl that xmllint is using? ?Is this on > Windows, Linux, OS X or some other OS? This is on Ubuntu 8.04, dpkg reports the following for libxml: libxml1 1:1.8.17-14.1 libxml2 2.6.31.dfsg-2ubuntu1.3 > I see the xml you are validating, but can you provide the schema? ?Mind > submitting a bug report at ruby forge? Legally, I cannot submit the schema. It is the ASTM CCR standard (E2369?05). Access is fee based and the schema is not redistributable. I may be able to post snippets as part of debugging things. > http://rubyforge.org/tracker/?group_id=494 I'll file a bug report later today and follow it. Given that I can't submit the schema I'll attempt to do some debugging/testing/patching myself. Ideally I'd be able to reproduce it with a much simpler use case than this particular XML standard. From Vincent.Jiang.Sep at gmail.com Fri Jan 9 01:02:28 2009 From: Vincent.Jiang.Sep at gmail.com (vincent.jiang) Date: Thu, 8 Jan 2009 22:02:28 -0800 (PST) Subject: [libxml-devel] problem with xmlNewCharEncodingHandler Message-ID: I want to extern libxml encoding to GB2312 on linux. I found it that %outlen is just 45 and %inlen is 653 passed by xmlCharEncodingInputFunc(unsigned char * out, int * outlen, const unsigned char * in, int * inlen) when I use iconv to convert GB2312 to UTF-8. And iconv returned -1. Is %outlen should larger than %inlen? How should I do? From cfis at savagexi.com Fri Jan 9 01:50:28 2009 From: cfis at savagexi.com (Charlie Savage) Date: Thu, 08 Jan 2009 23:50:28 -0700 Subject: [libxml-devel] problem with xmlNewCharEncodingHandler In-Reply-To: References: Message-ID: <4966F3B4.4020305@savagexi.com> > I want to extern libxml encoding to GB2312 on linux. > I found it that %outlen is just 45 and %inlen is 653 passed by > xmlCharEncodingInputFunc(unsigned char * out, int * outlen, const > unsigned char * in, int * inlen) > when I use iconv to convert GB2312 to UTF-8. > And iconv returned -1. > Is %outlen should larger than %inlen? > How should I do? Can you run the same test using just libxml itself? Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From stephen.bannasch at deanbrook.org Sun Jan 11 23:33:43 2009 From: stephen.bannasch at deanbrook.org (Stephen Bannasch) Date: Sun, 11 Jan 2009 23:33:43 -0500 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux Message-ID: $ uname -r 2.6.18-92.1.10.el5PAE $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.2 mkmf.log: http://gist.github.com/45885 gem_make.out: http://gist.github.com/45886 $ sudo gem install libxml-ruby Building native extensions. This could take a while... ERROR: Error installing libxml-ruby: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb install libxml-ruby checking for socket() in -lsocket... no checking for gethostbyname() in -lnsl... no checking for atan() in -lm... no checking for atan() in -lm... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/bin/ruby --with-iconv-dir --without-iconv-dir --with-iconv-include --without-iconv-include=${iconv-dir}/include --with-iconv-lib --without-iconv-lib=${iconv-dir}/lib --with-xml2-dir --without-xml2-dir --with-xml2-include --without-xml2-include=${xml2-dir}/include --with-xml2-lib --without-xml2-lib=${xml2-dir}/lib --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --with-socketlib --without-socketlib --with-nsllib --without-nsllib --with-mlib --without-mlib --with-mlib --without-mlib extconf failure: need libm Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.9.7 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.9.7/ext/libxml/gem_make.out From cfis at savagexi.com Mon Jan 12 00:49:03 2009 From: cfis at savagexi.com (Charlie Savage) Date: Sun, 11 Jan 2009 22:49:03 -0700 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux In-Reply-To: References: Message-ID: <496AD9CF.4030705@savagexi.com> Hi Stephen, > extconf failure: need libm Well, is libm installed? Someone had a similar issue once upon a time: http://rubyforge.org/pipermail/libxml-devel/2008-January/000640.html Turned out to have nothing to do with libm, it was zlib instead (see thread). Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From stephen.bannasch at deanbrook.org Mon Jan 12 03:57:26 2009 From: stephen.bannasch at deanbrook.org (Stephen Bannasch) Date: Mon, 12 Jan 2009 03:57:26 -0500 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux In-Reply-To: <496AD9CF.4030705@savagexi.com> References: <496AD9CF.4030705@savagexi.com> Message-ID: >Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; > micalg=sha1; boundary="------------ms010809070802090204060207" > >Hi Stephen, > >> extconf failure: need libm > >Well, is libm installed? Seems like it is: $ rpm -q glibc-devel glibc-devel-2.5-24 $ rpm -ql glibc-devel ... /usr/lib/libm.a /usr/lib/libm.so /usr/lib/libmcheck.a ... >Someone had a similar issue once upon a time: > >http://rubyforge.org/pipermail/libxml-devel/2008-January/000640.html > >Turned out to have nothing to do with libm, it was zlib instead (see thread). zlib seems to be installed also: $ rpm -ql zlib-devel /usr/include/zconf.h /usr/include/zlib.h /usr/include/zutil.h /usr/lib/libz.a /usr/lib/libz.so /usr/share/doc/zlib-devel-1.2.3 /usr/share/doc/zlib-devel-1.2.3/ChangeLog /usr/share/doc/zlib-devel-1.2.3/algorithm.txt /usr/share/doc/zlib-devel-1.2.3/example.c /usr/share/doc/zlib-devel-1.2.3/minigzip.c /usr/share/man/man3/zlib.3.gz From timuckun at gmail.com Mon Jan 12 17:19:36 2009 From: timuckun at gmail.com (Tim Uckun) Date: Tue, 13 Jan 2009 11:19:36 +1300 Subject: [libxml-devel] doc.to_hash, node.to_hash, xpath.to_hash Message-ID: <855e4dcf0901121419j3ebe082fo3a794366fc2e0e1c@mail.gmail.com> It would be very nice to have these methods in the respective objects. Rails has a Hash.from_xml method but it uses REXML and is slooooow. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfis at savagexi.com Mon Jan 12 18:02:33 2009 From: cfis at savagexi.com (Charlie Savage) Date: Mon, 12 Jan 2009 16:02:33 -0700 Subject: [libxml-devel] doc.to_hash, node.to_hash, xpath.to_hash In-Reply-To: <855e4dcf0901121419j3ebe082fo3a794366fc2e0e1c@mail.gmail.com> References: <855e4dcf0901121419j3ebe082fo3a794366fc2e0e1c@mail.gmail.com> Message-ID: <496BCC09.3050509@savagexi.com> Hey Tim, > It would be very nice to have these methods in the respective objects. > Rails has a Hash.from_xml method but it uses REXML and is slooooow. Would probably be pretty easy to see how Rails does it, and then just modify it as needed to use libxml. Patches always welcome :) Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From linnerud at gmail.com Mon Jan 12 20:44:08 2009 From: linnerud at gmail.com (tel) Date: Mon, 12 Jan 2009 17:44:08 -0800 (PST) Subject: [libxml-devel] XmlNode Doc is not bound! (ruby_xml_node.c:58) on 0.9.7 In-Reply-To: <215b31bd-a4e7-490d-98c1-56eeb83b83dd@s9g2000prm.googlegroups.com> References: <215b31bd-a4e7-490d-98c1-56eeb83b83dd@s9g2000prm.googlegroups.com> Message-ID: The smallest example I could come up with which will trigger the problem: require 'rubygems' require 'xml' invalid_xml = <<-XML XML XML::Error.set_handler do |error| raise error end begin XML::Parser.string(invalid_xml).parse rescue LibXML::XML::Error=> e puts e end GC.start I have created a ticket here: http://rubyforge.org/tracker/index.php?func=detail&aid=23540&group_id=494&atid=1973 best regards, Tor Erik From cfis at savagexi.com Tue Jan 13 02:15:40 2009 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 13 Jan 2009 00:15:40 -0700 Subject: [libxml-devel] XmlNode Doc is not bound! (ruby_xml_node.c:58) on 0.9.7 In-Reply-To: References: <215b31bd-a4e7-490d-98c1-56eeb83b83dd@s9g2000prm.googlegroups.com> Message-ID: <496C3F9C.6010007@savagexi.com> Hi Tor, > I have created a ticket here: > > http://rubyforge.org/tracker/index.php?func=detail&aid=23540&group_id=494&atid=1973 Tel, Interesting bug, great bug report. So here is what's happening: 1. Call parser.parse 2. libxml creates a document 3. libxml starts creating nodes 4. Error occurs, libxml creates an error object, with a node pointer 5. The bindings wrap the node as XML::Node, return it to Ruby 6. Exception handler in Ruby is called 7. libxml then frees the document 8. The XML::Node instance sees that its document was never wrapped by Ruby and calls rb_bug. It does this because the memory model is based on documents freeing their nodes. If a document isn't returned to Ruby, then its not under the control of the garbage collector, and will sooner or later be freed by libxml itself. That means that any returned wrapper nodes will sooner or later become invalid causing a segmentation fault. Thus the check. In theory the bug should always happen, but doesn't, because the node's mark method and free method aren't called in simple tests cases. But they are in yours, due to the reraising of the error object. Anyway, having the node around is useful to figure out what went wrong. On the other hand, keeping around the original node is too dangerous because you could end up with segmentation faults. So I think the best solution, and the one I implemented, is to return a copy of the node of interest. So you'll get its namespaces, attributes and content (but not its parent or children). Copied nodes don't belong to documents, so there is no danger of libxml freeing the underlying node object. Nor will a memory leak happen, because once the node goes error object gets freed by ruby, the node object will be also. Charlie > > best regards, > Tor Erik > _______________________________________________ > libxml-devel mailing list > libxml-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel -- Charlie Savage http://cfis.savagexi.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From stephen.bannasch at deanbrook.org Tue Jan 13 03:43:02 2009 From: stephen.bannasch at deanbrook.org (Stephen Bannasch) Date: Tue, 13 Jan 2009 03:43:02 -0500 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux In-Reply-To: References: <496AD9CF.4030705@savagexi.com> Message-ID: Is there a way to get more clues about the compilation problem? It definitely seems like libm and zlib are installed. mkmf.log: http://gist.github.com/45885 gem_make.out: http://gist.github.com/45886 From tom at compton.nu Tue Jan 13 04:29:07 2009 From: tom at compton.nu (Tom Hughes) Date: Tue, 13 Jan 2009 09:29:07 +0000 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux In-Reply-To: References: <496AD9CF.4030705@savagexi.com> Message-ID: <496C5EE3.2060201@compton.nu> Stephen Bannasch wrote: > Is there a way to get more clues about the compilation problem? > > It definitely seems like libm and zlib are installed. > > mkmf.log: http://gist.github.com/45885 > gem_make.out: http://gist.github.com/45886 It looks like ruby-devel is missing which is probably going to be fairly problematic when trying to build a ruby extension. Tom -- Tom Hughes (tom at compton.nu) http://www.compton.nu/ From stephen.bannasch at deanbrook.org Tue Jan 13 08:54:29 2009 From: stephen.bannasch at deanbrook.org (Stephen Bannasch) Date: Tue, 13 Jan 2009 08:54:29 -0500 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux In-Reply-To: <496C5EE3.2060201@compton.nu> References: <496AD9CF.4030705@savagexi.com> <496C5EE3.2060201@compton.nu> Message-ID: >Stephen Bannasch wrote: >>Is there a way to get more clues about the compilation problem? >> >>It definitely seems like libm and zlib are installed. >> >>mkmf.log: http://gist.github.com/45885 >>gem_make.out: http://gist.github.com/45886 > >It looks like ruby-devel is missing which is probably going to be >fairly problematic when trying to build a ruby extension. > >Tom Thanks Tom, What did you notice that led you to that diagnosis? Ruby is installed from source. I probably need to rebuild it to update references to some of the libraries. I think the server has been upgraded since I did the source install. From tom at compton.nu Tue Jan 13 09:19:55 2009 From: tom at compton.nu (Tom Hughes) Date: Tue, 13 Jan 2009 14:19:55 +0000 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux In-Reply-To: References: <496AD9CF.4030705@savagexi.com> <496C5EE3.2060201@compton.nu> Message-ID: <496CA30B.5010503@compton.nu> Stephen Bannasch wrote: >> Stephen Bannasch wrote: >>> Is there a way to get more clues about the compilation problem? >>> >>> It definitely seems like libm and zlib are installed. >>> >>> mkmf.log: http://gist.github.com/45885 >>> gem_make.out: http://gist.github.com/45886 >> >> It looks like ruby-devel is missing which is probably going to be >> fairly problematic when trying to build a ruby extension. > > What did you notice that led you to that diagnosis? The complaints that it couldn't find libruby-static when linking some of the test programs. Tom -- Tom Hughes (tom at compton.nu) http://www.compton.nu/ From stephen.bannasch at deanbrook.org Tue Jan 13 17:38:42 2009 From: stephen.bannasch at deanbrook.org (Stephen Bannasch) Date: Tue, 13 Jan 2009 17:38:42 -0500 Subject: [libxml-devel] error installing libxml-ruby v0.9.7 on Linux In-Reply-To: <496CA30B.5010503@compton.nu> References: <496AD9CF.4030705@savagexi.com> <496C5EE3.2060201@compton.nu> <496CA30B.5010503@compton.nu> Message-ID: >Stephen Bannasch wrote: >>>Stephen Bannasch wrote: >>>>Is there a way to get more clues about the compilation problem? >>>> >>>>It definitely seems like libm and zlib are installed. >>>> >>>>mkmf.log: http://gist.github.com/45885 >>>>gem_make.out: http://gist.github.com/45886 >>> >>>It looks like ruby-devel is missing which is probably going to be >>>fairly problematic when trying to build a ruby extension. >> >>What did you notice that led you to that diagnosis? > >The complaints that it couldn't find libruby-static when linking >some of the test programs. Thanks for the tip Tom -- rebuilding Ruby with all the appropriate dependencies installed fixed the gem install problem. From timuckun at gmail.com Sat Jan 17 05:17:41 2009 From: timuckun at gmail.com (tim) Date: Sat, 17 Jan 2009 02:17:41 -0800 (PST) Subject: [libxml-devel] doc.to_hash, node.to_hash, xpath.to_hash In-Reply-To: <496BCC09.3050509@savagexi.com> References: <855e4dcf0901121419j3ebe082fo3a794366fc2e0e1c@mail.gmail.com> <496BCC09.3050509@savagexi.com> Message-ID: > Would probably be pretty easy to see how Rails does it, and then just > modify it as needed to use libxml. ?Patches always welcome :) > > Charlie > Hey Charlie. Here is what I came up with. It mimics the rails method in that it does not deal with attributes. It also doesn't do anything with namespaces either. Frankly I don't quite know how I would deal those issues anyway. I am a fairly new rubyist so this code may not be up to your standards, feel free to do with it what you will. class LibXML::XML::Node def has_duplicate_elements? a=[] self.each_element do |c| return true if a.include? c.name a << c.name end return false end def node_to_hash (node) if not node.children? nil elsif (node.children.count == 1 && node.first.text?) || node.empty? node.content elsif node.has_duplicate_elements? a =[] node.each_element do |e| a << {e.name => node_to_hash(e)} end a else h = {} node.each_element { |e| h[e.name] = node_to_hash(e) } h end end def to_hash h={} h[self.name] = node_to_hash(self) h end end From timuckun at gmail.com Sat Jan 17 05:19:24 2009 From: timuckun at gmail.com (tim) Date: Sat, 17 Jan 2009 02:19:24 -0800 (PST) Subject: [libxml-devel] Why is digest the only way to join this list? Message-ID: <297056e9-efdd-48c8-b4c4-11db2fd19e0e@r37g2000prr.googlegroups.com> Google groups will not allow me to subscribe to individual emails. Is there a reason for that? From cfis at savagexi.com Sun Jan 18 20:24:10 2009 From: cfis at savagexi.com (Charlie Savage) Date: Sun, 18 Jan 2009 18:24:10 -0700 Subject: [libxml-devel] Why is digest the only way to join this list? In-Reply-To: <297056e9-efdd-48c8-b4c4-11db2fd19e0e@r37g2000prr.googlegroups.com> References: <297056e9-efdd-48c8-b4c4-11db2fd19e0e@r37g2000prr.googlegroups.com> Message-ID: <4973D63A.4060501@savagexi.com> > Google groups will not allow me to subscribe to individual emails. > > Is there a reason for that? You can subscribe to individual emails here: http://rubyforge.org/mailman/listinfo/libxml-devel Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From cfis at savagexi.com Tue Jan 20 05:00:45 2009 From: cfis at savagexi.com (Charlie Savage) Date: Tue, 20 Jan 2009 03:00:45 -0700 Subject: [libxml-devel] doc.to_hash, node.to_hash, xpath.to_hash In-Reply-To: References: <855e4dcf0901121419j3ebe082fo3a794366fc2e0e1c@mail.gmail.com> <496BCC09.3050509@savagexi.com> Message-ID: <4975A0CD.3040200@savagexi.com> Hey Tim, > Here is what I came up with. It mimics the rails method in that it > does not deal with attributes. It also doesn't do anything with > namespaces either. Frankly I don't quite know how I would deal those > issues anyway. Cool. So I assume you want this to be a drop in replacement for whatever Rails is using now (REXML I assume?). Does Rails have a test suite for outputting xml that you can test against? If we can prove this actually works, then maybe we wrap it up as an optional module included in libxml that you could require in code? > I am a fairly new rubyist so this code may not be up to your > standards, feel free to do with it what you will. > > class LibXML::XML::Node > def has_duplicate_elements? > a=[] > self.each_element do |c| > return true if a.include? c.name > a << c.name > end > return false > end > > def node_to_hash (node) > if not node.children? > nil > elsif (node.children.count == 1 && node.first.text?) || > node.empty? > node.content > elsif node.has_duplicate_elements? > a =[] > node.each_element do |e| > a << {e.name => node_to_hash(e)} > end > a > else > h = {} > node.each_element { |e| > h[e.name] = node_to_hash(e) > } > h > end > end > def to_hash > h={} > h[self.name] = node_to_hash(self) > h > end > end At a quick glance it seems ok.... Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From fritzvl at gmail.com Tue Jan 20 05:15:32 2009 From: fritzvl at gmail.com (Bohdan Sergienko) Date: Tue, 20 Jan 2009 12:15:32 +0200 Subject: [libxml-devel] Installation problem - ruby 1.9.0 on Ubuntu 8.10 Message-ID: <4975A444.5060807@gmail.com> I have a problem installing libxml-ruby for ruby 1.9 on Ubuntu 8.10. Running : ************************************************************************************* gem1.9 install libxml-ruby ************************************************************************************* I received an error message : ************************************************************************************* Building native extensions. This could take a while... ERROR: Error installing libxml-ruby: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9 extconf.rb install libxml-ruby checking for socket() in -lsocket... no checking for gethostbyname() in -lnsl... yes checking for atan() in -lm... no checking for atan() in -lm... yes checking for inflate() in -lz... yes checking for iconv_open() in -liconv... no checking for libiconv_open() in -liconv... no checking for libiconv_open() in -llibiconv... no checking for iconv_open() in -llibiconv... no checking for iconv_open() in -lc... yes checking for xmlParseDoc() in -lxml2... yes checking for libxml/xmlversion.h... no checking for libxml/xmlversion.h in /usr/include,/usr/include/libxml2,/opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes checking for xmlDocFormatDump()... yes checking for docbCreateFileParserCtxt()... yes creating extconf.h creating Makefile make cc -I. -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 -I. -I/usr/include/libxml2 -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -O2 -g -Wall -Wno-parentheses -fPIC -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 -I. -I/usr/include/libxml2 -I/usr/local/include -o ruby_xml_reader.o -c ruby_xml_reader.c In file included from ruby_xml_reader.c:4: ruby_libxml.h:10:18: error: util.h: No such file or directory make: *** [ruby_xml_reader.o] Error 1 Gem files will remain installed in /var/lib/gems/1.9.0/gems/libxml-ruby-0.9.7 for inspection. Results logged to /var/lib/gems/1.9.0/gems/libxml-ruby-0.9.7/ext/libxml/gem_make.out ************************************************************************************* I changed paths uf util.h and st.h to "ruby/*", anf got the next error message : ************************************************************************************* cc -I. -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 -I. -I/usr/include/libxml2 -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -O2 -g -Wall -Wno-parentheses -fPIC -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 -I. -I/usr/include/libxml2 -I/usr/local/include -o ruby_xml_document.o -c ruby_xml_document.c In file included from ruby_xml_document.c:57: /usr/include/ruby-1.9.0/ruby/st.h:91: error: expected declaration specifiers or ?...? before ?size_t? In file included from /usr/include/ruby-1.9.0/ruby.h:15, from ruby_libxml.h:8, from ruby_xml_document.c:58: /usr/include/ruby-1.9.0/ruby/ruby.h:1065: error: conflicting types for ?st_strncasecmp? /usr/include/ruby-1.9.0/ruby/st.h:91: error: previous declaration of ?st_strncasecmp? was here ruby_xml_document.c: In function ?rxml_document_save?: ruby_xml_document.c:544: warning: pointer targets in assignment differ in signedness make: *** [ruby_xml_document.o] Error 1 ************************************************************************************* Also i asked my friend to perform an installation on Gentoo 2008.0 i686 through the gem utility and he got the same error : ************************************************************************************* In file included from ruby_xml_document.c:57: /usr/include/ruby-1.9.0/ruby/backward/st.h:2:2: warning: #warning use "ruby/st.h" instead of bare "st.h" In file included from /usr/include/ruby-1.9.0/ruby/backward/st.h:6, from ruby_xml_document.c:57: /usr/include/ruby-1.9.0/ruby/st.h:94: error: expected declaration specifiers or '...' before 'size_t' In file included from /usr/include/ruby-1.9.0/ruby.h:33, from ruby_libxml.h:8, from ruby_xml_document.c:58: /usr/include/ruby-1.9.0/ruby/ruby.h:1168: error: conflicting types for 'st_strncasecmp' /usr/include/ruby-1.9.0/ruby/st.h:94: error: previous declaration of 'st_strncasecmp' was here In file included from ruby_libxml.h:10, from ruby_xml_document.c:58: /usr/include/ruby-1.9.0/ruby/backward/util.h:2:2: warning: #warning use "ruby/util.h" instead of bare "util.h" ruby_xml_document.c: In function 'rxml_document_save': ruby_xml_document.c:544: warning: pointer targets in assignment differ in signedness make: *** [ruby_xml_document.o] Error 1 ************************************************************************************* If this is a bug or smth on my side? If not, what information can I provide to help get it fixed? Thanks for your help and thanks for great work with libxml for Ruby! From timuckun at gmail.com Wed Jan 21 15:25:26 2009 From: timuckun at gmail.com (Tim Uckun) Date: Thu, 22 Jan 2009 09:25:26 +1300 Subject: [libxml-devel] doc.to_hash, node.to_hash, xpath.to_hash In-Reply-To: <4975A0CD.3040200@savagexi.com> References: <855e4dcf0901121419j3ebe082fo3a794366fc2e0e1c@mail.gmail.com> <496BCC09.3050509@savagexi.com> <4975A0CD.3040200@savagexi.com> Message-ID: <855e4dcf0901211225r60747933j3a5b8468c28ef5fd@mail.gmail.com> > > > Cool. So I assume you want this to be a drop in replacement for whatever > Rails is using now (REXML I assume?). Does Rails have a test suite for > outputting xml that you can test against? > Rails uses a wrapper around REXML. Just the other day I stumbled on a project which replaces some of the rails XML functionality with libxml but it did not have this functionality. I do now know enough about rails to tell you whether or not there is a test for this functionality but I'll look around. All I know is that it's super handy to turn given nodes into hashes. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfis at savagexi.com Fri Jan 23 19:41:19 2009 From: cfis at savagexi.com (Charlie Savage) Date: Fri, 23 Jan 2009 17:41:19 -0700 Subject: [libxml-devel] Installation problem - ruby 1.9.0 on Ubuntu 8.10 In-Reply-To: <4975A444.5060807@gmail.com> References: <4975A444.5060807@gmail.com> Message-ID: <497A63AF.9020502@savagexi.com> Hi Bohdan, > I have a problem installing libxml-ruby for ruby 1.9 on Ubuntu 8.10. > Running : > ************************************************************************************* > > gem1.9 install libxml-ruby > ************************************************************************************* ... > make > cc -I. -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 > -I. -I/usr/include/libxml2 -I/usr/local/include > -DRUBY_EXTCONF_H=\"extconf.h\" -D_FILE_OFFSET_BITS=64 -fPIC > -fno-strict-aliasing -g -g -O2 -O2 -g -Wall -Wno-parentheses -fPIC > -I/usr/include/ruby-1.9.0/i486-linux -I/usr/include/ruby-1.9.0 -I. > -I/usr/include/libxml2 -I/usr/local/include -o ruby_xml_reader.o -c > ruby_xml_reader.c > In file included from ruby_xml_reader.c:4: > ruby_libxml.h:10:18: error: util.h: No such file or directory > make: *** [ruby_xml_reader.o] Error 1 So util.h exists on withe Ruby 1.8, but apparently not on 1.9. Turns out Sam Ruby reported that last year: http://rubyforge.org/pipermail/libxml-devel/2008-January/000680.html Anyway, I just removed that include from trunk. We are about to cut a new release in the next day or so, 0.9.8. Give that a try. And see if you run into this issue: http://rubyforge.org/tracker/index.php?func=detail&aid=23147&group_id=494&atid=1971 Or this one: http://redmine.ruby-lang.org/issues/show/1023 I don't have a 1.9 machine handy, so it would be great if you could help get libxml working. Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From cfis at savagexi.com Sat Jan 24 19:34:32 2009 From: cfis at savagexi.com (Charlie Savage) Date: Sat, 24 Jan 2009 17:34:32 -0700 Subject: [libxml-devel] libxml-ruby-0.9.8 release Message-ID: <497BB398.20401@savagexi.com> I'm happy to announce the release of libxml-ruby 0.9.8. This is an important release for a number of reasons: * It is hopefully the last release before 1.0 * It cleans up a number of warts in libxml-ruby's api and exposes most of libxml's functionality to Ruby * Its been driven by the libxml-ruby community. At this point, the libxml-ruby bindings are in great shape. They are fast, stable, have a much cleaner api and are reasonably well documented (see the RDocs). Best of all, you can help us get to a 1.0 release. Install the bindings, make sure the test suite passes, and run them with your applications. Of particular help would be testing with Ruby 1.9 (which we haven't done yet) and with untested operating systems such as Solaris and various BSDs. Make sure to report any issues you find at RubyForge: http://rubyforge.org/tracker/?atid=1971&group_id=494&func=browse Last, this release was really helped along by the community. Thanks to: * Len Lattanzi - Added support for attribute declarations in DTD's via the new XML::AttrDecl class * Joe Khoobyar - Helped fix memory leaks when using xpath, cleaned up HTMLParser declarations, added text node escaping support and added support for parser recovery mode. * Morus Walter - Helped add in support for parser options * Tor Erik Linnerud - Tracking down a hard to find error in libxml-ruby's error handling And also welcome Joe Khoobyar as a new committer to the project. As seen in the feature list above, Joe made some great contributions to this release. Thanks, Charlie ------------------ == 0.9.8 Release Notes * Refactored XML::Parser, XML::HTMLParser, XML::SaxParser and XML::Reader to have consistent APIs. All the parsers now take a context object in their constructors, allowing fine grained control over the parsers for advanced use cases. These API changes are backwards compatible except for XML::Reader, which now takes an optional hash table as a second parameter in its various constructors versus an optional boolean value. * Updated all APIs to use the encoding constants defined in XML::Encoding versus string values. This API change is not backwards compatible. * Added support for attribute declarations in DTD's via the new XML::AttrDecl class (Len Lattanzi) * Support libxml's content escaping capabilities for text nodes by wrapping libxml's "xmlStringText" and "xmlStringTextNoenc" (Joe Khoobyar). * Updated XML::Reader#read API to return true if a node was read, false if node was not read and raises an exception on an error. Previously #read returned 1 if a node was read, 0 if a node was not read and -1 for an error. This change is not backwards compatible, but provides a more natural interface for Ruby by allowing code like this: while reader.read # do stuff end * Changed XML::Error exception objects to return copies of nodes that cause parse errors instead of the original node. This prevents segmentation faults when the error is reraised. * Added XML::Reader#node method. * Fixed compile errors on OS X which uses an older version of libxml. * Fixed memory leak when performing XPath searches. * Fixed rdocs. * Don't override libxml's default settings for entity substitution and loading external DTDs. This may break some code - you may need to add in a call to XML.default_substitute_entities = true or XML.default_load_external_dtd = true. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: