Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <libxml/xmlreader.h>
- void main ()
- {
- char *s = "<elem att1='foo' att2='bar'/>";
- xmlTextReaderPtr xml = xmlReaderForMemory (s, strlen(s), NULL, NULL, 0);
- while (xmlTextReaderRead (xml) == 1)
- while (xmlTextReaderMoveToNextAttribute (xml) == 1)
- while (xmlTextReaderReadAttributeValue (xml) == 1)
- printf ("%s\n", xmlTextReaderValue (xml));
- }
- /* Compile with gcc -o attributevalue attributevalue.c `pkg-config --cflags --libs libxml-2.0` */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement