I have a xml file as below:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<RULES>
<RULE DESCRIPTION="" DOMAIN="CAE" NAME="Filter1 " TYPE="FILTER">
<ATTRS>
<ATTR RULE_NAME="myFilter1" />
</ATTRS>
</RULE>
<RULE DESCRIPTION="" DOMAIN="CAE" NAME="Skip1" TYPE="SKIP">
<ATTRS>
<ATTR RULE_NAME="mySkip1" />
</ATTRS>
</RULE>
<RULE DESCRIPTION="" DOMAIN="CAE" NAME="Filter_new " TYPE="FILTER">
<ATTRS>
<ATTR RULE_NAME="myFilter1" />
</ATTRS>
</RULE>
<RULE DESCRIPTION="" DOMAIN="CAE" NAME="Skip_new" TYPE="SKIP">
<ATTRS>
<ATTR RULE_NAME="mySkip1" />
</ATTRS>
</RULE>
</RULES>
How can I parse this file using SAXParser (in C++) such that I am able to extract the value of RULE_NAME attribute only if the TYPE attribute has a value “FILTER”.
I can do this using the DOMParser but I would like to use SAXParser.
you can use to compair attributes as m doing “data” which is the child attributes. hope this works