1. Simone Olianti
  2. PowerBuilder
  3. Friday, 24 August 2018

Hi there, is there an easy way in POwerBuilder to "sanitize" a XML string?
I need an advice to exclude all not valid xml unicode characters from a string

any help would be appreciated

tia

Accepted Answer
Bruce Armstrong Accepted Answer Pending Moderation
1
Votes
Undo

We use one of the OWASP Sanitizers to validate input to our applications.  What we ended up doing was installing it in the database (Oracle) and then calling it through a stored procedure (Oracle can create PL/SQL wrappers for java code in the database).

The OWASP HTML Sanitizer may do the trick for you if you can take that  approach.

https://www.owasp.org/index.php/OWASP_Java_HTML_Sanitizer_Project

There are other ways of calling Java code from PowerBuilder, the stored procedure method works best for us because it doesn't require anything special on the client.

Comment
There are no comments made yet.
  1. Friday, 24 August 2018
  2. PowerBuilder
  3. # Permalink
Chris Pollach Accepted Answer Pending Moderation
1
Votes
Undo

Hi Simone;

  FWIW: the only way that I have done this in the past is to process the XML file via PB's PBDOM feature and then use the POS() method looking for these extraneous characters as the App processes each element's data stream.

Regards ... Chris

Comment
There are no comments made yet.
  1. Friday, 24 August 2018
  2. PowerBuilder
  3. # 1
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.