XML
  Home arrow XML arrow Page 3 - Introduction to 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? 
XML

Introduction to XML
By: Kay Ethier
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2004-06-15

    Table of Contents:
  • Introduction to XML
  • A Review of Basic Terminology
  • Terminology Continued
  • Understanding XML Rules (1-3)
  • Understanding XML Rules (4-5)
  • Understanding XML Rules (6-7)
  • Looking at XML with Formatting

  • 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


    Introduction to XML - Terminology Continued


    (Page 3 of 7 )

    Schema

    A DTD describes a set of elements and attributes for a document type, and a schema does pretty much the same thing. A schema, unlike a DTD, is an XML document. The elements, attributes, and other information in schema are defined using XML syntax. As with a DTD, you may validate a document against a schema.

    As of FrameMaker 7.1, schema are not supported for use with XML documents. If you have a schema, you may be able to convert it to a DTD for use with FrameMaker.

    NOTE: Tools such as TurboXML™ allow you to open a schema and save it as a DTD. Some also allow you to take a DTD and save it as a schema, should you need to do so.

    Nesting

    This refers to the way XML tags envelope other tags. A parent may contain-between its beginning and end tags-a child element's beginning and end tags. It may even contain multiple child elements, each beginning and ending in turn.

    Hierarchy

    Similar to a family tree, elements in an XML file have relationships to each other. Referring to the example in Figure 1-1, you can see that the elements in the XML instance are nested, with some elements inside others. You can refer to Figure 1-1 as you review the hierarchical terms parent, child, sibling, descendant, and ancestor. The example may help you to better understand their meaning.

    Parent

    An element that contains another element is the parent of the second element. In Figure 1-1, you see the parent element <Recipe>, which contains elements such as <Name>, <Ingredients>,  and <Procedure>.

    Child

    An element contained inside another element is a child of the element that contains it. In the example in Figure 1-1, <Name>, <Ingredients>, and <Procedure> are children of <Recipe>.

    Sibling

    Two elements that are contained inside the same parent are considered siblings. In Figure 1-1, <Name>, <Ingredients>, and <Procedure> are siblings.

    Ancestor

    Any elements which are hierarchically above an element in the Tree View are the ancestors of that element. <Recipe>, for example, is the ancestor of all elements (as such, it is the document root element, which is described further in the next section on XML rules). When viewed in tag mode, an ancestor would be the tags before and after an element.

    Descendant

    Any elements that are hierarchically inside an element (wrapped inside its beginning and end tags) are the descendants of that element. <Quantity> is one of many descendants of <Recipe>.

    Style sheet

    A style sheet is a document outside the XML that can be used to format it. You may be familiar with the cascading style sheets (CSS) used with HTML. There are also XSL style sheets, XSLT (a subset of XSL) style sheets, and more.

    DOCTYPE

    The document type (DOCTYPE) is sometimes included in XML documents and refers to the specific DTD to be used for that document. For example, underneath your XML declaration ( Line 1) you might have a DOCTYPE naming your DTD by filename ( Line 2).

    <?xml version="1.0"?>

    Line 1

    <!DOCTYPE UserManual SYSTEM "manual.dtd">

    Line 2

    Validate

    The process of validation checks your document's structure against the rules defined in the DTD (outside FrameMaker) or EDD (inside FrameMaker). In FrameMaker, there is a Validate tool which moves you from error to error-if you have any errors-within your structured document or structured book.

    If any content inside FrameMaker is not following the structure rules, red symbols or red dashed lines will appear to help you see the errors. It then tells you when your documents are valid. In other words, it tells you whether or not the documents follow all the rules of the DTD.

    If you do not correct the errors, you cannot produce valid XML but you can still produce well-formed XML. Well-formed means that your documents follow all the rules of XML but do not necessarily confirm to a DTD or schema. Depending on what you are doing with your XML, you may be able to work with well-formed XML. If you plan to reuse, store, and share content, however, you may need to aim toward valid XML.

    This chapter is from XML and Framemaker, by Kay Ethier (Apress, 2004, ISBN: 159059276X). Check it out at your favorite bookstore today.

    Buy this book now.

    More XML Articles
    More By Kay Ethier


     

    XML ARTICLES

    - Using Regions with XSL Formatting Objects
    - Using XSL Formatting Objects
    - More Schematron Features
    - Schematron Patterns and Validation
    - Using Schematron
    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







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