View difference between Paste ID: kCc1twyB and vxSDLpUf
SHOW: | | - or go back to the newest paste.
1
#include <stdio.h>
2
#include <string.h>
3
#include <libxml/xmlreader.h>
4
5
void main ()
6
{
7
	char *s = "<elem att1='foo' att2='bar'/>";
8
	
9
	xmlTextReaderPtr xml = xmlReaderForMemory (s, strlen(s), NULL, NULL, 0);
10
	
11
	while (xmlTextReaderRead (xml) == 1)
12
		while (xmlTextReaderMoveToNextAttribute (xml) == 1)
13
			while (xmlTextReaderReadAttributeValue (xml) == 1)
14
				printf ("%s\n", xmlTextReaderValue (xml));
15-
}
15+
}
16
17
/* Compile with gcc -o attributevalue attributevalue.c `pkg-config --cflags --libs libxml-2.0` */