[xml] empty tag !?

Date view Thread view Subject view Author view

From: Michael Liehmann (e9425279@student.tuwien.ac.at)
Date: Tue Oct 17 2000 - 13:48:27 EDT


Hi !

i want to walk through my parsed tree and
put the tagNames to screen.

here is the according code

        goTree( xmlDocGetRootElement(doc), xmlDocGetRootElement(doc));

 
        void goTree(xmlNodePtr cur, xmlNodePtr checkEnd) {

          printf("%s\n", cur->name);
        
          if ( cur->children->next) {
            goTree(cur->children->next, checkEnd);
          }
          if ( (cur != checkEnd) && (cur->next->next)) {
            goTree(cur->next->next, checkEnd);
          }
       }

it works real fine, as long as no empty tags like <image ...\>
or <p></p> occur.

i tried to use xmlIsBlankNode(cur), but i did not get any appropriate
answer,
although i stepped through the code with gdb.
i am using libxml2

hope somone can help me as fast as Daniel did last time (thanks, Daniel)

michael

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Oct 17 2000 - 14:43:41 EDT