mardi 12 juillet 2016

SAX Parser : parsing XML having "/&gt" and "/&lt" inside the XML element

While parsing an XML file which contain &gt and &lt data.

Data in XML: <details>Name=&lt;myName&gt;,Group=1,Domain=&lt;DomainId&gt;..&lt;oPC&gt;,Address=&lt;myAddress&gt;</details> Response after parsing : <details>Name=<myName>,Group=1,Domain=<DomainId>..<oPC>,Address=<myAddress></details>

We are replaced all &lt by "<" and &gt by ">" as this is standard way of parsing XML.

But, this data is invalid as it contains '' and we get exception Element type "myName" must be followed by either attribute specifications, ">" or "/>".

Do we need to manually replace "" while parsing data ?

Aucun commentaire:

Enregistrer un commentaire