Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 2 - Delphi and XML
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 XML
By: David Web
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2008-11-03

    Table of Contents:
  • Delphi and XML
  • XSL example
  • XML Syntax
  • Using XML with Delphi

  • 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 XML - XSL example


    (Page 2 of 4 )


    As you can see, each tag describes its contents very clearly. For example, the <title> tag describes the title, the description tag shows the description, and so on. Below is an example of an XSL style sheet:


    <?xml version="1.0" ?>

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="xml" encoding="iso-8859-1" omit-xml-declaration="yes" indent="yes"/>

    <xsl:template match="*">

    <table border="1" width="600" align="center">

    <tr><td valign="top" align="center" class="title" bgcolor="silver" >

    <a>

    <xsl:attribute name="href">

    <xsl:value-of select="*[local-name()='channel']/*[local-name()='link']"/>

    </xsl:attribute>

    <xsl:attribute name="target">

    <xsl:text>top</xsl:text>

    </xsl:attribute>

    <xsl:value-of select="*[local-name()='channel']/*[local-name()='title']" disable-output-escaping="yes"/>

    </a>

    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>

    <xsl:value-of select="*[local-name()='channel']/*[local-name()='lastBuildDate']"/>

    </td></tr><tr><td valign="top" bgcolor="ghostwhite" class="headlines" >

    <ul>

    <xsl:for-each select="//*[local-name()='item']">

    <li>

    <a>

    <xsl:attribute name="href">

    <xsl:value-of select="*[local-name()='link']"/>

    </xsl:attribute>

    <xsl:attribute name="target">

    <xsl:text>top</xsl:text>

    </xsl:attribute>

    <xsl:value-of select="*[local-name()='title']" disable-output-escaping="yes"/>

    </a>

    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>

    <xsl:value-of select="*[local-name()='description']" disable-output-escaping="yes"/>

    </li>

    </xsl:for-each>

    </ul>

    </td></tr>

    </table>

    </xsl:template>

    <xsl:template match="/">

    <xsl:apply-templates/>

    </xsl:template>

    </xsl:stylesheet>


    XML has a few disadvantages as well. The biggest disadvantage is that, without a formal description, a document is worth little. If you want to exchange documents with another company, for example, you will have to agree on every single point, starting from what each tag means; you will also have to agree on the semantic meaning of the content.

    Another disadvantage is that XML documents are a great deal larger than most text files. On top of that, the repeated opening and closing tags use a lot of space. On the other hand. XML compresses well.

    Now you have some idea of what the Extensible Markup Language is all about. Let’s take a look at the syntax.

    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-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek