[Axl] Compare the value of a node or node contents with a known value.

Steve Starr steven.l.starr at gmail.com
Wed Jun 11 20:39:36 CEST 2008


I was wondering how do you compare the value of a node or node contents
with a known value.

Xml Doc
-------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<root>
    <child1>Hello</child1>
    <child2>World</child2>
</root>


Code Snippet
-------------------------------------------------------------
// get the first child node and its contents
node = axl_node_get_first_child (node);
value = axl_node_get_content_trim (node, NULL);
printf("Useing the axl_node_get_first_child function. \n");
printf("%s \n\n", value);

/* Does value == Hello? */
if (value == "Hello") {
    printf("True \n");
}
else {
    printf("False \n");
}


Terminal Output
-------------------------------------------------------------
Useing the axl_node_get_first_child function.
Hello

False


The result always seems to be false.

Thanks Steven :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.aspl.es/pipermail/axl/attachments/20080611/8b042bd0/attachment.html 


More information about the Axl mailing list