About | Contact | Impressum

Home |  Code |  Articles |  Misc |  x
XML Parser |  TAR Library |  Linked Lists |  WinSock 1.1 |  x
General |  Downloads |  Documentation |  History |  x

XML Parser Version History

This is the complete version history of the XML Parser:

2019-11-22 XML Parser 2.0.5

Introduced the PresetEncoding method and the IgnoreEncoding boolean property:

When you have loaded your XML file to a Delphi string (= UnicodeString) or to a TStringList, it is already encoded in Unicode UTF-16. The LoadFromString and LoadFromStrings methods convert this to a UTF-8 string internally and pass that to the parser. In this case, the encoding must be forced to be UTF-8 (which is what PresetEncoding is used for) and the encoding in the XML prolog must be ignored (which is what IgnoreEncoding controls).

Please note that using LoadFromString/s for large XML is inefficient, because the XML will be re-encoded to UTF-8 internally (the parser is unable to parse UTF-16). So if you have large XML files, it is better to use LoadFromFile or LoadFromStream.

The XML Reader Demo has also been changed to correctly use the new functionality.

2019-02-28 XML Parser 2.0.4

Bugfix in TXmlParser.LoadFromStream: there was an off-by-one bug, where the terminating null character (#0) was written one byte beyond the buffer. This was fixed.

If you use the LoadFromStream method, you should update to the new version. The other LoadXxx methods are not affected by this bug.

2019-01-22 XML Parser 2.0.3
  • Bugfix in TXmlParser.LoadFromStream that could lead to memory leaks (thanks to Fanis for finding this bug)
  • As LoadFromFile, LoadFromBuffer, LoadFromString, and LoadFromStrings do not call LoadFromStream, the memory leak didn't occur when you used of these
  • Released an updated version of the XML Reader demo application for the new Unicode Delphi and Parser
XML Parser 1.0.21
  • Includes a warning to users of the Unicode versions Delphi to rather use the Unicode aware version LibXmlParserU of the parser
2016-10-31 XML Parser 2.0.2
  • Fully Unicode aware, now named LibXmlParserU.pas
  • Usable from Delphi 2009 onwards (Delphi 2009, 2010, XE, 10)
2010-10-12 XML Parser 1.0.20
  • Checked for compatibility with the new Delphi XE. No changes to the parser code were necessary.
  • Included a $MODE for FreePascal compatibility. Thanks to Daniel Gaspary for the hint.
  • CurContent is not reset to an empty string with every start tag. I will keep this behaviour so old code doesn't get broken. In case you need this you can set CurContent yourself at every start tag.
  • Package file review for Delphi 7 and Delphi 2007 to XE
2009-12-31 XML Parser 1.0.19
  • Reworked attribute value normalization to better conform to XMLSpec 3.3.3 (Third Edition). Deleted the ReplaceGeneralEntities method, which is not needed anymore. 
    There are still problems when an external parsed entity has another character set than the one used by the root document.
  • TXmlParser: Added a new virtual method TranslateCharacter to translate Unicode character references. 
  • TXmlScanner: Added a new event OnTranslateCharacter to translate Unicode character references. 
  • Handle UTF-8 files that contain a Byte-Order-Mark (BOM). The BOM is now recognized and skipped.
  • Switch compiler options $R (Range Checking) and $B (Complete Boolean Evaluation) off for the parser
  • Set UTF-8 as default encoding in .Clear (the XMLSpec says that UTF-8 is the default for XML files that don't specify an encoding)
  • Changed old comments referring to "PackSpaces" to "Normalize"
  • Reworked IFDEF section at the top to better reflect Kylix, C++Builder, Delphi 8, and Delphi 2005/2006/2007. This should now work with the future versions of Delphi without giving an error everytime a new version comes out.

Delphi 2009/2010 compatibility

Delphi 2009 introduced Unicode to the world of Delphi by providing a new string type "UnicodeString", which is a UTF-16 string and using that as the standard and fixed definition for the "string" type. The whole VCL and Delphi runtime libraries are now based on this string type.

However, rewriting the parser to use this type would have been quite difficult, especially when the code has to be backwards compatible to the older Delphi versions. So I decided to stay with the AnsiString interface. This makes it possible to use the parser in Delphi 2009/2010, but it's neither handy nor very elegant. I also rewrote the demo programs (XmlReader and XmlScannerDemo) to be compatible with all supported Delphi versions (all Win32 Delphi compilers starting from Delphi 4).

My goal is to do a complete rewrite for UnicodeString, which will then also correctly support all aspects of Unicode. (However, I can't tell you when that will happen, maybe at another holiday season?)

Kylix compatibility

I didn't test this new code with Kylix. So if you still work with Kylix you can try to use the new version and give me feedback about how it does. In case it doesn't work anymore you can still download the old version 1.0.17.

C++Builder compatibility

I don't own C++Builder so I can't say anything about it. As C++Builder has the Delphi language compiler built in, everything should work fine. If it doesn't, please send me a mail so we can sort things out.

XML Parser 1.0.18

This got never released. I sent out beta versions to a few people so I decided to skip this version number in order to avoid version number confusion.

2003-03-04 XML Parser 1.0.17

Included support for Delphi 7 (VER150). New package files for D7 and K3. There is a new compiler symbol HAS_CONTNRS_UNIT which is used now to distinguish between IDEs which come with the Contnrs unit (D5 and up) and those that don't.

2002-06-26 XML Parser 1.0.16

Fixed a bug in TXmlParser.Scan with Processing Instructions whose target name is beginning with 'xml'. Thanks to Uwe Kamm for submitting this bug. 

The CurEncoding property is now stored always in uppercase letters. The XML spec wants encoding identifiers to be treated case independently. So comparisons are faster when it's always stored in uppercase.

2001-12-05 XML Parser 1.0.15

Thanks to another tip from Svatopluk Cech I changed the code so that the need for frequent re-allocation of pointer buffers is reduced which should speed up your code.
Please note that this still only applies to Delphi 4 users.

I dedicate this version to my father, who turned 66 today.

2001-12-03 XML Parser 1.0.14
  • Don't clear CurName anymore when the parser finds a CDATA section.
  • TObjectList.Clear: Make call to INHERITED method (fixes a memory leak)
    Note: This leak has only occured if compiled with Delphi 4 (in Delphi5/6, the Contnrs unit's TObjectList is used)
2001-09-03 I checked if the parser compiles and runs in Delphi 6 (D6). It does. So I took the time and included a D6 package file (XmlComponents_D6.dpk) into the xmlparser.zip. Nothing else has changed.
2001-07-14 XML Parser 1.0.13
  • Fixed a bug in TCustomXmlScanner which lead to stack overflows due to two procedures calling each other recursively in an endless loop. 
  • Added a package (.dpk) file for Kylix 1
2001-07-11 TXmlParser 1.0.12
  • Added the TCustomXmlScanner component, which is a component wrapper for TXmlParser. 

TXmlScanner 1.1.0

  • Is now a descendant of the new TCustomXmlScanner. I hope that this resolves the remaining C++Builder issues (and does not introduce new ones).
  • All Filename properties and parameters have changed from STRING to TFilename type. So if you have a property editor for TFilename installed, it gets used.

TEasyXmlScanner  <NEW/>

  • This new component is a descendant of TCustomXmlScanner, which only publishes those events which you are most likely to use for "normal" XML files. So there are less entries in the Object Inspector.
  • For CDATA sections, there is the OnContent event triggered, so you only have to answer this one.

TXmlParser 1.0.11

  • Extended the conditional defines section for Kylix 1 awareness (no other changes to the code have been necessary)

Xml Reader Demo

  • Somewhat enhanced
  • I will soon publish a Kylix version of the demo. However, there are not a lot of changes needed. So you could also try yourself until then. 

TXmlParser 1.0.10

  • Introduced Conditional Defines for Delphi version
  • Uses Contnrs unit and its TObjectList class again for Delphi 5 and newer versions
  • Introduced Version Numbering
  • Made LoadFromFile and LoadFromBuffer BOOLEAN functions
  • Introduced FileMode parameter for LoadFromFile
  • BugFix: TAttrList.Analyze: Must add CWhitespace to ExtractName call
    (Hey, why didn't anybody complain on this one?)
  • Comments worked over
  • Completely worked over and tested the UTF-8 functions
  • Fixed a bug in TXmlParser.Scan which caused it to start over when it was called after the end of scanning, resulting in an endless loop.
    Thanks to Mike Duff for the tip.
  • TEntityStack is now a TObjectList instead of TList

TXmlScanner 1.0.2

  • Changed prototype for the TExternalEvent callback function type so that C++Builder users should get it compiled better.
  • NOTE: Developers who used the OnLoadExternal event will have to change the call.
  • Introduced the "StopParser" property. When you set this property to TRUE in one of the Parser Events, parsing is stopped and the Execute method returns.
  • Introduced Version numbers
2000-07-29 TXmlParser: Added methods to simplify access to attribute lists. Adapted the XmlScannerDemo. Partly reworked the site.
2000-07-28 Documentation restructured. Thanks to Rajeev Rajan for the documentation on installing and using the parser in C++ Builder 5.
2000-07-27 Demo program and documentation for the TXmlScanner VCL component. New TXmlScanner source code.
2000-07-11 New "features" section on this page. LibXmlParser: Removed "Windows" unit from USES clause, added a few '!!!' comments
2000-06-20 xmlreader.zip: Changed the DFM file to be in binary format so D4 users can read it. Thanks to Simon Bond, UK, for the hint.
2000-04-23 LibXmlParser: Deleted the reference to the 'Contnrs' unit. The parser can now also be compiled with Delphi 4. Thanks to David Cresswell, UK, for giving me hints and assistance in making the parser D4 compatible.
The XML Reader demo has also been changed to be D4 compatible. There is also a new zip file with the executable.
2000-04-04 Small changes to the parser, one bug fixed (please refer to the history in the source)
2000-03-31 Finished Reference Documentation, new VCL parser TXmlScanner (built upon TXmlParser)
2000-03-30 Documentation, new version of Parser (bug fixed: Also translate Encoding of CDATA sections)
2000-03-28 Initial Version published