[fpc-devel] XML Stream capacity

Leonardo M. Ramé martinrame at yahoo.com
Thu Jan 14 15:34:49 CET 2010


I'm using fcl-xml to parse a XML data from a TMemoryStream/TStringStream and noted it can parse streams with a maximum capacity of 4096 bytes, why can't it receive bigger streams?.

The maximum capacity is defined in the constructor of TXMLStreamInputSource, in XMLRead.pp.

-------------------------------
constructor TXMLStreamInputSource.Create(AStream: TStream; AOwnStream: Boolean);
begin
  FStream := AStream;
  FCapacity := 4096; <-- here's the max capacity allowed
  ...
-------------------------------

My testing code is this:

var
  lDoc: TXMLDocument;
  lStr: TStringStream;
begin
  lStr := TStringStream.Create(Memo1.Text);
  lDoc := TXMLDocument.Create;
  try
    ReadXMLFile(lDoc, lStr);
  finally
    lDoc.Free;
    lStr.Free;
  end;
end.

Leonardo M. Ramé
http://leonardorame.blogspot.com


      



More information about the fpc-devel mailing list