Reputation: 93
Getting an XML result set from WSO2 Data Services Server the special characters inside fields are not escaped, for example "&" is returned as "&", ">" is returned as ">" and so on ...
Doing so, during the process of the XML returned from WSO DS Server (for example using the Streaming API for XML (StAX)), my classes crash because characters like &, >, < and so on are interpreted wrongly.
Exporting to XML the same database data with an intercative SQL tool I get the fields correctly escaped, for example "&" is returned as "&".
Please, how I can tell to WSO DS Server to return the special characters in the safe XML form, for example "&" as ""&" ?
Thank you in advance, Ivano C.
Upvotes: 0
Views: 723
Reputation: 614
That is a bit strange, because by default those characters should be properly escaped. Because, internally the data services code uses the XML libraries to set the values inside the XML elements, so they should be properly escaped, I've personally seen this happening properly. Can you double check the content that is returned from a response, for example, not viewing it from a web browser, because they show them in the viewable way, not the original data. Like, get the source of the page you're viewing or save it to a text file and check the contents.
Cheers, Anjana.
Upvotes: 0