Change lookup method to find if content is of XML type.
[cascardo/atompub.git] / atom / content.c
index 274e92a..4dea453 100644 (file)
@@ -77,7 +77,10 @@ atom_content_new_from_xmlnode (xmlNodePtr root)
         XML child or a content child. Using the type attribute might
         be a good idead. Let's just ask that the current method
         works. */
-      if (root->children && root->children->type == XML_ELEMENT_NODE)
+      child = root->children;
+      while (child && child->type != XML_ELEMENT_NODE)
+       child = child->next;
+      if (child)
        {
          content->xmlcontent = xmlCopyNodeList (root->children);
        }
@@ -254,13 +257,13 @@ atom_content_to_xmlnode (AtomContent *content)
 }
 
 xmlNodePtr
-atom_content_content_xmlnode (AtomContent *content)
+atom_content_xmlcontent (AtomContent *content)
 {
   return content->xmlcontent;
 }
 
 void
-atom_content_content_set_xmlnode (AtomContent *content, xmlNodePtr node)
+atom_content_xmlcontent_set (AtomContent *content, xmlNodePtr node)
 {
   if (content->xmlcontent)
     xmlFreeNode (content->xmlcontent);