Function parse_sap_atom_feed::xml::sanitise_xml
source · pub fn sanitise_xml(xml: String) -> StringExpand description
CORRECT FORMATTING ERRORS IN RAW XML
When reading certain entity sets from SAP’s demo OData service GWSAMPLE_BASIC, various formatting errors have been
noticed that will cause an XML parser to throw its toys out of the pram.
Whether these errors alsop occur in other SAP-delivered Odata services has not been determined; however, coding is included here to correct those errors detected so far in GWSAMPLE_BASIC
-
Correct potentially invalid
m:etagattribute values on an<entry>tag:<entry m:etag="W/"datetime'2023-08-31T01%3A00%3A06.0000000'"">Is corrected to:
<entry m:etag="datetime'2023-08-31T01%3A00%3A06.0000000'"> -
Entity set content properties containing text descriptions are not enclosed in double quotes, neither is it the convemtion to escape or character encode special characters. E.G.:
<d:Category>PDAs & Organizers</d:Category>Is corrected to:
<d:Category>PDAs & Organizers</d:Category>