Clean up filenames from XML
Posted: Fri Sep 01, 2017 4:33 am
An XML is sent to Switch, and that is the first point that I have any control over what is sent. There's no ability (or interest) upstream to help me here.
As the information is in the XML, and XML can't have certain characters in it, then I have trouble injecting jobs.
Example filename in the XML
Related file on the file server that I need to inject
I'm looking to pull the XML path into private data, clean it up, then call Inject using the clean name. It is not just &, it is any symbol that can't be rendered in XML in plain text.
I've gone several ways and fallen every time. I'm sure others must have come across this issue but I've not found anything on line.
Any help greatly appreciated.
As the information is in the XML, and XML can't have certain characters in it, then I have trouble injecting jobs.
Example filename in the XML
Code: Select all
foo/bar/baz&bazz.pdf
Related file on the file server that I need to inject
Code: Select all
foo/bar/baz&bazz.pdf
I'm looking to pull the XML path into private data, clean it up, then call Inject using the clean name. It is not just &, it is any symbol that can't be rendered in XML in plain text.
I've gone several ways and fallen every time. I'm sure others must have come across this issue but I've not found anything on line.
Any help greatly appreciated.