Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 3 - 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 - XML Syntax


    (Page 3 of 4 )

    It is worth know a few details about this language before we discuss how to use it in Delphi:

    • You can add comments within <!—andmarkers, which are basically ignored by XML processors. There are also directives and processing instructions, enclosed within <? and ?> markers.

    • White spaces are generally ignored. While human beings must be able to read your XML tags, your applications won't care much about them.

    • There are a few reserved characters that you cannot use in the text. The only three characters you can never use are the less-than character (or the left angle bracket, <, used to delimit a marker), which is replaced by &lt;,  the greater-than character, which is replaced by &gt;, and the ampersand character (&), which is replaced by &amp;. Other optional special characters are &apos; for the single quote(‘), and &quot; for the double quote(").

    • To add non XML content (for example, binary information or a script), you can use a CDATA section, enclosed within <![CDATA [and]]>.

    • All markers are enclosed by angle brackets, < and >. Markers (or tags) are case sensitive.


    • For each opening marker there must be a matching closing marker denoted by a initial slash character: <node>value</node>


    • Markers must not overlap; they must be properly nested.


    • If a marker has no content (but is needed), you can replace the opening and closing markers with a single marker that includes a trailing slash:<node/>


    • Markers can have attributes, using multiple embedded tags and only one block of text representing the value of the node. XML nodes can have either a textual value or embedded tags, but not both.


    • A node can have multiple child nodes with the same tag; tags do not have to be unique. Attributes, however, have to be unique for each node.


    It is worth adding that an XML document needs to be well-formed if it is to be used in web browsers or other applications. There are a few extra rules that need to be followed for XML documents to be consideredsyntactically correct. So let’s look at what is meant by syntactically correct:

    • Each XML document must indicate that it is an XML document, which version of XML it complies with, and finally, what type of character encoding it takes:


    <?xml version="1.0" encoding="iso-8859-1"?>

    • Encodings can include Unicode character sets such as UTF-8, UTF-16 and UTF-32 and also some ISO encodings such as ISO-1064-xxx or ISO-8859-xxx. The prologue can also include external declarations, the schema used to validate the document, namespace declaration and associated XSL file, and some internal entity declarations.

    • A well-formed XML document will have no problems being loaded into a web browser or any other XML-compliant application.

    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 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek