From stuart.hungerford at anu.edu.au Thu Nov 16 18:20:33 2006 From: stuart.hungerford at anu.edu.au (Stuart Hungerford) Date: Fri, 17 Nov 2006 10:20:33 +1100 Subject: [libxml-devel] Seg faults on Centos Linux... Message-ID: <455CF241.9060902@anu.edu.au> Hi, I've successfully installed the latest 0.3.x series from CVS on the Centos systems I was having installation problems with a couple of weeks back. (By using "ruby extconf.rb; make; sudo make install") Unfortunately now when I try to load a largish XML document (10MB) libxml-ruby segfaults: $ irb >> require "xml/libxml" => true >> XML::Document.file("mydata.xml").root (irb):2: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [x86_64-linux] Aborted The same document with the same libxml-ruby on OS/X loads okay although I haven't tried it with Ubuntu yet. I can't send the XML document as its confidential so is there some way I can send more information that would help track this bug down? Or should I be using the 0.4.0 CVS branch instead? Any advice much appreciated, Stu -- Stuart Hungerford ANUSF Data Intensive Projects From rosco at roscopeco.co.uk Sat Nov 18 05:51:14 2006 From: rosco at roscopeco.co.uk (Ross Bamford) Date: Sat, 18 Nov 2006 10:51:14 -0000 Subject: [libxml-devel] Seg faults on Centos Linux... In-Reply-To: <455CF241.9060902@anu.edu.au> References: <455CF241.9060902@anu.edu.au> Message-ID: Hi, On Thu, 16 Nov 2006 23:20:33 -0000, Stuart Hungerford wrote: > Hi, > > I've successfully installed the latest 0.3.x series from CVS on the > Centos systems I was having installation problems with a couple of > weeks back. (By using "ruby extconf.rb; make; sudo make install") > > Unfortunately now when I try to load a largish XML document (10MB) > libxml-ruby segfaults: > > $ irb > >> require "xml/libxml" > => true > >> XML::Document.file("mydata.xml").root > (irb):2: [BUG] Segmentation fault > ruby 1.8.4 (2005-12-24) [x86_64-linux] > > Aborted > > The same document with the same libxml-ruby on OS/X loads okay > although I haven't tried it with Ubuntu yet. > > I can't send the XML document as its confidential so is there some > way I can send more information that would help track this bug down? > > Or should I be using the 0.4.0 CVS branch instead? > Yes, please give the 0.4.0 branch a try - this sounds like a GC issue that was squashed a couple of weeks ago. Right now it's still *mostly* API compatible (SAX is different, but mostly it's additions and bugfixes) and I'm planning to merge the fixes down for a 0.3.8.2 sometime in the next couple of weeks. -- Ross Bamford - rosco at roscopeco.co.uk From olle at olleolleolle.dk Sun Nov 19 17:21:04 2006 From: olle at olleolleolle.dk (Olle Jonsson) Date: Sun, 19 Nov 2006 23:21:04 +0100 Subject: [libxml-devel] Building gem on PowerPC OS X Message-ID: Hi friends, Ross told me to write [1], and here I am. I bumped into trouble with building the binary libxml_so (IIRC). I complained on my blog [2] (oh, kids these days), and got the help of a friend. The patch that the folks at MacPorts used [3] seems to comment some stuff out. The CFLAGS and LDFLAGS, more specifically. Any other Mac-users reading this? What's your experience? I want to learn how to do this, be self-sufficient. I also want us to crack this... puzzle. best regards, and thanks for the software, Olle Jonsson, Copenhagen, Denmark [1]: http://olle.ter.dk/blog/?p=323#comments [2]: http://olle.ter.dk/blog/?p=322 [3]: http://tinyurl.com/y2gmvx -- or with a preview: http:// preview.tinyurl.com/y2gmvx From rosco at roscopeco.co.uk Sun Nov 19 20:56:08 2006 From: rosco at roscopeco.co.uk (Ross Bamford) Date: Mon, 20 Nov 2006 01:56:08 -0000 Subject: [libxml-devel] CVS changes Message-ID: Hi, I've now closed the DEV_0_4 branch, and merged all the changes down to HEAD. Theres a new branch, MAINT_0_3_8 that has the backward-compatible fixes from DEV_0_4 (memory handling and GC stuff mainly) but none of the additive changes. I'm thinking of pulling a 0.3.8.2 release off of MAINT_0_3_8 in the next few days, and then working out all the remaining additions and changes that people want for 0.4 in HEAD to get a release out in a few weeks. Cheers, -- Ross Bamford - rosco at roscopeco.co.uk From transfire at gmail.com Mon Nov 20 10:44:15 2006 From: transfire at gmail.com (TRANS) Date: Mon, 20 Nov 2006 10:44:15 -0500 Subject: [libxml-devel] CVS changes In-Reply-To: References: Message-ID: <4b6f054f0611200744s1035fe65v45957e0ec99fd5a5@mail.gmail.com> On 11/19/06, Ross Bamford wrote: > Hi, > > I've now closed the DEV_0_4 branch, and merged all the changes down to > HEAD. Theres a new branch, MAINT_0_3_8 that has the backward-compatible > fixes from DEV_0_4 (memory handling and GC stuff mainly) but none of the > additive changes. I'm thinking of pulling a 0.3.8.2 release off of > MAINT_0_3_8 in the next few days, and then working out all the remaining > additions and changes that people want for 0.4 in HEAD to get a release > out in a few weeks. w00t! T. From zdennis at mktec.com Mon Nov 20 12:47:27 2006 From: zdennis at mktec.com (zdennis) Date: Mon, 20 Nov 2006 12:47:27 -0500 Subject: [libxml-devel] CVS changes In-Reply-To: References: Message-ID: <4561EA2F.9070202@mktec.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ross Bamford wrote: > Hi, > > I've now closed the DEV_0_4 branch, and merged all the changes down to > HEAD. Theres a new branch, MAINT_0_3_8 that has the backward-compatible > fixes from DEV_0_4 (memory handling and GC stuff mainly) but none of the > additive changes. thx Ross! > I'm thinking of pulling a 0.3.8.2 release off of > MAINT_0_3_8 in the next few days, That would be awesome! This includes pushing a new rubygem to rubyforge as well? Zach -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFYeovMyx0fW1d8G0RAgDbAJwLw/0bHlsdVbaKXD13gvvK4v6nbwCfZ166 JWjgy2hIGyyX3MFWHu8JmoM= =izcz -----END PGP SIGNATURE----- From rosco at roscopeco.co.uk Wed Nov 22 09:01:06 2006 From: rosco at roscopeco.co.uk (Ross Bamford) Date: Wed, 22 Nov 2006 14:01:06 -0000 Subject: [libxml-devel] Libxml-Ruby 0.3.8.2 now available Message-ID: Libxml-Ruby 0.3.8.2 is now available from Rubyforge (http://libxml.rubyforge.org). Libxml-Ruby provides Ruby bindings to libxml2, the high-speed, high-capability XML processing library used by the GNOME project. This release includes critical bug-fixes and cross-platform installation improvements backported from the current 0.4 development effort, and is a highly-recommended upgrade for all Libxml-Ruby 0.3.x users. Changes for this release: * Reimplemented XML::Node memory management * Reimplemented node copy handling * Reimplemented attribute memory handling * Fixed attribute list traversal (bug #4719) * Tested fix of bug #4635 * Integrated Luc Van Deuren's cdata/comment node patch * Fixed test-naming bugs * Fixed doc build bug * Fixed parser error handler proc early GC bug * include stdarg.h on ruby_xml_document Thanks to everyone who reported bugs and contributed patches. -- Ross Bamford - rosco at roscopeco.co.uk From rosco at roscopeco.co.uk Wed Nov 22 09:05:59 2006 From: rosco at roscopeco.co.uk (Ross Bamford) Date: Wed, 22 Nov 2006 14:05:59 -0000 Subject: [libxml-devel] CVS changes In-Reply-To: <4561EA2F.9070202@mktec.com> References: <4561EA2F.9070202@mktec.com> Message-ID: On Mon, 20 Nov 2006 17:47:27 -0000, zdennis wrote: >> I'm thinking of pulling a 0.3.8.2 release off of >> MAINT_0_3_8 in the next few days, > > That would be awesome! This includes pushing a new rubygem to rubyforge > as well? > Certainly does. It should be up now. Cheers, -- Ross Bamford - rosco at roscopeco.co.uk From rosco at roscopeco.co.uk Wed Nov 22 09:23:45 2006 From: rosco at roscopeco.co.uk (Ross Bamford) Date: Wed, 22 Nov 2006 14:23:45 -0000 Subject: [libxml-devel] Building gem on PowerPC OS X In-Reply-To: References: Message-ID: On Sun, 19 Nov 2006 22:21:04 -0000, Olle Jonsson wrote: > Ross told me to write, and here I am. As an aside, I just realised that you were right in your blog about Node::Set not including Enumerable - other classes did (in libxml.rb) but I obviously overlooked Node::Set. Can't believe I found out about that right after pulling 0.3.8.2, but nevermind - 0.4 should be out before or around xmas :) It's fixed in HEAD now anyway... Cheers, -- Ross Bamford - rosco at roscopeco.co.uk From lrz at chopine.be Sun Nov 26 16:18:06 2006 From: lrz at chopine.be (Laurent Sansonetti) Date: Sun, 26 Nov 2006 22:18:06 +0100 Subject: [libxml-devel] xmlTextReader API? Message-ID: Hi guys, I just had the need to parse a very big XML file from Ruby, and the available libxml-ruby APIs didn't seem to be efficient and flexible enough for this task. So I added bindings to the xmlTextReader API to the project, just for my need, and it appears to work pretty well. So I was just wondering, is there a reason why the xmlTextReader API isn't already wrapped, and would you be interested in such a contribution? If yes I can clean the code, add some test cases and send you a patch against CVS. Cheers, Laurent From olle at olleolleolle.dk Mon Nov 27 02:58:08 2006 From: olle at olleolleolle.dk (Olle Jonsson) Date: Mon, 27 Nov 2006 08:58:08 +0100 Subject: [libxml-devel] xmlTextReader API? In-Reply-To: References: Message-ID: On Nov 26, 2006, at 10:18 PM, Laurent Sansonetti wrote: > Hi guys, > > I just had the need to parse a very big XML file from Ruby, and the > available libxml-ruby APIs didn't seem to be efficient and flexible > enough for this task. So I added bindings to the xmlTextReader API to > the project, just for my need, and it appears to work pretty well. I didn't know about the XmlTextReader, so I read stuff about it [0] -- and it looks good to me. (Python already supports it.) The C# page [1] says: "This class provides forward-only, read-only access to a character stream of XML data. This class enforces the rules of well-formed XML but does not perform data validation." Laurent, have you begun with the wellformedness validation stuff, too? cheers, Olle casual bystander [0]: http://xmlsoft.org/xmlreader.html [1]: http://dotgnu.org/pnetlib-doc/System/Xml/XmlTextReader.html > > So I was just wondering, is there a reason why the xmlTextReader API > isn't already wrapped, and would you be interested in such a > contribution? If yes I can clean the code, add some test cases and > send you a patch against CVS. > > Cheers, > Laurent From rosco at roscopeco.co.uk Mon Nov 27 05:10:43 2006 From: rosco at roscopeco.co.uk (Ross Bamford) Date: Mon, 27 Nov 2006 10:10:43 -0000 Subject: [libxml-devel] xmlTextReader API? In-Reply-To: References: Message-ID: Hi Laurent, On Sun, 26 Nov 2006 21:18:06 -0000, Laurent Sansonetti wrote: > Hi guys, > > I just had the need to parse a very big XML file from Ruby, and the > available libxml-ruby APIs didn't seem to be efficient and flexible > enough for this task. So I added bindings to the xmlTextReader API to > the project, just for my need, and it appears to work pretty well. > > So I was just wondering, is there a reason why the xmlTextReader API > isn't already wrapped, and would you be interested in such a > contribution? If yes I can clean the code, add some test cases and > send you a patch against CVS. > Great stuff!!! Definitely send up that patch! The only reason the reader API isn't already wrapped is that I haven't gotten around to it, but it was slated for the next couple of weeks, ready for the upcoming 0.4 release. If you post up that patch you'll certainly save me some time and maybe even bring the release forward a little :) Cheers, -- Ross Bamford - rosco at roscopeco.co.uk From lrz at chopine.be Mon Nov 27 16:39:32 2006 From: lrz at chopine.be (Laurent Sansonetti) Date: Mon, 27 Nov 2006 22:39:32 +0100 Subject: [libxml-devel] xmlTextReader API? In-Reply-To: References: Message-ID: On Nov 27, 2006, at 8:58 AM, Olle Jonsson wrote: > On Nov 26, 2006, at 10:18 PM, Laurent Sansonetti wrote: > >> Hi guys, >> >> I just had the need to parse a very big XML file from Ruby, and the >> available libxml-ruby APIs didn't seem to be efficient and flexible >> enough for this task. So I added bindings to the xmlTextReader API to >> the project, just for my need, and it appears to work pretty well. > > I didn't know about the XmlTextReader, so I read stuff about it [0] > -- and it looks good to me. (Python already supports it.) > > The C# page [1] says: "This class provides forward-only, read-only > access to a character stream of XML data. This class enforces the > rules of well-formed XML but does not perform data validation." > > Laurent, have you begun with the wellformedness validation stuff, too? > Actually at a glance it's possible to provide some kind of data validation stuff (either RelaxNG or XSD schemas) when initializing the reader, and the data will be validated when walking through the file (as one goes along). I never tested this though. Also, it's possible to connect a callback to the reader that will be called in the given XML stream has processing errors. Didn't test it as well. Laurent From lrz at chopine.be Mon Nov 27 16:43:16 2006 From: lrz at chopine.be (Laurent Sansonetti) Date: Mon, 27 Nov 2006 22:43:16 +0100 Subject: [libxml-devel] xmlTextReader API? In-Reply-To: References: Message-ID: <01CABE56-F25B-4CE1-9771-3DCD8B8EE5F9@chopine.be> Hi Ross, On Nov 27, 2006, at 11:10 AM, Ross Bamford wrote: > On Sun, 26 Nov 2006 21:18:06 -0000, Laurent Sansonetti > > wrote: > >> Hi guys, >> >> I just had the need to parse a very big XML file from Ruby, and the >> available libxml-ruby APIs didn't seem to be efficient and flexible >> enough for this task. So I added bindings to the xmlTextReader API to >> the project, just for my need, and it appears to work pretty well. >> >> So I was just wondering, is there a reason why the xmlTextReader API >> isn't already wrapped, and would you be interested in such a >> contribution? If yes I can clean the code, add some test cases and >> send you a patch against CVS. >> > > Great stuff!!! Definitely send up that patch! The only reason the > reader > API isn't already wrapped is that I haven't gotten around to it, but > it > was slated for the next couple of weeks, ready for the upcoming 0.4 > release. If you post up that patch you'll certainly save me some > time and > maybe even bring the release forward a little :) > Excellent, very cool. Give me a couple of days, to clean the code and add some test cases :-) Cheers, Laurent From lrz at chopine.be Wed Nov 29 12:34:53 2006 From: lrz at chopine.be (Laurent Sansonetti) Date: Wed, 29 Nov 2006 18:34:53 +0100 Subject: [libxml-devel] [PATCH] XML::Reader Message-ID: Hi guys, As promised, here is a first patch to bring xmlTextReader to libxml- ruby. http://chopine.be/lrz/xml-reader.diff Please check it out. Almost everything should be wrapped except some functions that are either for hacking purposes, or could cause memory problems when wrongly used from Ruby, or IMHO not very necessary for now. The patch contains some test cases, but everything is not covered (yet). Also, there is no RDoc comments yet, I would like to be sure that you agree with the API before starting to document it :) Cheers, Laurent From transfire at gmail.com Wed Nov 29 21:35:11 2006 From: transfire at gmail.com (TRANS) Date: Wed, 29 Nov 2006 21:35:11 -0500 Subject: [libxml-devel] [PATCH] XML::Reader In-Reply-To: References: Message-ID: <4b6f054f0611291835n618215f1o58624dc3e744e86d@mail.gmail.com> Good to see contribs like this. Great work. T. From rosco at roscopeco.co.uk Thu Nov 30 12:46:23 2006 From: rosco at roscopeco.co.uk (Ross Bamford) Date: Thu, 30 Nov 2006 17:46:23 -0000 Subject: [libxml-devel] [PATCH] XML::Reader In-Reply-To: References: Message-ID: On Wed, 29 Nov 2006 17:34:53 -0000, Laurent Sansonetti wrote: > As promised, here is a first patch to bring xmlTextReader to libxml- > ruby. > Too cool :) It seems to work great, and I like the API. Thanks so much for this! There are just a couple of things I'd propose: maybe we should rename XML::Reader.walker to XML::Reader.document, and also alias XML::Reader.new to XML::Reader.string. IMO it seems more consistent (all constructors named for the argument they take). Also, I think it could be useful to have methods like the following: class XML::Reader class << self def read_string(str) rdr = new(str) yield rdr while rdr.read == 1 end def read_document(xmldoc) # ... end def read_file(filename) # ... end end end These could be done as ruby methods defined in libxml.rb. I did have a bit of trouble running the test case in a full test run, but it turned out to be because tc_xml_parser was altering the parser configuration, causing the nodes returned by reader to differ from the expectations. I've fixed and committed that now. > The patch contains some test cases, but everything is not > covered (yet). Also, there is no RDoc comments yet, I would like to be > sure that you agree with the API before starting to document it :) > I wonder, any chance you might join the project, commit this patch, and document it in CVS? That way, you'll be able to help maintain the code too ;) In any case, thanks a million - this is very much appreciated. Cheers, -- Ross Bamford - rosco at roscopeco.co.uk From lrz at chopine.be Thu Nov 30 17:09:26 2006 From: lrz at chopine.be (Laurent Sansonetti) Date: Thu, 30 Nov 2006 23:09:26 +0100 Subject: [libxml-devel] [PATCH] XML::Reader In-Reply-To: References: Message-ID: On Nov 30, 2006, at 6:46 PM, Ross Bamford wrote: > On Wed, 29 Nov 2006 17:34:53 -0000, Laurent Sansonetti > > wrote: > >> As promised, here is a first patch to bring xmlTextReader to libxml- >> ruby. > > Too cool :) It seems to work great, and I like the API. Thanks so > much for > this! Excellent, thank you :) > There are just a couple of things I'd propose: maybe we should rename > XML::Reader.walker to XML::Reader.document, and also alias > XML::Reader.new > to XML::Reader.string. IMO it seems more consistent (all constructors > named for the argument they take). Good ideas. Maybe we could perhaps add XML::Document#reader that would do XML::Reader.walker(self). > Also, I think it could be useful to have methods like the following: > > class XML::Reader > class << self > > def read_string(str) > rdr = new(str) > yield rdr while rdr.read == 1 > end > > def read_document(xmldoc) > # ... > end > > def read_file(filename) > # ... > end > > end > end > > These could be done as ruby methods defined in libxml.rb. Mmh, this could be interesting indeed. Something we should think about. >> The patch contains some test cases, but everything is not >> covered (yet). Also, there is no RDoc comments yet, I would like to >> be >> sure that you agree with the API before starting to document it :) > > I wonder, any chance you might join the project, commit this patch, > and > document it in CVS? That way, you'll be able to help maintain the > code too > ;) Sure, I would be honored. My rubyforge username is 'lrz'. > In any case, thanks a million - this is very much appreciated. You're welcome, I'm glad you like it. libxml-ruby is a nice project, it's great to have good libxml2 bindings :) Laurent