From jeansebastien.ney at gmail.com Tue Jun 10 11:57:20 2008 From: jeansebastien.ney at gmail.com (jney) Date: Tue, 10 Jun 2008 08:57:20 -0700 (PDT) Subject: [libxml-devel] Validating xml in a string In-Reply-To: References: Message-ID: I have the same problem as dwTwiLighT, even, when i use parse method before. On Apr 24, 10:03?am, Chris McGrath wrote: > I've been playing around with XML::Parser recently, and during my ? > irbing I discovered you need to do p.parse before the context is ? > created. > > Chris > > On 22 Apr 2008, at 11:06, dwTwiLighT a.k.a. dwCyMpaK wrote: > > > > > Greetings. > > I want to check if xml received by my application (made with RoR and > > libxml-ruby) via POST request is well-formed. > > This is the source code of that part: > > > ? ? ? ?p = XML::Parser.new > > ? ? ? ?p.string = params[:xml] > > ? ? ? ?if p.context.well_formed? > > ? ? ? ? ?doc = p.parse > > > surely that is wrong, because I get the following message: > > "NoMethodError: undefined method `context' for # > 0xb779c838>" > > > I have no idea about what am I doing wrong and what should I do to > > make it work. Can you help me with this problem? > > _______________________________________________ > > libxml-devel mailing list > > libxml-de... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/libxml-devel > > _______________________________________________ > libxml-devel mailing list > libxml-de... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/libxml-devel From tbagby at kosmix.com Wed Jun 11 19:28:07 2008 From: tbagby at kosmix.com (Tom Bagby) Date: Wed, 11 Jun 2008 16:28:07 -0700 Subject: [libxml-devel] patch for memory leak Message-ID: I found a memory leak when the value of an attribute is accessed. Fix is simple, in function ruby_xml_attr_value in ruby_xml_attr.c, need to call xmlFree: 356,357c356,360 < if (value != NULL) < return(rb_str_new2((const char*)value)); --- > if (value != NULL) { > VALUE retVal = rb_str_new2((const char*)value); > xmlFree(value); > return(retVal); > } I was trying to make a .gem file locally to deploy this patch on my servers, and did not find any .gemspec or build process in svn, where would I find that sort of thing? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at itasoftware.com Wed Jun 18 14:08:38 2008 From: matt at itasoftware.com (Matthew Bachmann) Date: Wed, 18 Jun 2008 14:08:38 -0400 Subject: [libxml-devel] installation problems on fc3 Message-ID: <519F1117-1E91-47C9-9754-FC753F52A878@itasoftware.com> My installation attempt is failing, and claiming that I need libm. I've included the output of a locate call also, which looks to me like it includes a couple incarnations of libm. So a couple questions. How is it trying to find libm? Is there environment that I could be setting to assist it? How do I pass configuration options to gem (were I to decide to use -- without-libm), or do I have to do the tarball install to do that? Any help would be greatly appreciated. Thanks. -Matt ######################################################################## ############### [root at r42br10 ~]# gem install -r 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 -r 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.5.4 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.5.4/ ext/libxml/gem_make.out ######################################################################## ############### [root at r42br10 ~]# locate libm /usr/src/debug/Python-2.4.1/Modules/zlibmodule.c /usr/lib64/libmagic.so /usr/lib64/libmenu.so.5.4 /usr/lib64/libmenuw.so.5 /usr/lib64/libm.a /usr/lib64/libmp.so /usr/lib64/libmenu.a /usr/lib64/libmng.so.1.0.0 /usr/lib64/libmcheck.a /usr/lib64/libmemusage.so /usr/lib64/libmenu.so /usr/lib64/libmenu_g.a /usr/lib64/libmng.so.1 /usr/lib64/libmp.so.3.1.7 /usr/lib64/libmpfr.a /usr/lib64/libmenuw.a /usr/lib64/libmp.so.3 /usr/lib64/libmagic.a /usr/lib64/libmenuw.so /usr/lib64/libmagic.so.1.0 /usr/lib64/libmenu.so.5 /usr/lib64/python2.3/lib-dynload/zlibmodule.so /usr/lib64/libm_p.a /usr/lib64/libmagic.la /usr/lib64/libmenuw.so.5.4 /usr/lib64/libmenuw_g.a /usr/lib64/libm.so /usr/lib64/libmagic.so.1 /usr/lib64/libmp.a /usr/lib/libmenu.so.5.4 /usr/lib/libmenuw.so.5 /usr/lib/libm.a /usr/lib/libmenu.a /usr/lib/libmcheck.a /usr/lib/libmenu.so /usr/lib/libmenu_g.a /usr/lib/libmp.so.3.1.7 /usr/lib/libmenuw.a /usr/lib/libmp.so.3 /usr/lib/libmenuw.so /usr/lib/libmenu.so.5 /usr/lib/sse2/libmp.so.3.1.7 /usr/lib/sse2/libmp.so.3 /usr/lib/libmenuw.so.5.4 /usr/lib/libmenuw_g.a /usr/lib/libm.so /usr/share/man/man3/libmagic.3.gz /usr/share/doc/glibc-2.3.3/README.libm /usr/X11R6/lib64/modules/libmfb.a /lib64/tls/libm.so.6 /lib64/tls/libm-2.3.3.so /lib64/libm.so.6 /lib64/libm-2.3.3.so /lib/tls/libm.so.6 /lib/tls/libm-2.3.3.so /lib/libm.so.6 /lib/i686/libm.so.6 /lib/i686/libm-2.3.3.so /lib/libm-2.3.3.so From tbagby at kosmix.com Thu Jun 19 19:06:29 2008 From: tbagby at kosmix.com (Tom Bagby) Date: Thu, 19 Jun 2008 16:06:29 -0700 Subject: [libxml-devel] installation problems on fc3 References: <519F1117-1E91-47C9-9754-FC753F52A878@itasoftware.com> Message-ID: Notice that it's also not finding socket or nsl or anything. There is probably some other error that's preventing the compiler from running to check this. I had this problem at some point because I had mcpp installed and all calls to gcc had some argument it didn't like. Look in mkmf.log for a more detailed account of what it tried doing. What does it say in there? -Tom -----Original Message----- From: libxml-devel-bounces at rubyforge.org on behalf of Matthew Bachmann Sent: Wed 6/18/2008 11:08 AM To: libxml-devel at rubyforge.org Subject: [libxml-devel] installation problems on fc3 My installation attempt is failing, and claiming that I need libm. I've included the output of a locate call also, which looks to me like it includes a couple incarnations of libm. So a couple questions. How is it trying to find libm? Is there environment that I could be setting to assist it? How do I pass configuration options to gem (were I to decide to use -- without-libm), or do I have to do the tarball install to do that? Any help would be greatly appreciated. Thanks. -Matt ######################################################################## ############### [root at r42br10 ~]# gem install -r 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 -r 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.5.4 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.5.4/ ext/libxml/gem_make.out ######################################################################## ############### [root at r42br10 ~]# locate libm /usr/src/debug/Python-2.4.1/Modules/zlibmodule.c /usr/lib64/libmagic.so /usr/lib64/libmenu.so.5.4 /usr/lib64/libmenuw.so.5 /usr/lib64/libm.a /usr/lib64/libmp.so /usr/lib64/libmenu.a /usr/lib64/libmng.so.1.0.0 /usr/lib64/libmcheck.a /usr/lib64/libmemusage.so /usr/lib64/libmenu.so /usr/lib64/libmenu_g.a /usr/lib64/libmng.so.1 /usr/lib64/libmp.so.3.1.7 /usr/lib64/libmpfr.a /usr/lib64/libmenuw.a /usr/lib64/libmp.so.3 /usr/lib64/libmagic.a /usr/lib64/libmenuw.so /usr/lib64/libmagic.so.1.0 /usr/lib64/libmenu.so.5 /usr/lib64/python2.3/lib-dynload/zlibmodule.so /usr/lib64/libm_p.a /usr/lib64/libmagic.la /usr/lib64/libmenuw.so.5.4 /usr/lib64/libmenuw_g.a /usr/lib64/libm.so /usr/lib64/libmagic.so.1 /usr/lib64/libmp.a /usr/lib/libmenu.so.5.4 /usr/lib/libmenuw.so.5 /usr/lib/libm.a /usr/lib/libmenu.a /usr/lib/libmcheck.a /usr/lib/libmenu.so /usr/lib/libmenu_g.a /usr/lib/libmp.so.3.1.7 /usr/lib/libmenuw.a /usr/lib/libmp.so.3 /usr/lib/libmenuw.so /usr/lib/libmenu.so.5 /usr/lib/sse2/libmp.so.3.1.7 /usr/lib/sse2/libmp.so.3 /usr/lib/libmenuw.so.5.4 /usr/lib/libmenuw_g.a /usr/lib/libm.so /usr/share/man/man3/libmagic.3.gz /usr/share/doc/glibc-2.3.3/README.libm /usr/X11R6/lib64/modules/libmfb.a /lib64/tls/libm.so.6 /lib64/tls/libm-2.3.3.so /lib64/libm.so.6 /lib64/libm-2.3.3.so /lib/tls/libm.so.6 /lib/tls/libm-2.3.3.so /lib/libm.so.6 /lib/i686/libm.so.6 /lib/i686/libm-2.3.3.so /lib/libm-2.3.3.so _______________________________________________ libxml-devel mailing list libxml-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at itasoftware.com Thu Jun 19 19:24:06 2008 From: matt at itasoftware.com (Matthew Bachmann) Date: Thu, 19 Jun 2008 19:24:06 -0400 Subject: [libxml-devel] installation problems on fc3 In-Reply-To: References: <519F1117-1E91-47C9-9754-FC753F52A878@itasoftware.com> Message-ID: I think this was user error on my part, but I'm still not sure what I did. I installed ruby and rubygems on one host, then packaged them into an rpm. I installed that rpm on another host, and that was the host that I had the issues with. Other gems installed fine, but this one was having the problem I reported. I successfully installed the gem on the first host and packaged that with the rpm and it worked fine on the second host. I'm all set for now and will dig more into this when I have time. Thanks for the response. -Matt On Jun 19, 2008, at 7:06 PM, Tom Bagby wrote: > Notice that it's also not finding socket or nsl or anything. There > is probably some other error that's preventing the compiler from > running to check this. I had this problem at some point because I > had mcpp installed and all calls to gcc had some argument it didn't > like. Look in mkmf.log for a more detailed account of what it > tried doing. What does it say in there? > > -Tom > > -----Original Message----- > From: libxml-devel-bounces at rubyforge.org on behalf of Matthew Bachmann > Sent: Wed 6/18/2008 11:08 AM > To: libxml-devel at rubyforge.org > Subject: [libxml-devel] installation problems on fc3 > > My installation attempt is failing, and claiming that I need libm. > I've included the output of a locate call also, which looks to me > like it includes a couple incarnations of libm. > > So a couple questions. > > How is it trying to find libm? Is there environment that I could be > setting to assist it? > > How do I pass configuration options to gem (were I to decide to use -- > without-libm), or do I have to do the tarball install to do that? > > Any help would be greatly appreciated. Thanks. > > -Matt > > > ###################################################################### > ## > ############### > > [root at r42br10 ~]# gem install -r 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 -r 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.5.4 for inspection. > Results logged to /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.5.4/ > ext/libxml/gem_make.out > > ###################################################################### > ## > ############### > > [root at r42br10 ~]# locate libm > /usr/src/debug/Python-2.4.1/Modules/zlibmodule.c > /usr/lib64/libmagic.so > /usr/lib64/libmenu.so.5.4 > /usr/lib64/libmenuw.so.5 > /usr/lib64/libm.a > /usr/lib64/libmp.so > /usr/lib64/libmenu.a > /usr/lib64/libmng.so.1.0.0 > /usr/lib64/libmcheck.a > /usr/lib64/libmemusage.so > /usr/lib64/libmenu.so > /usr/lib64/libmenu_g.a > /usr/lib64/libmng.so.1 > /usr/lib64/libmp.so.3.1.7 > /usr/lib64/libmpfr.a > /usr/lib64/libmenuw.a > /usr/lib64/libmp.so.3 > /usr/lib64/libmagic.a > /usr/lib64/libmenuw.so > /usr/lib64/libmagic.so.1.0 > /usr/lib64/libmenu.so.5 > /usr/lib64/python2.3/lib-dynload/zlibmodule.so > /usr/lib64/libm_p.a > /usr/lib64/libmagic.la > /usr/lib64/libmenuw.so.5.4 > /usr/lib64/libmenuw_g.a > /usr/lib64/libm.so > /usr/lib64/libmagic.so.1 > /usr/lib64/libmp.a > /usr/lib/libmenu.so.5.4 > /usr/lib/libmenuw.so.5 > /usr/lib/libm.a > /usr/lib/libmenu.a > /usr/lib/libmcheck.a > /usr/lib/libmenu.so > /usr/lib/libmenu_g.a > /usr/lib/libmp.so.3.1.7 > /usr/lib/libmenuw.a > /usr/lib/libmp.so.3 > /usr/lib/libmenuw.so > /usr/lib/libmenu.so.5 > /usr/lib/sse2/libmp.so.3.1.7 > /usr/lib/sse2/libmp.so.3 > /usr/lib/libmenuw.so.5.4 > /usr/lib/libmenuw_g.a > /usr/lib/libm.so > /usr/share/man/man3/libmagic.3.gz > /usr/share/doc/glibc-2.3.3/README.libm > /usr/X11R6/lib64/modules/libmfb.a > /lib64/tls/libm.so.6 > /lib64/tls/libm-2.3.3.so > /lib64/libm.so.6 > /lib64/libm-2.3.3.so > /lib/tls/libm.so.6 > /lib/tls/libm-2.3.3.so > /lib/libm.so.6 > /lib/i686/libm.so.6 > /lib/i686/libm-2.3.3.so > /lib/libm-2.3.3.so > _______________________________________________ > libxml-devel mailing list > libxml-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel > > > _______________________________________________ > libxml-devel mailing list > libxml-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From administrator at machdudas.de Fri Jun 27 13:46:35 2008 From: administrator at machdudas.de (machdudas@googlemail.com) Date: Fri, 27 Jun 2008 10:46:35 -0700 (PDT) Subject: [libxml-devel] parsing document containing doctype with saxparser causes null pointer given Message-ID: Wenn i try to parse a Document that has a doctype declaration with the saxparser i get the following message: /Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/commands/runner.rb:45: (eval):95:in `parse': NULL pointer given (ArgumentError) from (eval):95 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `eval' from /Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/commands/runner.rb: 45 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require' from ../../../script/runner:3 This is the document (inner contents removed) The parsing is successful if i use the XML::Parser instead of SaxParser and set the following values: XML::Parser.default_validity_checking = false XML::Parser.default_load_external_dtd = false XML::Parser.default_pedantic_parser = false Is there a was to set these variables for the saxparser or resolve the issue in another way? as soon as i remove the doctype declaration the saxparsing succeeds. TIA Andy