[Axl] Compare the value of a node or node contents with a known value.
Qball Cow
qball at sarine.nl
Wed Jun 11 21:37:59 CEST 2008
value == "Hello" is not a string compare in C.
Q
On Jun 11, 2008, at 8:39 PM, Steve Starr wrote:
> 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 :)
> _______________________________________________
> Axl mailing list
> Axl at lists.aspl.es
> http://lists.aspl.es/cgi-bin/mailman/listinfo/axl
More information about the Axl
mailing list