From greg at intelligentassistance.com Mon Nov 24 14:16:45 2008 From: greg at intelligentassistance.com (Gregory Clarke) Date: Mon, 24 Nov 2008 11:16:45 -0800 Subject: [Nokogiri-talk] Mac Universal Binary Message-ID: I'm unable to install a Universal Binary version of Nokogiri on OSX 10.5 Leopard. So when I bundle the gem into a RubyCocoa application and run it on the opposite platform, it crashes with the error /.../gems/nokogiri-1.0.6/ext/nokogiri/native.bundle: mach-o, but wrong architecture For Leopard the default is to build both the 32-bit PPC and Intel versions (http://developer.apple.com/releasenotes/OpenSource/PerlExtensionsRelNotes/index.html#/ /apple_ref/doc/uid/TP40006659-DontLinkElementID_3). But even if I explicitly try to build a Universal Binary version using the command: env ARCHFLAGS='-arch i386 -arch ppc' gem install nokogiri the gem is still for one platform only. I think this might be due to the first line of the ext/nokogiri/extconf.rb file: ENV["ARCHFLAGS"] = "-arch #{`uname -p` =~ /powerpc/ ? 'ppc' : 'i386'}" Greg. From zach.dennis at gmail.com Wed Nov 26 09:16:52 2008 From: zach.dennis at gmail.com (Zach Dennis) Date: Wed, 26 Nov 2008 09:16:52 -0500 Subject: [Nokogiri-talk] Encoding content automatically, not desired? Message-ID: <85d99afe0811260616x133357cfucb36a56aee8fb9b3@mail.gmail.com> I'm using the latest Webrat which defaults to Nokogiri by default. In my application Nokogiri is encoding the content that is returned. For example in my application the following snippet of HTML is returned: However, when nokogiri parses it, it returns the following: I cannot reproduce this within Webrat itself, or in a simple Nokogiri test. When I tell webrat to parse with Hpricot the issue goes away. Does this behaviour ring a bell ? -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com From stuart.hungerford at anu.edu.au Wed Nov 26 19:13:24 2008 From: stuart.hungerford at anu.edu.au (Stuart Hungerford) Date: Thu, 27 Nov 2008 11:13:24 +1100 Subject: [Nokogiri-talk] Best way to add nodes to a document... Message-ID: Hi, I'm using Nokogiri to parse an XHTML document and extract some elements into new XML documents. I'm having trouble adding nodes to the new derived documents. Am I going about this the right way? I'm creating each new derived document with: @doc = Nokogiri::XML::Document.new @doc.root = Nokogiri::Node.new("foo", @doc) (The documentation doesn't mention that second parameter but I think it's needed) I'v tried several ways of adding new nodes to @doc.root but the length of @doc.root never changes. Can someone advise on the best way to do this in Nokogiri? (Great library BTW!) Stu -- Stuart Hungerford ANU Supercomputer Facility