Commits

ph...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 9b18027

Modified Files:
dom.c
+ domSetNodeValue does set the node value again
(sorry, forgot to change variable names)

  • Participants
  • Parent commits 25d0d51

Comments (0)

Files changed (1)

   else {
     str = xmlStrdup( name );
   }
-  warn( str );
   node->name = str;
 }
 
 
 void
 domSetNodeValue( xmlNodePtr n , xmlChar* val ){
-  char* ctnt = NULL; 
-
   if ( n == NULL ) 
     return;
-
-  /* i removed the following line, so the xs file does not hide significant */
-  /* functionality. as i understand this module, it should provide */
-  /* function to make the XS code easier to understand */
-  /* ctnt = xmlEncodeEntitiesReentrant( n->doc , val ); */
+  if ( val == NULL ){
+    val = "";
+  }
   
   if( n->type == XML_ATTRIBUTE_NODE ){
     if ( n->children != NULL ) {
       n->last = NULL;
       xmlFreeNodeList( n->children );
     }
-    n->children = xmlNewText( ctnt );
+    n->children = xmlNewText( val );
     n->children->parent = n;
     n->children->doc = n->doc;
     n->last = n->children; 
   else if( n->content != NULL ) {
     /* free old content */
     xmlFree( n->content );
-    n->content = xmlStrdup(ctnt);
+    n->content = xmlStrdup(val);
+
   }
 }