[xml] Example program tree1.c: Node content always NULL ?



Hi!

I have compiled the example program tree1.c, but I wanted to get to the content of the nodes. Therefore, I changed its output in line 37 to:

printf("node type: Element, name: %s, value: %s\n", cur_node->name, cur_node->content);

and tested it with :

<?xml version="1.0" ?>
<Praktikum><Umfeld><Feld><Boden>Rasen</Boden><Ameise><Typ>Rot</Typ><ID>1</ID><Blickrichtung>NW</Blickrichtung><Angegriffen>0</Angegriffen><Objekt>Stein-2</Objekt></Ameise></Feld></Umfeld><Status>OK</Status></Praktikum>

Unfortunately: all content attributes are NULL. The "<ID>1</ID>" e.g. should have content 1, or am I wrong?

Can anyone tell me, what I am doing wrong?

Tnx
  Karl






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]