summaryrefslogtreecommitdiff
path: root/packages/fcl-xml
Commit message (Collapse)AuthorAgeFilesLines
* * Patch from Inoussa to fix AV in certain cases michael2011-03-261-1/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@17184 3ad0048d-3df7-0310-abae-a5850022a9f2
* * sax_html.pp, ignore markup in STYLE and SCRIPT elements, Mantis #18826sergei2011-02-261-34/+61
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@17003 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Cleanup ParseContent()sergei2011-02-231-34/+17
| | | | | | | | | - XMLVersion property has been made available in TDOMDocument, removed inheritance check. * Improved parsing the content model a bit * Cleanup comments git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16987 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp: split handling of node and validation stacks. Validation stack ↵sergei2011-02-221-54/+47
| | | | | | is now maintained only in validation mode. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16973 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, remove FCursorStack and resort back to a single cursor node. ↵sergei2011-02-211-82/+63
| | | | | | But this time it is simply a local variable. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16962 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, continue separating validation checks from the rest of code.sergei2011-02-212-54/+50
| | | | | | * Fixed reported locations for (hopefully) all namespace-related errors. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16959 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, started separating validation checks from the rest of code.sergei2011-02-201-72/+91
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16946 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, the end of root element is now detected without involving DOM ↵sergei2011-02-191-3/+5
| | | | | | nodes. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16942 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, handle entity references in streaming style.sergei2011-02-181-42/+107
| | | | | | * Renamed TXMLCharSource.DTDSubsetType to Kind and changed its definition to reflect its purpose better. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16932 3ad0048d-3df7-0310-abae-a5850022a9f2
* + fcl-xml, initial implementation of 'shared' DTD: it now consists of the ↵sergei2011-02-143-136/+329
| | | | | | model (classes TDTDModel, TEntityDecl, TNotationDecl), which is referenced by one or more TDOMDocumentType nodes. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16914 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Don't mess with DOM stuff in TXMLReader.ParseXmlOrTextDecl. Instead, put ↵sergei2011-02-131-29/+22
| | | | | | | | declaration attributes into fields of FSource, and copy them to DOM objects later. * Small improvement to CheckMaxChars. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16913 3ad0048d-3df7-0310-abae-a5850022a9f2
* - dom.pp, removed TDOMNamedNodeMap.FNodeType field. This reduces memory ↵sergei2011-02-091-11/+11
| | | | | | requirements. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16901 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlcfg.pp, changed 'exit' to 'break' so that function won't exit without ↵sergei2011-01-231-1/+1
| | | | | | result assigned, Mantis #18589 git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16803 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, fixed condition that was causing an infinite loop in case when ↵sergei2011-01-151-1/+1
| | | | | | a malformed xml contained a null character within whitespace (to be exact, within parts processed by SkipS procedure). Great thanks to alexs75 for finding and supplying such xml file :) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16766 3ad0048d-3df7-0310-abae-a5850022a9f2
* * 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
* * unit xmlcfg.pp marked as deprecated.sergei2010-11-061-1/+4
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16307 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp: separated DOM-specific code into DoStartElement(); introduced ↵sergei2010-10-311-32/+41
| | | | | | FNameTable. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16270 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp: maintain ID map at reader side, so it can do ID/IDREF ↵sergei2010-10-303-17/+43
| | | | | | | | validation without DOM. * also don't allocate TForwardRef records for backward references, saves some ticks and bytes. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16264 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp: since FIdRefs and FNotationRefs are never used at the same ↵sergei2010-10-301-25/+21
| | | | | | time (the former is used only while parsing root, the latter only while parsing DTD), simplify things a bit by replacing them with a single FForwardRefs. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16259 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, implemented some c14n features: when parsing with ↵sergei2010-10-291-22/+41
| | | | | | Options.CanonicalForm=True, report all attributes as specified and drop superfluous namespace declaration attributes. Fixes level3/ls/canonicalform10 and level3/ls/canonicalform11. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16253 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, fixed an issue introduced by combination of r16046 and r16172: ↵sergei2010-10-281-1/+7
| | | | | | assigning doc.DocumentType only after DTD has been completely parsed prevented inner reader from parsing 2nd+ level entity references in default attribute values. This went unnoticed because of no positive tests, and was detected only by examining negative test diagnostic, namely for not-wf-sa-079 and not-wf-sa-080. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16248 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, added location information to TNodeData and got ↵sergei2010-10-272-8/+23
| | | | | | namespace-related errors reported at correct locations. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16234 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, modified attribute parsing code to use DOM-independent data ↵sergei2010-10-274-148/+176
| | | | | | | | | | | | structures (third part) * Namespace handling rewritten to fit into XMLReader's own data structures. * Remaining TDOMElementDef's replaced by TElementDecl. * Removed DoAttrText(), it has become obsolete. * Create objects that are needed for namespace processing only if actually doing namespace processing, reduces memory requirements. * Improved TAttributeDef construction. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16230 3ad0048d-3df7-0310-abae-a5850022a9f2
* + New unit dtdmodel.pp containing DTD-related classes.sergei2010-10-256-402/+623
| | | | | | | | | | * TXMLNodeType, TNodeData and TAttrDataType moved to xmlutils.pp, so they can be shared between dom, xmlread and dtdmodel. * TContentParticle class moved from xmlread.pp to dtdmodel.pp. * dom.pp and xmlread.pp switched to DOM-independent representation of DTD element declarations and attribute defaults. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16221 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, continued reducing DOM dependencies:sergei2010-10-231-30/+49
| | | | | | | | | | * TContentParticle only stores and compares a pointer to an element definition, a particular type of that definition doesn't matter - so change it to TObject. * In case of mixed content model, assign Type and Quantity to the root content particle, and process it the same way as element-only models. * While parsing, store entities in THashTable instead of TDOMNamedNodeMap. * Assign Prefix to element and attribute NodeData. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16208 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, modified attribute parsing code to use DOM-independent data ↵sergei2010-10-192-102/+93
| | | | | | | | | | | structures (second part) * ExpectAttValue() now builds both plain string value and first-level node chain. * Normalize() procedure moved to xmlutils.pp and made publicly available as BufNormalize. * ParseLiteral() cleaned of attribute-specific code; at this point it is clear it won't be used for parsing attributes. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16186 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, modified attribute parsing code to use DOM-independent data ↵sergei2010-10-181-19/+69
| | | | | | structures (first part) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16184 3ad0048d-3df7-0310-abae-a5850022a9f2
* xmlread.pp, r16175 caused a regression in level1/core/commentgetcomment; we ↵sergei2010-10-181-1/+2
| | | | | | should ignore comments in DTD, but not between DTD and root element. Fixed. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16183 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, do some cleanup and get rid of FCursor field.sergei2010-10-161-34/+21
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16175 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, doing progress with streaming API:sergei2010-10-151-34/+52
| | | | | | | * correct handling of comments, PIs and (partially) DocumentType git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16172 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, doing progress with streaming API:sergei2010-10-141-41/+170
| | | | | | | | | + state transitions needed to report start/end element events correctly + procedures for maintaining attribute data * excluded FCursor from attribute value parsing git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16161 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Fixed spell error revealed by lintian.mazen2010-10-061-1/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16094 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp: started implementing the streaming API, aka XmlTextReader from ↵sergei2010-10-051-48/+102
| | | | | | .net world. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16079 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, renamed all parameters and local vars named 'Name', 'Prefix', ↵sergei2010-10-041-38/+38
| | | | | | 'BaseUri' and 'Value', so it becomes possible to add properties with these names to TXMLReader without duplicate identifier errors. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16078 3ad0048d-3df7-0310-abae-a5850022a9f2
* * dom.pp, fixed TDOMText.SplitText() to use custom allocation, so newly ↵sergei2010-10-011-3/+5
| | | | | | created node won't leak if initial node has no parent . git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16072 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, a bit better separation of DOM-specific and DOM-independent ↵sergei2010-09-301-23/+20
| | | | | | code in ParseComment() and ParsePI(). git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16070 3ad0048d-3df7-0310-abae-a5850022a9f2
* * dom.pp, moved remaining TDOMAttr-specific code from TDOMNamedNodeMap to ↵sergei2010-09-291-21/+26
| | | | | | TAttributeMap. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16066 3ad0048d-3df7-0310-abae-a5850022a9f2
* + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 andjonas2010-09-292-5/+51
| | | | | | | | | | | | | | | later: the same as i386/darwin, except a) uses the non-fragile Objective-C ABI/runtime b) does not require stubs for direct calls/jumps (not required for i386/darwin under 10.6 and later either, but still generated there for backwards compatibility) c) only the same packages are enabled as for ARM/Darwin d) MacOSAll is compiled specifically for the iPhoneSimulator SDK This target also defines the symbol "darwin" apart from the target name "iphonesim" for source code compatibility reasons. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16065 3ad0048d-3df7-0310-abae-a5850022a9f2
* * dom.pp, moved default attribute handling code from TDOMNamedNodeMap to ↵sergei2010-09-281-40/+47
| | | | | | TAttributeMap. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16060 3ad0048d-3df7-0310-abae-a5850022a9f2
* sax_xml.pp: cleanup:sergei2010-09-261-20/+3
| | | | | | | | - remove duplicated code from constructor - use CreateXXXBuf to create DOM nodes, eliminates temporary string vars. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16049 3ad0048d-3df7-0310-abae-a5850022a9f2
* XML reader, forgot to pass current settings to the nested reader (although ↵sergei2010-09-261-1/+3
| | | | | | it doesn't seem to change test suite behavior). git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16048 3ad0048d-3df7-0310-abae-a5850022a9f2
* XML reader:sergei2010-09-261-37/+29
| | | | | | | | * Parse entities by creating another instance of TXMLReader. This is much more straightforward than saving/restoring context of the existing reader. * Fixed version setting logic so that ReadXMLFragment procedures are now suitable to read entities: accept streams conforming to extParsedEnt [78], correctly read fragments into documents having version=1.1. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16046 3ad0048d-3df7-0310-abae-a5850022a9f2
* * dom.pp, removed TDOMAttr.FOwnerElement field, storing owner element in ↵sergei2010-09-191-16/+34
| | | | | | FParentNode. This reduces memory requirements. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16014 3ad0048d-3df7-0310-abae-a5850022a9f2
* dom.pp:sergei2010-09-192-5/+37
| | | | | | | | | | * r15443 changed the node class with biggest instance size from TDOMAttr to TDOMEntity. Changed that in TDOMDocument constructor, too. Otherwise nodes created with TDOMEntity.CloneNode will leak (they cannot be inserted into tree). * Do not restore default attributes during document destruction. * Also added a general check that raises exception if someone tries to allocate from node pool during destruction. * Fixed replaceChild() method: it was deleting node if that node was replaced by itself. + Test for replaceChild. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16010 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, removed FRecognizePE field. Its functionality is replaced by ↵sergei2010-09-141-8/+1
| | | | | | checking other fields. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15984 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp: refactoring, no function chages:sergei2010-09-131-65/+56
| | | | | | | | | | * Renamed ParseElement to ParseStartTag to reflect its actual functionality * Changed ParseQuantity into function returning a enumeration type * Simplified TXMLDecodingSource.NewLine * Changed the main loop (ParseContent) so that multiple calls to DoText() are replaced by a single call. - Removed "if FCDSectinsAsText" branch in DoCDSect. It is obsolete since this case is handled in ParseContent. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15975 3ad0048d-3df7-0310-abae-a5850022a9f2
* * xmlread.pp, a misplaced assignment could cause a #13 character to pass ↵sergei2010-09-131-1/+1
| | | | | | non-normalized to #10 if it was the last character in input stream. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15974 3ad0048d-3df7-0310-abae-a5850022a9f2
* xmlwrite.pp, htmwrite.pp: replaced inheritance by composition. TxxxWriter ↵sergei2010-08-082-84/+48
| | | | | | 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
* sax_xml.pp:sergei2010-08-081-72/+79
| | | | | | | | | | * Applied counterpart of sax_html.pp r15564, eliminating redundant wide-to-ansi conversions; * AStart parameter of IgnorableWhitespace event should be zero, not 1; * XML is case-sensitive, removed calls to lowercase(); * Accumulate token characters in FRawTokenText, then convert it all at once to SAXString. Without it, handling multi-byte encodings like UTF-8 was impossible, because it was converting by individual bytes which always resulted in errors. Provides a partial fix for Mantis #16732. Also provides a single location to insert a proper decoding procedure. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15738 3ad0048d-3df7-0310-abae-a5850022a9f2
* xmlread.pp, moved decoder procedures to xmlutils.pp, so they can be reused ↵sergei2010-08-082-132/+142
| | | | | | by other code. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15737 3ad0048d-3df7-0310-abae-a5850022a9f2