[libxml-devel] Seg fault when trying to parse empty string

2007-12-03 Thread Christopher J. Bottaro
Hello,

This code segment segfaults:

p = XML::Parser.new
p.string = ''
p.parse

I'm using revision 220.

Btw, is that the preferred way to load XML from a string instead of a file?

Thanks.
___
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


Re: [libxml-devel] Seg fault when trying to parse empty string

2007-12-03 Thread Dan Janowski
svn #221 catches this problem now. There are a variety of ways to  
seed the parser, not sure there is a preferred way.

Dan

On Dec 3, 2007, at 11:54, Christopher J. Bottaro wrote:

> Hello,
>
> This code segment segfaults:
>
> p = XML::Parser.new
> p.string = ''
> p.parse
>
> I'm using revision 220.
>
> Btw, is that the preferred way to load XML from a string instead of  
> a file?
>
> Thanks.
> ___
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel

___
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


Re: [libxml-devel] Status of Patch #7758?

2007-12-03 Thread Paul Dlug
Dan,

Just wondering, any feedback on this?


Thanks,
Paul

On Nov 27, 2007, at 11:41 PM, Paul Dlug wrote:

>
> On Nov 27, 2007, at 3:26 PM, Dan Janowski wrote:
>
>> I see the merit in this kind of approach but it cannot conflict with
>> the libxml work flow. I.e.:
>>
>> instead of XML::Document.parse(xml) => Document
>> XML::Parser.parse(xml) => Document
>>
>> If you want to update the patch for the current code base, I am
>> willing to apply and eval it.
>
> I updated the original patch from Tobias to work with the current  
> subversion trunk (220). I made the suggested modification above so  
> it's XML::Parser.parse(xml) rather than XML::Document.parse --  
> though I do think XML::Document.parse is a little bit of a cleaner  
> API.
>
> I also found a bug with namespace assignments, if you assign a  
> namespace to a node not associated with a document it segfaults:
>
> doc = XML::Document.new
> node = XML::Node.new('root')
> node.namespace = "t:test"
>
> I'm not sure what the best way to fix this is since I'm not the  
> familiar with the namespace code at this point.
>
>
> Thanks,
> Paul
>
> 
>
>
>
>> On Nov 27, 2007, at 13:48, Paul Dlug wrote:
>>
>>> I see patch #7758 hasn't been worked on or updated since submission
>>> (long ago):
>>> http://rubyforge.org/tracker/index.php?
>>> func=detail&aid=7758&group_id=494&atid=1973
>>>
>>> This seems like a great idea and the new parse method solves
>>> eliminates the need for part of the patch I submitted   (#15807). Is
>>> there any interest in getting this into the current library? I would
>>> be happy to modify the patch to bring it up to date with the current
>>> trunk version. This would certainly create a much more user friendly
>>> API than what currently exists.
>>>
>>>
>>> Thanks,
>>> Paul
>>> ___
>>> libxml-devel mailing list
>>> libxml-devel@rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/libxml-devel
>>
>> ___
>> libxml-devel mailing list
>> libxml-devel@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/libxml-devel
>>
>
> ___
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel

___
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


Re: [libxml-devel] Seg fault when trying to parse empty string

2007-12-03 Thread Christopher J. Bottaro
Cool, thanks for that quick fix.

Got another one though...

d = XML::Document.new
d.find('/blah')

Thanks again.

On Dec 3, 2007 12:17 PM, Dan Janowski <[EMAIL PROTECTED]> wrote:
> svn #221 catches this problem now. There are a variety of ways to
> seed the parser, not sure there is a preferred way.
>
> Dan
>
>
> On Dec 3, 2007, at 11:54, Christopher J. Bottaro wrote:
>
> > Hello,
> >
> > This code segment segfaults:
> >
> > p = XML::Parser.new
> > p.string = ''
> > p.parse
> >
> > I'm using revision 220.
> >
> > Btw, is that the preferred way to load XML from a string instead of
> > a file?
> >
> > Thanks.
> > ___
> > libxml-devel mailing list
> > libxml-devel@rubyforge.org
> > http://rubyforge.org/mailman/listinfo/libxml-devel
>
> ___
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel
>
___
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


Re: [libxml-devel] Status of Patch #7758?

2007-12-03 Thread Dan Janowski
Paul,

It looks fine at first glance, but I have not had time to apply the  
patch and examine the results. The library is a lot less fragile than  
when I got it, but I need to be careful when adding code that is not  
fixing a bug to be sure not to blow something else up.

Thanks for the patch. Have any interest in contributing more?

Dan

On Dec 3, 2007, at 14:52, Paul Dlug wrote:

> Dan,
>
> Just wondering, any feedback on this?
>
>
> Thanks,
> Paul
>
> On Nov 27, 2007, at 11:41 PM, Paul Dlug wrote:
>
>>
>> On Nov 27, 2007, at 3:26 PM, Dan Janowski wrote:
>>
>>> I see the merit in this kind of approach but it cannot conflict with
>>> the libxml work flow. I.e.:
>>>
>>> instead of XML::Document.parse(xml) => Document
>>> XML::Parser.parse(xml) => Document
>>>
>>> If you want to update the patch for the current code base, I am
>>> willing to apply and eval it.
>>
>> I updated the original patch from Tobias to work with the current
>> subversion trunk (220). I made the suggested modification above so
>> it's XML::Parser.parse(xml) rather than XML::Document.parse --
>> though I do think XML::Document.parse is a little bit of a cleaner
>> API.
>>
>> I also found a bug with namespace assignments, if you assign a
>> namespace to a node not associated with a document it segfaults:
>>
>> doc = XML::Document.new
>> node = XML::Node.new('root')
>> node.namespace = "t:test"
>>
>> I'm not sure what the best way to fix this is since I'm not the
>> familiar with the namespace code at this point.
>>
>>
>> Thanks,
>> Paul
>>
>> 
>>
>>
>>
>>> On Nov 27, 2007, at 13:48, Paul Dlug wrote:
>>>
 I see patch #7758 hasn't been worked on or updated since submission
 (long ago):
 http://rubyforge.org/tracker/index.php?
 func=detail&aid=7758&group_id=494&atid=1973

 This seems like a great idea and the new parse method solves
 eliminates the need for part of the patch I submitted
 (#15807). Is
 there any interest in getting this into the current library? I  
 would
 be happy to modify the patch to bring it up to date with the  
 current
 trunk version. This would certainly create a much more user  
 friendly
 API than what currently exists.


 Thanks,
 Paul
 ___
 libxml-devel mailing list
 libxml-devel@rubyforge.org
 http://rubyforge.org/mailman/listinfo/libxml-devel
>>>
>>> ___
>>> libxml-devel mailing list
>>> libxml-devel@rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/libxml-devel
>>>
>>
>> ___
>> libxml-devel mailing list
>> libxml-devel@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/libxml-devel
>
> ___
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel

___
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


Re: [libxml-devel] Status of Patch #7758?

2007-12-03 Thread Paul Dlug

On Dec 3, 2007, at 5:09 PM, Dan Janowski wrote:

> Paul,
>
> It looks fine at first glance, but I have not had time to apply the
> patch and examine the results. The library is a lot less fragile than
> when I got it, but I need to be careful when adding code that is not
> fixing a bug to be sure not to blow something else up.

I understand, I'm just happy it's now usable and being maintained. The  
slow performance of REXML was killing me. That being said there's  
still a lot of work to do...

> Thanks for the patch. Have any interest in contributing more?

Definitely, I'm going to take a stab at fixing the namespace segfault  
I reported along with this patch submission. What do you think about  
switching to RSpec and increasing the test coverage? I'd be happy to  
kick this off. This would lead to more thorough test coverage and test  
cases that are actually descriptive, the current structure is too  
cryptic to be really useful.


--Paul


> On Dec 3, 2007, at 14:52, Paul Dlug wrote:
>
>> Dan,
>>
>> Just wondering, any feedback on this?
>>
>>
>> Thanks,
>> Paul
>>
>> On Nov 27, 2007, at 11:41 PM, Paul Dlug wrote:
>>
>>>
>>> On Nov 27, 2007, at 3:26 PM, Dan Janowski wrote:
>>>
 I see the merit in this kind of approach but it cannot conflict  
 with
 the libxml work flow. I.e.:

 instead of XML::Document.parse(xml) => Document
 XML::Parser.parse(xml) => Document

 If you want to update the patch for the current code base, I am
 willing to apply and eval it.
>>>
>>> I updated the original patch from Tobias to work with the current
>>> subversion trunk (220). I made the suggested modification above so
>>> it's XML::Parser.parse(xml) rather than XML::Document.parse --
>>> though I do think XML::Document.parse is a little bit of a cleaner
>>> API.
>>>
>>> I also found a bug with namespace assignments, if you assign a
>>> namespace to a node not associated with a document it segfaults:
>>>
>>> doc = XML::Document.new
>>> node = XML::Node.new('root')
>>> node.namespace = "t:test"
>>>
>>> I'm not sure what the best way to fix this is since I'm not the
>>> familiar with the namespace code at this point.
>>>
>>>
>>> Thanks,
>>> Paul
>>>
>>> 
>>>
>>>
>>>
 On Nov 27, 2007, at 13:48, Paul Dlug wrote:

> I see patch #7758 hasn't been worked on or updated since  
> submission
> (long ago):
> http://rubyforge.org/tracker/index.php?
> func=detail&aid=7758&group_id=494&atid=1973
>
> This seems like a great idea and the new parse method solves
> eliminates the need for part of the patch I submitted
> (#15807). Is
> there any interest in getting this into the current library? I
> would
> be happy to modify the patch to bring it up to date with the
> current
> trunk version. This would certainly create a much more user
> friendly
> API than what currently exists.
>
>
> Thanks,
> Paul
> ___
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel

 ___
 libxml-devel mailing list
 libxml-devel@rubyforge.org
 http://rubyforge.org/mailman/listinfo/libxml-devel

>>>
>>> ___
>>> libxml-devel mailing list
>>> libxml-devel@rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/libxml-devel
>>
>> ___
>> libxml-devel mailing list
>> libxml-devel@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/libxml-devel
>
> ___
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel
>

___
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel