Delphi-Kylix
  Home arrow Delphi-Kylix arrow Delphi and the DOM
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Delphi and the DOM
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 3
    2008-11-10

    Table of Contents:
  • Delphi and the DOM
  • Coding with the DOM in Delphi
  • XMLDOM.pas Unit continued
  • Even More XMLDOM.pas Unit

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Delphi and the DOM


    (Page 1 of 4 )

    Welcome to the second part of a four-part series on Delphi and the DOM. In the first article, we discussed Delphi and XML. Now that you have some idea of the core elements of XML documents, we can talk about how to manipulate them in Delphi.

    XML Documents and Delphi

    There are two ways in which you can manipulate XML documents:

    • Using the Document Object Model interface

    • Using the Simple API for XML or SAX

    The two techniques could not be more different from each other.

    • The Document Object Model loads the entire document into a hierarchical tree of nodes, allowing you to read them and manipulate them to change the document. For this reason, the Document Object Model is suitable when you want to navigate the XML structure in memory and edit it, or for creating new documents from scratch.

    • The Simple API for XML or SAX parses the document, firing an event for each element without building a structure in memory. Once parsed by the Simple API for XML, the document is lost, but this operation is generally much faster than the construction of the Document Object Model tree. Using the Simple API for XML is good for reading an XML document once, i.e if you are looking for a portion of its data.

    There is another way to manipulate or to create XML documents: string management. Creating a document by adding strings is the fastest operation, particularly if you can do a single pass (and don't need to modify nodes already generated). Reading documents by strings is very fast, but can become difficult for complex structures.

    Delphi provides two more methods you should know about. The first is the definition of interfaces that map the document structure; this method is used to access the document instead of the generic DOM interface. This approach makes for faster coding and more robust applications.The second approach is the development of transformations that enable you to read a generic XML document into a ClientDataSet component or save the dataset into an XML file for a given structure.

    Which of these two is better? Well, that you will have to decide based on your needs. So how do we code for DOM in Delphi? That is what we will be looking at next.

    More Delphi-Kylix Articles
    More By David Web


     

    DELPHI-KYLIX ARTICLES

    - Loading an XML Document into the DOM
    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek