Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002822 [JEDI VCL] 00 JVCL Components minor always 2005-03-30 12:54 2005-05-17 13:36
Reporter anonymous View Status public  
Assigned To jfudickar
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0002822: TJvAppXMLFileStorage.ReadString bug if string containsLineFeed characters
Description BUG: When the string to read contains linefeed chars (0000013#10),
      the leading whitespace is trimmed.

EXAMPLE:

var MULTILINE_STRING: string = 'line1 ' + 0000013#10 +
                               ' level1' + 0000013#10 +
                               ' level2' + 0000013#10;

procedure test(aStorage: TJvAppXMLFileStorage);
begin
  aStorage.WriteString('path', MULTILINE_STRING);
  aStorage.Reload;
  ShowMessage(aStorage.ReadString('path',''));
end;

Result: You should see the messagebox showing 2. and 3. lines with
wrong indents.(May this be the underlying XML component's bug)
Additional Information
Tags No tags attached.
Attached Files zip file icon JvXmlStorageWS_BUG.zip [^] (3,987 bytes) 2005-04-28 19:06

- Relationships
has duplicate 0003332resolvedelahn TJvSimpleXMLElemText.LoadFromStream doesn't preserve whitespace. 

-  Notes
(0007029)
muk (reporter)
2005-04-19 07:35

Nobody could reproduce ???
(0007082)
muk (reporter)
2005-04-28 19:09

Attached a sample...
(0007101)
jfudickar (developer)
2005-05-02 13:38

Hi,

i've looked into it now. But i didn't know why this is so implemented.

It's in the TJvSimpleXMLElemText.LoadFromStream

The problem is the following Case statement:

      case lBuf[I] of
        '<':
          begin
            //Quit text
            Dec(lStreamPos);
            Count := 0;
            Break;
          end;
        ' ':
          if lPos = 0 then
          begin
            Inc(lPos);
            St := St + ' ';
          end;
      else
        begin
          lPos := 0;
          St := St + lBuf[I];
        end;
      end;

All multiple blanks will be reduced to one blank. THis is not a problem of the start of line.

I didn't know, if this is a special requirement of xml.

Any further comments are welcome.

Greetings
Jens
(0007103)
muk (reporter)
2005-05-02 19:01

Neither do I know about standart way of whitespace handling in XML, but
IMHO TJvAppXMLFileStorage must be consistent.

For a quick fix, I check the string for CR/LF and use WriteStrings if so.
(0007104)
muk (reporter)
2005-05-02 19:02

By the way for XML standartization:
http://www.ucc.ie/xml/#space [^]
(0007109)
jfudickar (developer)
2005-05-05 01:18

Fixed in CVS.

Please give it a try.
(0007171)
muk (reporter)
2005-05-17 13:16

It seems OK now.

Sorry it' s a bit late, I forgot to answer. The case well may be closed.

- Issue History
Date Modified Username Field Change
2005-03-30 12:54 anonymous New Issue
2005-04-19 07:35 muk Note Added: 0007029
2005-04-28 19:06 muk File Added: JvXmlStorageWS_BUG.zip
2005-04-28 19:09 muk Note Added: 0007082
2005-05-02 13:38 jfudickar Note Added: 0007101
2005-05-02 19:01 muk Note Added: 0007103
2005-05-02 19:02 muk Note Added: 0007104
2005-05-05 01:18 jfudickar Note Added: 0007109
2005-05-05 01:18 jfudickar Assigned To => jfudickar
2005-05-05 01:18 jfudickar Status new => feedback
2005-05-17 13:15 muk Issue Monitored: muk
2005-05-17 13:15 muk Issue End Monitor: muk
2005-05-17 13:16 muk Note Added: 0007171
2005-05-17 13:36 jfudickar Status feedback => resolved
2005-05-17 13:36 jfudickar Fixed in Version => 3.00
2005-05-17 13:36 jfudickar Resolution open => fixed
2005-12-03 04:23 elahn Relationship added has duplicate 0003332


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker