[xml] internal tree ?

Date view Thread view Subject view Author view

From: Michael Liehmann (e9425279@student.tuwien.ac.at)
Date: Sun Oct 15 2000 - 13:05:43 EDT


Hi !

as this is my first message to this mailing list, i hope that
my question or problem is not too dumb .

well i try to write a XMLmodule for MetaHTML.
at the moment i am still probing around and try to understand the
internal presentation of the tree, the parser returns.

i used this small xml example file from xmlsoft.org
<?xml version="1.0"?>
<EXAMPLE prop1="gnome is great" prop2="&amp; linux too">
  <head>ddd
   <title>Welcome to Gnome
     <sub>suse</sub>
   </title>
  </head>
  <chapter>eins
   <title>The Linux adventure</title>
   <p>bla bla bla ...</p>
   <p>...</p>
  </chapter>
</EXAMPLE>

here comes the testfile
...
...

  doc = xmlParseFile("xmlFile2.xml");
  if (doc == NULL) return(NULL);
  cur = xmlDocGetRootElement(doc);

now, cur is the root tag ( = <EXAMPLE> )
and with printf("%s\n",cur->name) i get the right tagname

with printf("%s\n",cur->xmlChildrenNode->next->name) i get the name of
the <head> tag

ok, but then the questions start!
how can i reference the <chapter> tag?
or the second title tag ( = the linux adventure)
how can i parse throug the whole tree!

i always get memory errors. mainly it hink because
of my lack in understanding the internal tree.

can someone help me, or give me links to ressources where i can
find the appropriate answers

thanx a lot
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 : Sun Oct 15 2000 - 13:43:26 EDT