Home arrow XML arrow Page 3 - Introduction to XML
XML

Introduction to XML


This is chapter one from the book, XML and FrameMaker, by Kay Ethier (Apress, ISBN: 159059276X. 2004). Ethier reviews some of the basic XML terms and rules, and provides a basic overview of the purpose of DTDs and XSLT.

Author Info:
By: Kay Ethier
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
June 15, 2004
TABLE OF CONTENTS:
  1. · Introduction to XML
  2. · A Review of Basic Terminology
  3. · Terminology Continued
  4. · Understanding XML Rules (1-3)
  5. · Understanding XML Rules (4-5)
  6. · Understanding XML Rules (6-7)
  7. · Looking at XML with Formatting

print this article
SEARCH DEVARTICLES

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.


blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- 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

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials