Changeset 2168c40635a237e84a69b74bb34c24f230052ae9 for ext
- Timestamp:
- 08/30/08 00:14:25 (4 months ago)
- Parents:
- 9474da7584bfc0373ae26f41223d824bbcce3baa
- Children:
- 5f7de15c00f6f991e77caf8bd30ac9eda203035a
- git-committer:
- Mark Guzman <segfault@hasno.info> / 2008-08-30T00:14:25Z-0400
- Location:
- ext
- Files:
-
- 2 modified
-
fastxml.c (modified) (1 diff)
-
fastxml_doc.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ext/fastxml.c
r7d973e r2168c4 59 59 60 60 /* pull in the ruby side of things */ 61 rb_require( " lib/fastxml_lib" ); // ruby-side methods for the FastXml classes62 rb_require( " lib/fastxml_helpers" ); // FastXml and FastHtml methods61 rb_require( "fastxml/fastxml_lib" ); // ruby-side methods for the FastXml classes 62 rb_require( "fastxml/fastxml_helpers" ); // FastXml and FastHtml methods 63 63 } 64 64 -
ext/fastxml_doc.c
r7d973e r2168c4 217 217 } 218 218 219 /* Returns the FastXml::Node object representing the root element of 220 * the target document 221 * 222 * call-seq: 223 * puts doc.root.name 224 */ 225 VALUE fastxml_doc_root_set(VALUE self, VALUE newroot) 226 { 227 VALUE dv, odv; 228 fxml_data_t *data, *node_data; 229 xmlNodePtr root, new_root; 230 231 dv = rb_iv_get( self, "@lxml_doc" ); 232 Data_Get_Struct( dv, fxml_data_t, data ); 233 234 odv = rb_iv_get( self, "@lxml_doc" ); 235 Data_Get_Struct( odv, fxml_data_t, node_data ); 236 237 root = xmlDocGetRootElement( data->doc ); 238 239 if (rb_obj_is_kind_of(newroot, rb_cFastXmlNode) == Qfalse && rb_obj_is_kind_of(newroot, rb_cString) == Qfalse) 240 rb_raise(rb_eTypeError, "must pass a FastXml::Node or String type object"); 241 242 new_root = xmlDocSetRootElement( data->doc, node_data->node ); 243 if (new_root == NULL) 244 return Qnil; 245 246 return newroot; 247 } 248 219 249 /* Parse an input string/array/stringio object into a FastXml::Doc object. 220 250 *
