Anonymous avatar Anonymous committed 9b18027

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

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);
+
   }
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.