summaryrefslogtreecommitdiff
path: root/packages/fcl-xml/src/xmlwrite.pp
Commit message (Collapse)AuthorAgeFilesLines
* * Patch from Graeme Geldenhuys to check for XMLDocument before typecasting itmichael2010-11-261-7/+10
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16443 3ad0048d-3df7-0310-abae-a5850022a9f2
* xmlwrite.pp, htmwrite.pp: replaced inheritance by composition. TxxxWriter ↵sergei2010-08-081-42/+25
| | | | | | always writes to a TStream (or its descendant), and for text files we use a simple TStream-compatible wrapper. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15755 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Fixed CDATA section splitting which got broken due to excessive ↵sergei2010-01-141-1/+1
| | | | | | optimization in r14194. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14648 3ad0048d-3df7-0310-abae-a5850022a9f2
* XML writer:sergei2009-11-151-51/+83
| | | | | | | | * Moved line ending processing from the encoder to a higher level; without this, implementing/using external encoders is very problematic. + Implemented line ending processing for c14n mode. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14194 3ad0048d-3df7-0310-abae-a5850022a9f2
* + More c14n conformance in the writer:sergei2009-11-151-4/+39
| | | | | | | | | * dedicated procedure for writing the document node; * no indenting in c14n mode; * ignore Specified property of the attributes in c14n mode. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14192 3ad0048d-3df7-0310-abae-a5850022a9f2
* XML writer: split CDATA sections at the ']]>' sequence.sergei2009-11-151-1/+15
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14186 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Changed TSpecialCharCallback from method into a regular procedure, this ↵sergei2009-10-171-26/+33
| | | | | | | | | allows to drop all the {$ifdef fpc}@{$endif} ugliness. * Also changed TSpecialCharCallback to take the string and the index, so it can process certain sequences, not only single chars. * In canonical mode, CDATA sections are written as text. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13906 3ad0048d-3df7-0310-abae-a5850022a9f2
* XML writer: write namespace declarations before attribites and optionally ↵sergei2009-10-171-28/+120
| | | | | | sort them as required by c14n. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13894 3ad0048d-3df7-0310-abae-a5850022a9f2
* xmlwrite.pp: c14n compliance: write whitespace after PI name only if its ↵sergei2009-10-131-2/+5
| | | | | | data is not empty git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13856 3ad0048d-3df7-0310-abae-a5850022a9f2
* + XML writer now performs the namespace normalization.sergei2009-10-011-3/+89
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13789 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Base units of the package now can be compiled also with Delphi, patch from ↵sergei2009-08-301-1/+1
| | | | | | Dariusz Mazur (with some modifications). git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13627 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Undid previous patch, because not all compilesmichael2009-08-271-4/+2
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13603 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Patch from Dariusz Mazur to fix compilation with Delphimichael2009-08-271-2/+4
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13602 3ad0048d-3df7-0310-abae-a5850022a9f2
* XML/HTML writers, handle denormalized line-ending sequences (#13 and ↵sergei2009-06-081-1/+6
| | | | | | #13#10), fixes #13879. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13247 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Patch from Sergei Gorelkin:michael2008-02-131-74/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fcl-xml/src/dom.pp: resolved a number of Level 1 conformance issues: * Node.Normalize always deletes empty text nodes * Node.Normalize is recursive into Attributes * Node.InsertBefore corrected exception code in case when RefChild is not one of node's children + Node.InsertBefore added missing check for possible cycle in tree + Node.AppendChild and Node.InsertBefore added checking type of NewChild + CloneNode enabled for Fragment and Entity - CloneNode deleted for DocumentType (w3 specs directly prohibit cloning it between documents, and cloning within one document is claimed 'implementation specific' - but makes no sense). + Node.ImportNode is now working * Uncommented Level 2 node properties (NamespaceURI, localName and Prefix), this caused a name clash and a lot of function argument renames. fcl-xml/src/xmlutils.pp: + overloaded IsXmlName() that accepts PWideChars fcl-xml/src/xmlconf.pp * Applied a fix similar to xmlcfg.pp for Mantis #10554 fcl-xml/src/xmlread.pp: * Major: Got errors reported at correct locations for all 1600+ negative tests. Easy to say, but it required modifying almost every second line of code. * TContentParticle references an existing element definition instead of storing its own name (this allows content model matching without string comparisons). * Resorted to old-style 'object' for TElementValidator and to plain procedures for decoders (allows to drop almost all related memory management). * Moved parameter entity detection from char to token level, this simplifies things a bit. + Added second level of buffering to input source (a step towards supporting arbitrary encodings). * The main parsing loop contains no implicit exception frames now. fcl-xml/src/xmlwrite.pp * Replaced the stupid indenting algorithm with a simple rule: "Do not write indents adjacent to text nodes". Now it does not make a mess out of the documents which were parsed with PreserveWhitespace=True. * Use specialized node properties instead of generic ones, this eliminates WideString copies and results in almost 2x performance boost in Windows. * Even more performance: * Write line endings together with indents -> twice less calls. * Increase slack in buffer and write strings with known length (i.e. most of markup) without overflow checking. fcl-xml/tests/xmlts.pp: * Use parser options instead of dedicated procedure to 'canonicalize' documents, the parser has become mature enough to do that. * Fatal error in non-valid category is a test failure, as well as validation error alone in not-wellformed category. fcl-xml/src/README * Brought a bit up to date fcl-xml/tests/README + Added testsuite errata/issues git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@10314 3ad0048d-3df7-0310-abae-a5850022a9f2
* * mode objfpc addedpeter2008-01-241-4/+0
| | | | | | | * remove old fpmake git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@9910 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Fixed issue 9528 with patch from Sergei Gorelkinmichael2007-08-311-1/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@8343 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Patch from Sergei Gorelkinmichael2007-03-081-6/+9
| | | | | | | | | | | | | | | + DTD validation + Correct reporting of the position of most fatal errors + TDOMDocument.CreateElement and others check their arguments for validity (INVALID_CHARACTER_ERR is reported where specification says) + property TDOMAttr.DataType + implemented TDOMDocument.GetElementByID * Common code moved to xmlutils.pp * whitespace in PublicID literals is normalized git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@6749 3ad0048d-3df7-0310-abae-a5850022a9f2
* * move fcl sources to separate packagespeter2007-02-251-0/+626
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@6655 3ad0048d-3df7-0310-abae-a5850022a9f2