[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-users
Subject:    Re: [jibx-users] \r\n problem
From:       Dennis Sosnoski <dms () sosnoski ! com>
Date:       2004-09-22 4:29:16
Message-ID: 4150FF9C.1030507 () sosnoski ! com
[Download RAW message or body]

Harrie Hazewinkel wrote:

> Dennis Sosnoski wrote:
>
>> Hi Stefano,
>>
>> This normalization is actually required by XML. Here's the relevant 
>> part of the document (http://www.w3.org/TR/2000/REC-xml-20001006):
>>
>> -----------------------------------------------------------------
>> 2.11 End-of-Line Handling
>>
>>
>> XML parsed entities are often stored in computer files which, for 
>> editing convenience, are organized into lines. These lines are 
>> typically separated by some combination of the characters 
>> carriage-return (#xD) and line-feed (#xA).
>>
>>
>> To simplify the tasks of applications, the characters passed to an 
>> application by the XML processor must be as if the XML processor 
>> normalized all line breaks in external parsed entities (including the 
>> document entity) on input, before parsing, by translating both the 
>> two-character sequence #xD #xA and any #xD that is not followed by 
>> #xA to a single #xA character.
>> -----------------------------------------------------------------
>>
>> There's no way to change this behavior, since it is a required (note 
>> the use of "must" above) part of the standard. Is the problem in your 
>> processing software, or when you output something? JiBX does not 
>> force generated output to follow this rule, since it's not a 
>> requirement of the actual XML document format but rather on the parser.
>>
>
> Sorry for jumping into this after a month. (I just was bitten by
> this issue also while using Sync4j.
>
> You state the above piece of the standard. Maybe you are right, but
> it does not really state if this also applies to the 'payload/data'
> between 2 XML tags. In that case it means that 'data' is changed
> and I cannot believe that was the intent of the standard.
>
Hi Harrie,

I know that this is can be a difficult issue if it takes you by 
surprise, but as I understand it XML truly does require this behavior - 
note that the text says "normalize all line breaks", where "all" really 
does mean *all*.

The only way I know to get around this is to modify a parser to disable 
this behavior for your needs. You could probably do that fairly easily 
with the XPP3 parser used by default with JiBX.

  - Dennis



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic