From noreply at rubyforge.org Wed Oct 1 06:01:00 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 1 Oct 2008 06:01:00 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-7938 ] XML schema namespace declarations make XPATH return nil Message-ID: <20081001100101.621BA18581AD@rubyforge.org> Bugs item #7938, was opened at 2007-01-17 14:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=7938&group_id=494 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Angel Pizarro (delagoya) Assigned to: Nobody (None) Summary: XML schema namespace declarations make XPATH return nil Initial Comment: XML schema namespace decl cause XPATH expressions to return nil. Example below. For some schema foo: (basically elem:foo => elem:bar => content:int ) And this script: #require 'rubygems' # uncomment if libmlx-ruby installed via gems require 'xml/libxml' d = XML::Document.file ARGV[0] r = d.find(ARGV[1]).first puts "#{r.class} ::=> #{r}" r.each { |e| puts "\t#{e.name} = #{e.content}" if e.element? } This XML file does not work: 2147483647 2147483647 2147483647 But this one does: 2147483647 2147483647 2147483647 -angel ---------------------------------------------------------------------- Comment By: Benjamin Woosley (empact) Date: 2008-10-01 10:01 Message: This isn't a bug. The default namespace attribute does not have a name, but is a namespace so it's required for the find. So in the case of the xml which "does not work," you'll need to name the default namespace, e.g.: #find('foo:bar', 'foo:file:/Volumes/DATA/Src/quanto/rampy/test/test.xsd'). Where 'foo' is whatever name you decide to give the default namespace in this call. See http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/XPath/InvalidPath.html # Since the getManufacturerNamesResponse element uses a default # namespace we first have to give it a prefix and register # it with the xpath engine. doc.find('//ns:getManufacturerNamesResponse', 'ns:http://services.somewhere.com') ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=7938&group_id=494 From noreply at rubyforge.org Wed Oct 1 08:29:18 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 1 Oct 2008 08:29:18 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-7938 ] XML schema namespace declarations make XPATH return nil Message-ID: <20081001122936.8941516781A6@rubyforge.org> Bugs item #7938, was opened at 2007-01-17 09:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=7938&group_id=494 Category: None Group: None >Status: Closed Resolution: None Priority: 3 Submitted By: Angel Pizarro (delagoya) Assigned to: Nobody (None) Summary: XML schema namespace declarations make XPATH return nil Initial Comment: XML schema namespace decl cause XPATH expressions to return nil. Example below. For some schema foo: (basically elem:foo => elem:bar => content:int ) And this script: #require 'rubygems' # uncomment if libmlx-ruby installed via gems require 'xml/libxml' d = XML::Document.file ARGV[0] r = d.find(ARGV[1]).first puts "#{r.class} ::=> #{r}" r.each { |e| puts "\t#{e.name} = #{e.content}" if e.element? } This XML file does not work: 2147483647 2147483647 2147483647 But this one does: 2147483647 2147483647 2147483647 -angel ---------------------------------------------------------------------- >Comment By: Angel Pizarro (delagoya) Date: 2008-10-01 08:29 Message: yep, thanks for the reply! ---------------------------------------------------------------------- Comment By: Benjamin Woosley (empact) Date: 2008-10-01 06:01 Message: This isn't a bug. The default namespace attribute does not have a name, but is a namespace so it's required for the find. So in the case of the xml which "does not work," you'll need to name the default namespace, e.g.: #find('foo:bar', 'foo:file:/Volumes/DATA/Src/quanto/rampy/test/test.xsd'). Where 'foo' is whatever name you decide to give the default namespace in this call. See http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/XPath/InvalidPath.html # Since the getManufacturerNamesResponse element uses a default # namespace we first have to give it a prefix and register # it with the xpath engine. doc.find('//ns:getManufacturerNamesResponse', 'ns:http://services.somewhere.com') ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=7938&group_id=494 From noreply at rubyforge.org Wed Oct 8 06:24:15 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 8 Oct 2008 06:24:15 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-22336 ] "property" method not recognised on LibXML::XML::Node Message-ID: <20081008102415.79E1018585AB@rubyforge.org> Bugs item #22336, was opened at 2008-10-08 10:24 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22336&group_id=494 Category: General Group: None Status: Open Resolution: None Priority: 3 Submitted By: Rob Lucas (roblucas) Assigned to: Nobody (None) Summary: "property" method not recognised on LibXML::XML::Node Initial Comment: My hard disk recently died so I had to do a fresh install of all my gems including libxml-ruby (I installed 0.8.3). I can't get the old version number, as the hard disk really is dead, but it was probably 0.5.? . This new install broke some previously fine libxml-ruby based code: - Now, any use of node.property("name") (e.g. model.property("name")) produces an error like: undefined method `property' for :LibXML::XML::Node - However, changing these calls to the node["name"] format (in this case model["name"]) fixes the problem node.property("name") still appears to be valid in the API docs, and I can't find any indication that it has been deprecated or anything. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22336&group_id=494 From andrew.p.cone at gmail.com Fri Oct 10 08:05:19 2008 From: andrew.p.cone at gmail.com (Andrew Cone) Date: Fri, 10 Oct 2008 07:05:19 -0500 Subject: [libxml-devel] compile error with ruby 1.9 under debian Message-ID: <5d3a66f30810100505r9b1c385vd11aece201a803c0@mail.gmail.com> I am trying to install libxml-ruby for Ruby 1.9 under Debian. There is no Debian libxml-ruby1.9, so I typed the following command: sudo gem1.9 install libxml-ruby The result is the following error: In file included from libxml.c:5: ruby_libxml.h:10:18: error: util.h: No such file or directory I tried changing util.h to ruby/util.h in ruby_libxml.h , but I just got another error: ruby_xml_xpath_context.c: In function 'ruby_xml_xpath_context_register_namespaces': ruby_xml_xpath_context.c:212: error: 'struct RHash' has no member named 'tbl' What is going on? Is this a problem with my system or with the gem? I have not done anything unorthodox with my Ruby installation, so I suspect the latter. Please advise. --AC -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at rubyforge.org Fri Oct 10 11:19:16 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 10 Oct 2008 11:19:16 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-22373 ] Corrupt Makefile Message-ID: <20081010151916.9C08918585A0@rubyforge.org> Bugs item #22373, was opened at 2008-10-10 10:19 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22373&group_id=494 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Avdi Grimm (avdi) Assigned to: Nobody (None) Summary: Corrupt Makefile Initial Comment: Installing the gem on a Mac under MacPorts, with Ruby 1.8.6, I get the following error while the extension is building: Makefile:106: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. A quick look at the generated libxml/Makefile reveals it is has multiple command lines that begin with spaces instead of a tab, which is illegal syntax. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22373&group_id=494 From noreply at rubyforge.org Fri Oct 10 11:47:15 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 10 Oct 2008 11:47:15 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-22373 ] Corrupt Makefile Message-ID: <20081010154715.73FE418585B1@rubyforge.org> Bugs item #22373, was opened at 2008-10-10 10:19 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22373&group_id=494 Category: None Group: None Status: Open >Resolution: Rejected Priority: 3 Submitted By: Avdi Grimm (avdi) Assigned to: Nobody (None) Summary: Corrupt Makefile Initial Comment: Installing the gem on a Mac under MacPorts, with Ruby 1.8.6, I get the following error while the extension is building: Makefile:106: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. A quick look at the generated libxml/Makefile reveals it is has multiple command lines that begin with spaces instead of a tab, which is illegal syntax. ---------------------------------------------------------------------- >Comment By: Avdi Grimm (avdi) Date: 2008-10-10 10:47 Message: Gah. Never mind, this seems to be a bug in the 1.8.6 version of mkmf.rb. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22373&group_id=494 From stephan at spaceboyz.net Wed Oct 15 08:26:05 2008 From: stephan at spaceboyz.net (Stephan Maka) Date: Wed, 15 Oct 2008 14:26:05 +0200 Subject: [libxml-devel] compile error with ruby 1.9 under debian In-Reply-To: <5d3a66f30810100505r9b1c385vd11aece201a803c0@mail.gmail.com> References: <5d3a66f30810100505r9b1c385vd11aece201a803c0@mail.gmail.com> Message-ID: <20081015122605.GE3610@chronos.sin> Andrew Cone wrote: > I am trying to install libxml-ruby for Ruby 1.9 under Debian. There is no > Debian libxml-ruby1.9, so I typed the following command: > > [...] > > What is going on? Is this a problem with my system or with the gem? I have > not done anything unorthodox with my Ruby installation, so I suspect the > latter. Please advise. Some Ruby 1.9 related changes just appeared there: http://github.com/dvdplm/libxml-ruby From andrew.p.cone at gmail.com Wed Oct 15 17:18:29 2008 From: andrew.p.cone at gmail.com (Andrew Cone) Date: Wed, 15 Oct 2008 16:18:29 -0500 Subject: [libxml-devel] compile error with ruby 1.9 under debian In-Reply-To: <20081015122605.GE3610@chronos.sin> References: <5d3a66f30810100505r9b1c385vd11aece201a803c0@mail.gmail.com> <20081015122605.GE3610@chronos.sin> Message-ID: <5d3a66f30810151418q1208405h6e69bd6614439362@mail.gmail.com> Thanks! I just installed that, and it worked. One caveat: I had to change line 12 of /usr/local/lib/site_ruby/1.9.0/libxml.rb from require 'libxml_ruby' to require 'i486-linux/libxml_ruby' I also need to launch irb1.9 as follows: irb1.9 -I /usr/local/lib/site_ruby/1.9.0/ and then I have to use require 'xml/libxml' instead of the more customary require 'libxml' Other than that, everything works well, I think. --AC On Wed, Oct 15, 2008 at 7:26 AM, Stephan Maka wrote: > > Andrew Cone wrote: > > I am trying to install libxml-ruby for Ruby 1.9 under Debian. There is no > > Debian libxml-ruby1.9, so I typed the following command: > > > > [...] > > > > What is going on? Is this a problem with my system or with the gem? I have > > not done anything unorthodox with my Ruby installation, so I suspect the > > latter. Please advise. > > Some Ruby 1.9 related changes just appeared there: > http://github.com/dvdplm/libxml-ruby > > _______________________________________________ > libxml-devel mailing list > libxml-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel From transfire at gmail.com Wed Oct 15 17:46:01 2008 From: transfire at gmail.com (Trans) Date: Wed, 15 Oct 2008 17:46:01 -0400 Subject: [libxml-devel] compile error with ruby 1.9 under debian In-Reply-To: <5d3a66f30810151418q1208405h6e69bd6614439362@mail.gmail.com> References: <5d3a66f30810100505r9b1c385vd11aece201a803c0@mail.gmail.com> <20081015122605.GE3610@chronos.sin> <5d3a66f30810151418q1208405h6e69bd6614439362@mail.gmail.com> Message-ID: <4b6f054f0810151446v6572f9aek266c3143648bafb5@mail.gmail.com> On Wed, Oct 15, 2008 at 5:18 PM, Andrew Cone wrote: > Thanks! I just installed that, and it worked. One caveat: I had to > change line 12 of /usr/local/lib/site_ruby/1.9.0/libxml.rb from > > require 'libxml_ruby' > > to > > require 'i486-linux/libxml_ruby' > > I also need to launch irb1.9 as follows: > > irb1.9 -I /usr/local/lib/site_ruby/1.9.0/ > > and then I have to use > > require 'xml/libxml' > > instead of the more customary > > require 'libxml' Ah, you are using the LibXML namespace at the toplevel. Just do: require 'xml' This is equivalent to: require 'libxml' include LibXML 'xml/libxml' is just there for backward compatibility with how it used to be required. Ultimately it will be deprecated. T. From andrew.p.cone at gmail.com Wed Oct 15 17:54:50 2008 From: andrew.p.cone at gmail.com (Andrew Cone) Date: Wed, 15 Oct 2008 16:54:50 -0500 Subject: [libxml-devel] compile error with ruby 1.9 under debian In-Reply-To: <4b6f054f0810151446v6572f9aek266c3143648bafb5@mail.gmail.com> References: <5d3a66f30810100505r9b1c385vd11aece201a803c0@mail.gmail.com> <20081015122605.GE3610@chronos.sin> <5d3a66f30810151418q1208405h6e69bd6614439362@mail.gmail.com> <4b6f054f0810151446v6572f9aek266c3143648bafb5@mail.gmail.com> Message-ID: <5d3a66f30810151454l33f3abdt570e301355977b2e@mail.gmail.com> Ah. Right. Thanks. On Wed, Oct 15, 2008 at 4:46 PM, Trans wrote: > On Wed, Oct 15, 2008 at 5:18 PM, Andrew Cone wrote: >> Thanks! I just installed that, and it worked. One caveat: I had to >> change line 12 of /usr/local/lib/site_ruby/1.9.0/libxml.rb from >> >> require 'libxml_ruby' >> >> to >> >> require 'i486-linux/libxml_ruby' >> >> I also need to launch irb1.9 as follows: >> >> irb1.9 -I /usr/local/lib/site_ruby/1.9.0/ >> >> and then I have to use >> >> require 'xml/libxml' >> >> instead of the more customary >> >> require 'libxml' > > Ah, you are using the LibXML namespace at the toplevel. Just do: > > require 'xml' > > This is equivalent to: > > require 'libxml' > include LibXML > > 'xml/libxml' is just there for backward compatibility with how it used > to be required. Ultimately it will be deprecated. > > T. > _______________________________________________ > libxml-devel mailing list > libxml-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel > From noreply at rubyforge.org Wed Oct 15 03:52:31 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 15 Oct 2008 03:52:31 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-22415 ] xml_node.attributes.each { |a| a.remove! } # stops after removing the first attribute Message-ID: <20081015075231.2AD0618585A7@rubyforge.org> Bugs item #22415, was opened at 15/10/2008 09:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22415&group_id=494 Category: General Group: None Status: Open Resolution: None Priority: 3 Submitted By: Elia Schito (elia) Assigned to: Nobody (None) Summary: xml_node.attributes.each { |a| a.remove! } # stops after removing the first attribute Initial Comment: # With the XML below the following won't work (will remove only the first attribute): xml_object.find_first('ibbas:ncsa/ibbas:mcrange').attributes.each do |xml_attribute| xml_attribute.remove! if xml_attribute.name =~ /^(addr|range)\d+$/ end # The following works: attributes = [] xml_object.find_first('ibbas:ncsa/ibbas:mcrange').attributes.each{ |a| attributes << a } attributes.each do |xml_attribute| xml_attribute.remove! if xml_attribute.name =~ /^(addr|range)\d+$/ end __DATA__ ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22415&group_id=494 From Peer.Allan at canadadrugs.com Wed Oct 15 10:54:00 2008 From: Peer.Allan at canadadrugs.com (Peer Allan) Date: Wed, 15 Oct 2008 09:54:00 -0500 Subject: [libxml-devel] Encoding Problem Message-ID: We have some data coming from a database using latin1 encoding (which we can?t change). When we try to insert that data into a libxml doc the scripts locks up so badly we have to kill the process manually. If we do a conversion on the string (String#toutf8) it works. Setting the encoding of the document does not help either. Here is some code, >> doc = LibXML::XML::Document.new >> doc.root = LibXML::XML::Node.new("person") >> doc.root << lname = LibXML::XML::Node.new('last_name') >> lname << "Farr?s" There is no output from this, it just hangs. The key to remember is the "Farr?s" is latin1 encoded from MySQL. If it is UTF-8 the code will work. The worst part is that it runs right on one server and does not run on others. Could there be a library issue? This is also running under Rails 2.1 if that makes any difference. Thanks. Peer Allan Development Team Lead, e-Business CanadaDrugs.com 24 Terracon Place Winnipeg, MB, Canada R2J 4G7 Phone: (204) 654-7951 Fax: (204) 654-7910 www.canadadrugs.com From noreply at rubyforge.org Wed Oct 22 10:42:25 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 22 Oct 2008 10:42:25 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-22513 ] Memory leak with Node.prev and Node.remove! Message-ID: <20081022144225.D7C48185859F@rubyforge.org> Bugs item #22513, was opened at 2008-10-22 10:42 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22513&group_id=494 Category: memory Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: Memory leak with Node.prev and Node.remove! Initial Comment: Memory usage of Ruby increases when I execute a script like below. --- require 'xml/libxml' doc = XML::Document.new() doc.root = XML::Node.new('root') root = doc.root root << child = XML::Node.new('child') (1..100000).each {|i| a = XML::Node.new('dummy') child.prev = a a.remove! if i % 100 == 0 GC.start # show memory usage in unix environment. puts `ps alx | grep #{$$} | awk '{printf ("%d\t%s\n", $8,$13)}'` end } ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22513&group_id=494 From noreply at rubyforge.org Thu Oct 23 09:06:53 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 23 Oct 2008 09:06:53 -0400 (EDT) Subject: [libxml-devel] [ libxml-Bugs-22531 ] XML::Reader does not work with sockets Message-ID: <20081023130654.2057018585B1@rubyforge.org> Bugs item #22531, was opened at 2008-10-23 15:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22531&group_id=494 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Han Holl (hanholl) Assigned to: Nobody (None) Summary: XML::Reader does not work with sockets Initial Comment: I tried with the two following programs: A server: #!/usr/bin/ruby -w require 'rubygems' require 'xml' require 'socket' server = TCPServer.new(22222) while session = server.accept reader = XML::Reader.io(session) loop do rsl = reader.read puts rsl break if rsl != 1 puts reader.expand end session.puts 'ok' sleep 1 session.close end # end-of-server and a client: #!/usr/bin/ruby require 'socket' t = TCPSocket.new('localhost', 22222) t.puts 'k' puts t.gets # end-of-client Output from server: Entity: line 1: parser error : Extra content at the end of the document ^ -1 I tried different platforms (RH9, CentOS 5.1 and Fedora8). libxml-ruby-0.8.3 Various libxml2 versions ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22531&group_id=494 From dhelder at mudynamics.com Tue Oct 28 18:42:10 2008 From: dhelder at mudynamics.com (David Helder) Date: Tue, 28 Oct 2008 15:42:10 -0700 Subject: [libxml-devel] UTF-8 problem Message-ID: <458EB412-7AB1-4609-A898-EC47DF85A1A3@mudynamics.com> I'm trying to input and output special characters, but I'm getting parse errors from libxml. Code snippet: node = LibXML::XML::Node.new 'node' node.content = '' doc = LibXML::XML::Document.new doc.encoding = 'UTF-8' doc.root = node xml = doc.to_s true, 'UTF-8' parser = LibXML::XML::Parser.new parser.string = xml doc = parser.parse p doc.root.content The first part sets xml to: \1 Where \1 is the byte 1. The second part tries to parse this. But libxml gives this error on the call to Parser.parse: Entity: line 2: parser error : internal error ^ Entity: line 2: parser error : Extra content at the end of the document I'm using libxml-ruby 0.8.3 and libxml2 2.6.30. Any ideas? Thanks, David From aaron at tenderlovemaking.com Thu Oct 30 13:15:46 2008 From: aaron at tenderlovemaking.com (Aaron Patterson) Date: Thu, 30 Oct 2008 10:15:46 -0700 Subject: [libxml-devel] [ANN] nokogiri 1.0.0 Released Message-ID: <20081030171546.GA452@mac-mini.local> nokogiri version 1.0.0 has been released! * * * Nokogiri (?) is an HTML, XML, SAX, and Reader parser with XPath and CSS selector support. ### FEATURES: * XPath support for document searching * CSS3 selector support for document searching * XML/HTML builder * Drop in replacement for Hpricot Nokogiri parses and searches XML/HTML faster than Hpricot, and also has correctly implemented CSS3 selector support as well as XPath support. * http://gist.github.com/18533 Nokogiri also features an Hpricot compatibility layer to help ease the change to using correct CSS and XPath. ### SYNOPSIS: require 'nokogiri' require 'open-uri' doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove')) #### # Search for nodes by css doc.css('h3.r a.l').each do |link| puts link.content end #### # Search for nodes by xpath doc.xpath('//h3/a[@class="l"]').each do |link| puts link.content end #### # Or mix and match. doc.search('h3.r a.l', '//h3/a[@class="l"]').each do |link| puts link.content end Changes: ### 1.0.0 / 2008-07-13 * 1 major enhancement * Birthday! * * * -- Aaron Patterson http://tenderlovemaking.com/