Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
2634 00 JVCL Components major always 2005-02-13 05:08 2005-02-13 07:13
remkobonte  
obones  
normal  
resolved  
fixed  
none    
none 3.00  
0002634: Unable to write strings that contain <,> or & chars with TJvAppXMLFileStorage
Code:

var
  S: string;
begin
  with TJvAppXMLFileStorage.Create(nil) do
  try
    FileName := 'temp';
    Xml.Options := Xml.Options + [sxoAutoEncodeValue, sxoAutoEncodeEntity];
    WriteString('\path1', '<TEST>');
  finally
    Free;
  end;

  with TJvAppXMLFileStorage.Create(nil) do
  try
    FileName := 'temp';
    Reload;
    Xml.Options := Xml.Options + [sxoAutoEncodeValue, sxoAutoEncodeEntity];
    S := ReadString('\path1');
    ShowMessage(S);
    // Exp: S = '<TEST>'
    // Act: Error
  finally
    Free;
  end;
end;
Possible fix:

Change all

  Xml.Options := [sxoAutoCreate, sxoAutoIndent];
  [..]
  Xml.Options := [sxoAutoIndent];

code in JvAppXMLStorage.pas to

  Xml.Options := Xml.Options + [sxoAutoCreate];
  [..]
  Xml.Options := Xml.Options - [sxoAutoCreate];
Issue History
2005-02-13 05:08 remkobonte New Issue
2005-02-13 07:13 obones Status new => resolved
2005-02-13 07:13 obones Fixed in Version => 3.00
2005-02-13 07:13 obones Resolution open => fixed
2005-02-13 07:13 obones Assigned To => obones
2005-02-13 07:13 obones Note Added: 0006480

Notes
(0006480)
obones   
2005-02-13 07:13   
Thanks for the feedback, this is now fixed in CVS.
I have introduced three new properties in the StorageOptions:
AutoEncodeValue
AutoEncodeEntity
AutoIndent

That have an impact on the options of the internal XML file, as their name suggest.
I also surfaced the OnEncode and OnDecode events from TJvSimpleXML, shall someone want to use them.
The online help has also been updated