[libxml-devel] NULL pointer (ArgumentError) with SAXParser

2008-08-16 Thread Dean
Hi all, When I instantiate a Saxparser and some overridden callbacks libxml can't successfully parse xml files with a predefined doctype. It then throws the NULL pointer error. If I remove the doctype it all works well. Any ideas someone? I'm using: Ruby 1.8.6 Ruby-libxml 0.8.3 Windo

Re: [libxml-devel] NULL pointer (ArgumentError) with SAXParser

2008-08-16 Thread Charlie Savage
Hi Dean, When I instantiate a Saxparser and some overridden callbacks libxml can’t successfully parse xml files with a predefined doctype. It then throws the NULL pointer error. If I remove the doctype it all works well. Any ideas someone? Do you have a test case you can submit (see the ruby

Re: [libxml-devel] [PATCH] Allow to initialize NS with prefix=nil (aka default namespace)

2008-08-16 Thread Charlie Savage
Thanks Stephan, Allow to initialize NS with prefix=nil (aka default namespace) I'll apply this for the next release. Charlie smime.p7s Description: S/MIME Cryptographic Signature ___ libxml-devel mailing list libxml-devel@rubyforge.org http://rub

Re: [libxml-devel] memory consumption when finding inside of large document never goes away

2008-08-16 Thread Charlie Savage
Hi Matt, I am making the parsed ruby objects available to a Rails application and I find that if I call GC.start when using the library with Rails that it takes several seconds to garbage collect and sometimes crashes. If I call GC.start in the loop when the program is running as a standalone

Re: [libxml-devel] String parsing

2008-08-16 Thread Charlie Savage
Eric M. wrote: I'm not sure if I'm just doing something wrong or whatnot, but I cannot get any form of xpath searching to work on a parsed string. Specifically, here is what is happening: -> XML generated, sent out to server <- Server receives XML, sends out response -- response received, xml

Re: [libxml-devel] memory consumption when finding inside of large document never goes away

2008-08-16 Thread Matthew Margolis
Charlie, I am running on OSX and RedHat. I am using the Node#find method with an XPath expression for the currently desired node in the default namespace of the document. The crashes stopped happening when I set my nodes variable to nil before calling GC.start. The memory does not spike too much

Re: [libxml-devel] memory consumption when finding inside of large document never goes away

2008-08-16 Thread Charlie Savage
Hi Matt, I am running on OSX and RedHat. I am using the Node#find method with an XPath expression for the currently desired node in the default namespace of the document. The crashes stopped happening when I set my nodes variable to nil before calling GC.start. The memory does not spike too

Re: [libxml-devel] memory consumption when finding inside of large document never goes away

2008-08-16 Thread Matthew Margolis
I don't mind setting nodes = nil before calling GC.start (read some other threads so I think I understand why I have to do that) but I do mind the speed hit, so if you think there is a way around that I would love to know more. My general calling pattern is 1. Document#find_first to get the most

Re: [libxml-devel] memory consumption when finding inside of large document never goes away

2008-08-16 Thread Charlie Savage
Matthew Margolis wrote: I don't mind setting nodes = nil before calling GC.start (read some other threads so I think I understand why I have to do that) but I do mind the speed hit, so if you think there is a way around that I would love to know more. It would all be in the C code. Someth

Re: [libxml-devel] memory consumption when finding inside of large document never goes away

2008-08-16 Thread Matthew Margolis
Thank you so much Charlie. I am for sure going to switch my code to stop abusing find and instead iterate over the children. Good catch. If I can find some spare time I am going to give XMLReader a go and if I can work up the courage I will also try to patch the C code to free those objects. Mat