cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Eastmond <tome...@gmail.com>
Subject FileUtils.getStringFromFile issue when using XML
Date Mon, 02 May 2011 16:35:54 GMT
I was using the FileUtils.getStringFromFile() method for some Camel
testing and was receiving a SAXParseException: The processing
instruction target matching "[xX][mM][lL]" is not allowed.].

It turns out that this was due to the was due to the
FileUtils.normalizeCRLF() method which replaces whitespace characters
(\s) with two spaces. This method appends leading spaces to the
contents (before the <?xml version="1.0" encoding="UTF-8"?> in this
case) which chokes the XML parser. Would it be feasible to forgo the
leading spaces at the start of a file in order to avoid this issue?
I'd be happy to submit a test case/patch if this seems like a valid
bug/fix. Please let me know if I should use another forum for this
request.

Thanks for the excellent work,

Tom Eastmond

Mime
View raw message