cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Eastmond <>
Subject Re: FileUtils.getStringFromFile issue when using XML
Date Tue, 03 May 2011 19:48:57 GMT
That would be great to get this fixed - should I create a defect? I'd
also love to not have it replace a single space with 2 spaces since
that has caught me by surprise in my testing as well. Let me know what
you'd like me to do.

Thanks again,
Tom Eastmond

On Tue, May 3, 2011 at 6:19 AM, Aki Yoshida <> wrote:
> Sorry,
> I realized this method has actually nothing to do with XML.
> please ignore my comments on XML normalization.
> regards, aki
> 2011/5/3 Aki Yoshida <>:
>> Hi,
>> you are right. The normalizeCRLF() method should not add an extra
>> space at the begining. We can fix this particular issue.
>> But there is one open question, as the exact purpose (use case) of
>> this method is not clear to me. Why do we need this normalization
>> method that just removes all the CRs and LFs and replace each
>> space/tab character with a single space and this method is
>> automatically called in FileUtils.getStringFromFile()?
>> Does someone else wants to have other normalization options such as
>> doing the standard xml white space "ignore" handling or the
>> end-of-line handling (i.e., replacing each CRLF pair to a single LF)?
>> Regards, aki
>> 2011/5/2 Tom Eastmond <>:
>>> 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

View raw message