Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Delphi header translation for Microsoft XmlLite

License

Notifications You must be signed in to change notification settings

dheijl/Delphi-XmlLite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delphi-XmlLite

Header translation for Microsoft XmlLite

Note: This is a minimal translation, some parts were not implemented and most are untested.

Sample code taken from production. We use this to generate very large (>1GB) Xml files from an array of temporary files.

procedure AppendFile(const FileName: string; _IXMLWriter: IXMLWriter);
var
  _IXMLReader: IXMLReader;
  NodeType: Integer;
  LocalName: PWideChar;
  LocalNameLen: LongWord;
begin
  _IXMLReader := CreateXmlFileReader(FileName);
  while not _IXMLReader.IsEOF do
  begin
    _IXMLReader.GetLocalName(LocalName, LocalNameLen);
    if (LocalName = 'SecondLevelNodeName') then
      _IXMLWriter.WriteNode(_IXMLReader, True)
    else
      _IXMLReader.Read(NodeType);
  end;
end;

procedure CombineXmlFiles(const FileName: string; TempXmlFileArray: StringArray);
var
  _IXMLWriter : IXMLWriter;
  iCounter: Integer;
begin
  _IXMLWriter := CreateXmlFileWriter(FileName);

  _IXMLWriter.SetProperty(XmlWriterProperty_Indent, LongInt(True));

  _IXMLWriter.WriteStartDocument(XmlStandalone_Omit);
  _IXMLWriter.WriteStartElement(nil, PWideChar('RootNodeName'), nil);

  for iCounter := 0 to High(TempXmlFileArray) do
    AppendFile(TempXmlFileArray[iCounter], _IXMLWriter);

  _IXMLWriter.WriteEndElement;
  _IXMLWriter.WriteEndDocument;
  _IXMLWriter.Flush;
end;

About

Delphi header translation for Microsoft XmlLite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 63.1%
  • Pascal 36.9%