Hey everyone,

I had a little time today and made a couple of more changes to XML::Node. I changed [], []=, and new to all accept symbols OR string, rather than just strings. Does this seems like good functionality to anyone else? Attatched is the patch should you find this functionality useful.

Thanks,

Mark Van Holstyn

--
Mark Van Holstyn
[EMAIL PROTECTED]
http://lotswholetime.com
13,22d12
< VALUE
< check_string_or_symbol( VALUE val ) {
<   if( TYPE(val) != T_STRING && TYPE(val) != T_SYMBOL ) {
<   	rb_raise(rb_eTypeError, "wrong argument type %s (expected String or Symbol)", 
<   		rb_obj_classname(val) );
<   }
<   return rb_obj_as_string( val );
< }
< 
< 
759c749,750
<     name = check_string_or_symbol( argv[0] );
---
>     name = argv[0];
>     Check_Type(name, T_STRING);
1692a1684,1685
>   
>   Check_Type(prop, T_STRING);
1694d1686
<   prop = check_string_or_symbol( prop );
1720a1713,1715
> 
>   Data_Get_Struct(self, ruby_xml_node, node);
>   Check_Type(key, T_STRING);
1722,1723d1716
<   key = check_string_or_symbol( key );
<   Data_Get_Struct(self, ruby_xml_node, node);  
_______________________________________________
libxml-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to