A company is supplying an XML file which can't be read as an XMLTYPE because it doesn't have a proper header. We aren't able to get them to amend it and I'd prefer not to amend it ourselves with an operating system script, although that would be the last resort.
As they will be supplying files like this on an ongoing basis, is there a way in the database to wrap the following header and footer around the XML file?
Header at the start: xmltype('<?xml version="1.0" encoding="ISO-8859-1"?><route>')
The file: This would be xmltype(bfilename('IMPORT_DIR', 'test_file.xml'), nls_charset_id('ISO-8859-1')) except it doesn't work as an XMLTYPE at the moment due to not having a valid header. Therefore we just have a file called test_file.xml which I need to wrap a header and footer around.
Footer at the end: xmltype('</route>')
I know the correct way would be to get the company fix the rubbish they are sending us but it isn't an option.