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



_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to