home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Extended Link Groups With the possibility of extended, out-of-line links, a processing application may find it necessary to process a number of separate files to determine all the links and their resources. To facilitate this processing, XML supports the notion of an extended link group—a logical grouping of linked documents. The group is defined by and contained in a grouping element, and each document in the group is specified by an empty document element. Calling the grouping and document elements <XLINKGROUP> and <DOCUMENT>, respectively, you could set up the following extended link group:

<XLINKGROUP XML:LINK=”GROUP” STEPS=3>
   <DOCUMENT XML:LINK=”DOCUMENT” HREF=”doc1.xml”/>
   <DOCUMENT XML:LINK=”DOCUMENT” HREF=”doc2.xml”/>
   <DOCUMENT XML:LINK=”DOCUMENT” HREF=”doc3.xml”/>
   ...
   <DOCUMENT XML:LINK=”DOCUMENT” HREF=”docn.xml”/>
</XLINKGROUP>

The STEPS attribute of the <XLINKGROUP> elements recognizes that the linked documents may include extended link groups themselves and places a limit on how many document levels deep the processing application should go when processing the extended group. The HREF attribute of the <DOCUMENT/> element gives the URL of each linked document.


NOTE:  Values of the XML:LINK attribute for the <XLINKGROUP> element and the <DOCUMENT/> element are GROUP and DOCUMENT, respectively. Note that these values could have been set up as defaults in the DTD.

XPoint

Borrowing from the Text Encoding Initiative (TEI)—a project whose objective is to identify standards and guidelines for the electronic publication of scholarly work—XML also includes the notion of extended pointers, or XPointers. The W3C document that puts forward the notion of XPointers is called the XML Pointer Language or XPoint.

XPointers basically enable you to link to a position in a document’s parsing tree (the logical structure the parser uses to represent the document). This saves you from having to set up named anchors the same as you do in an HTML document. In the business letter example, you could link to

child(1,body) (3)

This would refer to the third child of the first (and only) BODY element in the letter.

Links can also point to a span of the document tree. For example, the code

child(3,p)..child(5,p)

selects the third, fourth, and fifth <P> elements of the letter. A pointer that spans multiple element in the document tree is called spanning XPointer.

XPointers will be most useful to programmers writing applications that parse or display XML documents because they provide a convenient way to reference the document’s internal structure. For more information about using XPointers, consult the W3C site at http://www.w3.org/TR/WD-xptr.

Using Style Sheets with XML

One of the important points made at the start of this chapter was that XML elements do not specify how content is presented. Instead, an XML browser should use a style sheet to determine how content in each element should be displayed. The delivery of a second draft specification for XML style sheet language (XSL) 1.0 is expected shortly after this book is published; thus, at the time of this writing, the exact details of how to implement XML style sheets are not known. However, some documents are available through the W3C that give a flavor for what XSL might ultimately be like: the draft XSL specification and the XSL Requirements Summary.

The Draft XSL Specification

The first is the draft XSL specification submitted to the W3C in August 1997. Authors of the draft expect that XML document authors will be able to use the Cascading Style Sheet (CSS) standard for specifying presentation attributes for simple XML documents. Documents requiring more complex formatting would use XSL.

See “Style Sheets,” p. 261.

The XSL draft spec is based largely on the Document Style Semantics and Specification Language (DSSSL), an ISO standard for specifying how a document is to be formatted. It consists of two parts: a transformation language, which is used to apply structural transformations to SGML files; and a style language, which is used to provide formatting instructions. Together, these languages take raw SGML code and prepare it for display through a browser. The XSL Working Group is adapting DSSSL to work with XML. After their work is complete, XML authors will have a way to specify presentation for their documents the same as they use a DTD to specify syntax.

The XSL Requirements Summary

The W3C’s XSL Working Group has put forward a number of requirements that the XSL standard should address. This requirements summary is something like a “wish list” given to the designers of XSL to guide their work. It is not expected that the first draft of XSL will address all the requirements, but by having all the requirements out on the table from the start, designers can create XSL in such a way that it is easier to implement the full set of requirements in future revisions.

The Summary places the requirements into several logical groupings, including:

  General formatting issues
  Columns, floats, keeps, and so on
  Fonts
  Colors
  Math
  Internationalization
  Scripting
  Interactivity
  Accessibility
  Extensibility
  Packaging
  Meta-information

The General formatting issues section, for example, contains specific requirements for content positioning, alignment, animation, cross-references, drop caps, headers, hyphenation, indenting, justification, kerning, leading, margins, run-arounds (whitespace around an object), tables, and tiling—all basic attributes of most Web documents.


NOTE:  You can look up specific requirements under each of the groupings listed previously by directing your browser to http://www.w3.org/TR/WD-XSLReq.

Applications

At this point, you may be wondering how you might be able to use XML in your work as a Web content developer. XML’s best and highest use is for the creation of specialized markup languages. Therefore, if you want to determine how you can use XML, think about the content you are publishing and what special needs you have based on the nature of the content. Perhaps your content is related to a specific scientific discipline, or your documents may have an unusual structure to them. You can capture these characteristics by using XML to define a customized markup language that supports them. If you take it a step further and develop a DTD for your XML application, you open the possibilities of making your documents more easily formatted and searched. This is because the applications that perform these tasks can use the DTD to teach themselves the rules you create for marking up the content.

Despite XML’s newness, it is already being used by some companies as the foundation for specialized markup languages. Some of these applications include


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.