From: Pavel V. <cz3...@ti...> - 2004-11-02 10:08:53
|
I took a look at TurboPower XML Partner which is Pascal implementation of= XML DOM (Document Object Model) and other XML related technologes like SA= X (event based) parser, xpath and xsl processing .... Question is is to switch to it. I would like to summarize pros and cons, but before I must describe curre= nt status a little. In current version XML processing is based on my library which I call XOb= jects. Intention of XObjects is to create easy to use XML framework aimed especi= ally at database and xml processing. From implemntation recommendations from w3c.org it differs in following areas. Condtradictory to usual DOM it works with fewer objects. Typical example is XML element and attribute. Usually these are implemented as di= fferent objects, I use only one for both XML node which has type flag. Advantage= s of this approach is that there is less to explain, programmer can work, learn and understand fewer objects and processing of XML data is more str= aightforward. For example you need to store incomming XML data into database. Typicall= y sometimes are data stored in elements and/or attributes. Using usual DOM implementation you must find if requiered are stored in element or attrib= ute and then use DOM object accordingly. Using XObjects you just do not care while both are the same and you work with Node.Name and Node.Value. Another added value is data type. XML can be typed and XObjects takes car= e about typecastings and conersions. You can use for example Node.AsString,= AsNumber, AsBoolean, AsDate .... Sometimes decimal deilimiter is point, sometimes comma. In datetime types there is jungle. Another valuable trick is that during parsing element names are not store= d in String value, but it is refernce to sorted StringList. It means that redundant in memory strings are automatically removed, and taska like fin= ding all element with given name is much faster, while binary search and direc= t addressing is used instead of repeated sequence searches. I compared performace of XObjects and XMLPartner on large xml files (2MB +) and I found expected results. While XObjects parsing time is longer, it consumes less memory. In both cases, memory and time is about 30%. I have also found that TurboPower made DOM extensions very similar to min= e. For example they have option to create Attribute and Element string lists= . I have discussed advantages of XObjects , now I will make commented list of XML Partner TurboPower solution. - XML Partner has broader support of character encoding, especially they suport more UTF versions. It seams that there is not sufficient support of national character sets, which is neither in XObjects, but is in OpenX= ML, which is yet another pascal XML DOM implementation. - SAX like event based parser, in XObjects misiing - faster, but more memory consuming, parsing - validation against DTD, good error handling - XPath implementation, feature that is in XObjects in development - buffered streams, this feature enables processing of data larger than available memory, missing in XObjects - XSLT processing and transformations to HTML, XML, text and RTF, very go= od feature that can enhance processing capabalities in the future - very good documentation 500+ pages manual and winhelp, XObjects has alm= ost none - broader support and probably stability, while XML Partner has been used= longer and in far more installations. This leads me to an idea to use extended XML Partner and switch to it fro= m XObjects. Features probably can enhanced so, that we can have the best fr= om both worlds. It would probably also mean to became a developer of XML Pa= rtner to ensure, that new added features will be present in future releases. _________________________________________________________________________= Uspora az 30 % na POVINNEM RUCENI! Mimoradne ceny pro auta starsi 10 let!= Pojisteni pripojneho vozidla zdarma. 800 100 777 http://adsweb.tiscali.cz/csob.html |