Created
September 12, 2012 16:49
-
-
Save abhinavsingh/3708041 to your computer and use it in GitHub Desktop.
JAXLXml example for appending a child node using cnode($node) api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./jaxlctl shell | |
jaxl 1> $xml_obj = new JAXLXml('message', 'jabber:client', array('to'=>'[email protected]')); | |
jaxl 2> echo $xml_obj->to_string(); | |
<message xmlns="jabber:client" to="[email protected]"></message> | |
jaxl 3> | |
jaxl 3> $child = new JAXLXml('body', null, array(), 'Hello World!'); | |
jaxl 4> echo $child->to_string(); | |
<body>Hello World!</body> | |
jaxl 5> | |
jaxl 5> $xml_obj->cnode($child); | |
jaxl 6> echo $xml_obj->to_string(); | |
<message xmlns="jabber:client" to="[email protected]"><body>Hello World!</body></message> | |
jaxl 7> | |
jaxl 7> quit | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment