I use libxml2 to parse the XML data, please see the raw data below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE payload [
<!ENTITY a "A">
]>
<payload>&a;&a;&a;</payload>
I am using unsigned long nbentities; /* number of entities references */ from the xmlParserCtxt object to count the total number of entities references, but get 5 in the above case which I think 3 is the correct answer.
Any ideas? Many thanks!