Skip to Main Content
XSLT
book

XSLT

by Doug Tidwell
August 2001
Intermediate to advanced content levelIntermediate to advanced
480 pages
11h 16m
English
O'Reilly Media, Inc.
Content preview from XSLT

XML Document Design

Now that we’ve covered how our tutorials appear in all their various forms, we’ll discuss the structure of the XML documents that become our tutorials. To start with, we used some obvious structural principles:

  • A <tutorial> should contain a single <title> and one or more <section>s.

  • A <section> should contain a single <title> and one or more <panel>s.

  • A <panel> should contain a single <title> and a <body>, which in turn contains the markup for the panel’s contents.

This foundation creates an XML structure identical to the layout of our tutorials, so it was an obvious place to start.

Individual Panels

An individual panel has the following structure:

<panel>
  <title>Title of the panel</title>
  <body>
    <image-column>
    <text-column>
      Basic HTML markup (<p>, <ol>, <li>, <b>, <i>, <u>, <a>, etc.)
    </text-column>
  </body>
</panel>

The <image-column> element is optional; it’s used to define the image that appears on the left side of the panel. We intentionally kept our markup design simple so that rendering the tutorials would be relatively straightforward. Although this approach is heavy-handed, it does allow us to enforce a certain amount of consistency in the layout of our tutorials. Reusing common HTML tags inside the <text-column> element allows authors to use the tags they already know and love, and it simplifies the XML-to-HTML transformation.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning XSLT

Learning XSLT

Michael Fitzgerald
Inside XSLT

Inside XSLT

Steven Holzner
XSLT Cookbook

XSLT Cookbook

Sal Mangano
XSLT and XPATH: A Guide to XML Transformations

XSLT and XPATH: A Guide to XML Transformations

John Robert Gardner, Zarella L. Rendon

Publisher Resources

ISBN: 0596000537Supplemental ContentCatalog PageErrata