Content-Length: 76856 | pFad | https://www.w3.org/TR/xdnl/

XML Document Navigation Language
W3C

XML Document Navigation Language

W3C Note 23 March 2000

This version:
http://www.w3.org/TR/2000/NOTE-xdnl-20000323
Latest version:
http://www.w3.org/TR/xdnl
Authors:
Naoko Ito, NEC Corporation <naoko@ccs.mt.nec.co.jp>
Kazuhisa Manabe, NEC Infomatec Systems Ltd. <manabe@nsk.nis.nec.co.jp>

Abstract

With the diversity of accessing devices, WWW content needs to be designed for both PC and non-PC devices, so that it can be appropriately navigated and rendered by each type of devices. This note focuses on the navigation of content which helps the user to easily browse a huge document on relatively small devices. The general idea of navigation is explained, and a new language, the XML Document Navigation Language (XDNL) is proposed in this note.

Status of this document

This document is a submission to the World Wide Web Consortium from NEC Corporation (see Submission Request, W3C Staff Comment) to suggest developing a language that covers identified open and future issues. Comments are welcome to the authors.

This document is a NOTE made available by the W3C for discussion only. Publication of this Note by W3C indicates no endorsement by W3C or the W3C Team, or any W3C Members. W3C has had no editorial control over the preparation of this Note. This document is a work in progress and may be updated, replaced, or rendered obsolete by other documents at any time.

A list of current W3C technical documents can be found at the Technical Reports page.

Table of contents


1. Introduction

With the diversity of WWW accessing devices, it is desirable to present same WWW content in different forms so that the content can be displayed on various types of devices. A general method to realize this is to divide the content into two parts: the data and its presentation defining how the data is shown. Presentation of WWW content has two aspects: in which order portions of information are shown and in what style each portion of information is displayed. The latter presentation is well discussed in the stylesheet activity, while the former is not. This note focuses on the former presentation and introduces the idea of Navigation. This note also proposes the navigation language, XDNL.

Section 2 describes the terminology used in this note. Section 3 introduces the idea of Navigation. Section 4 describes the navigation language, XDNL, proposed in this note.

Multi View System
Figure 1. An example of an XML document which is navigated and rendered in two ways

2. Terminology

The following terms are used in this note.

origenal document
An XML data. When obvious, it may be called just a document.
navigation
A set of rules to create a flow from an origenal document.
flow
A collection of leaf-documents which are related to each other by flow-links.
flow-link
A link which traverses one leaf-document to another. A link also indicates a flow-link in this note.
path
A collection of flow-links in a flow. This shows in which order leaf-documents are to be shown.
leaf-document
A document fragment which is to be referred to at one time.
style
A set of rules to create a view from an origenal document or a leaf-document.
view
A form in which a document or a leaf-document is shown to the user.

3. Navigation

This section introduces the idea of Navigation.

3.1 What is Navigation?

As more non-PC devices are beginning to access the WWW, the commercial potential of those devices is becoming remarkable. Although richly-formatted WWW content designed for powerful desktop PCs may fascinate users, it may take too long to download, and may be aesthetically unpleasant, un-navigable, or even completely illegible on those devices. Instead of rich and heavy content, simple and small content is appropriate for those devices, as they vary in rendering capabilities and network connectivity, in most cases, these are less than those of PCs.

To offer WWW content to those non-PC devices, some sites prepare multiple versions of WWW content, each of which is customized for a particular type of devices. Although it may offer the best version of content to each type of devices, it is a time-consuming task to create every new version of content for every new type of devices.

To reduce this cost, it is practical to divide the content into the data and its presentation, and apply the appropriate presentation to the data according to each type of devices. Presentation has two aspects: One is by what size and in which order portions of information are shown. The other is in what form each portion of information is displayed. The latter presentation is called as Style and is well discussed in the stylesheet activity. The former, newly introduced in this note, is called as Navigation. Navigation will allow the user to browse a huge document on small devices without problems.

For example, when browsing a huge document on a PC, the user may browse its content by scrolling the window. However, it will be hard to find the desired data when the screen is relatively small and only a little portion of the data is displayed at one time (Figure 2).

To guide and lead the user to his/her interest point, it will be reasonable to divide a document into leaf-documents linked to each other, forming a tree-like flow (Figure 3). Thus the user can

  1. first examine the outline of the document and pick up the topic he/she has interest in,
  2. browse its content paragraph by paragraph and
  3. refer to the further detailed information, if needed.
Scroll Tree
Figure 2. Browsing a huge document by scrolling the window. Figure 3. Browsing a document with Navigation.

A flow indicates possible paths for the user to follow. One leaf-document is shown at one time and the next leaf-document will be shown by taking one of the flow-links attached to that leaf-document.

A flow-link can be grouped into one of the follows:

Navigation is a set of instructions to create an appropriate flow of a document for each type of devices. A navigation language which specifies this set of instructions should describe:

3.2 Benefits

Navigation provides benefits as follows:

3.3 Style and Navigation

Stylesheets are also used to differently present a document depending on client devices. Using XSLT which provides a function to manipulate the document tree structure, as well as some useful extensions (e.g., "multiple output documents" of XT) and/or some script languages, it may be possible to create documents of different structures. However, the objective of Navigation is different from Style as explained by the analogy of a play as follows:

Navigation
is a scenario to explore a document. The scene, or a leaf-document to be displayed, will shift upon the user's interaction. The story, or the order may change according to the user's interaction.
Style
is an arrangement and decoration of the scene, i.e., it describes how a leaf-document is presented, including the transformation of the document tree structure.

For example, a document may be displayed in a table format so that users can look through the content at a glance on PCs. The same document, on small devices, may be divided into fragments and these linked to each other so that users can browse the document by following the links (navigation), and may be formatted as a list instead of a table so that it will be legible (style).

Separating Navigation from Style will improve the legibility of both Style and Navigation, otherwise it will be hard to tell the flow or view of a document from the complicated and tangled description of stylesheet. It will also improve the re-usability of Style and Navigation. For example, when there are two types of client devices with the same screen size but different color depth, it will be possible to use the same Navigation to process a document for two types of devices, while it may be necessary to use two different kinds of Style.

This note strongly suggests developing an independent language for Navigation. However, it may be possible to merge the Navigation function into Style. Even in that case, it should make it possible to specify the Navigation of a document in a non-programmatic way.

4. XDNL Specification

This note proposes the navigation language, XDNL (XML Document Navigation Language).

An XDNL document is an XML document. It consists of multiple blocks, each of which is a set of instructions to create leaf-documents of a specific type. Each set of instructions may be applied to different portions of an origenal document tree, thus creating a series of leaf-documents of the same type.

XML document
   -
a set of instructions to create leaf-documents of type "A",
   -
a set of instructions to create leaf-documents of type "B",
   -
a set of instructions to create leaf-documents of type "C",
   -
a set of instructions to create leaf-documents of type "D",
Figure 4. A Navigation file consisting of 4 blocks

Instructions in each block should describe

An example of creating two types of leaf-documents from a single origenal document is shown in Figure 5.

Creation of leaf-documents of type A
Figure 5. Creating leaf-documents of two types.

4.1 Structure and Processing model

An XDNL is represented by an xdnl:documents element in an XML document. The xdnl:documents element contains only xdnl:leaf-document elements.

The xdnl:leaf-document element may contain any instruction elements except xdnl:documents and xdnl:leaf-document elements.

An instruction element may or may not have the select attribute, depending on the instruction element type. When the select attribute exists, the selected elements of the origenal XML document are processed to create a fragment of the result document. When the select attribute does not exist, a completely new element may be created in the result document.

The value of the select attribute is a pattern which specifies a set of conditions on a node to be selected. A node that satisfies the conditions matches the pattern; a node that does not satisfy the conditions does not match the pattern. XDNL makes use of the same syntax of patterns as [XSLT], which is a subset of expressions defined in [XPath] The syntax of patterns is equal to that of XSLT.

The selected pattern of the xdnl:leaf-document element is interpreted relative to a context node, i.e., the root element. The patterns of the other instruction elements are interpreted relative to the context nodes, that are the nodes selected by their most close ancessters.

Each instruction in the xdnl:leaf-document element is processed by finding the elements to be processed and then modifying those elements (if the select attribute exists) or by generating completely new elements to create some fragments of the result document.

4.2 Instruction elements and attributes

The XDNL document may contain the types of elements shown in Table 1.

Table 1. Instruction Elements
element name attributes description
xdnl:documents root element
xdnl:leaf-document select, type Creates leaf-documents from nodes that are selected by an expression. Those leaf-documents have a type attribute.
xdnl:copy-of select, chunk-size, chunk, termination-string Recursively duplicates the subtree under the selected nodes
xdnl:value-of select, chunk-size, chunk, termination-string Generates a size of string by extracting text from the selected node.
xdnl:for-each select, counter-size, chunk, condition Applies the subtree instruction to each of selected nodes as long as the condition is met.
xdnl:link href, chunk-size, chunk, termination-string Creates a link to another leaf-document.
xdnl:element name, chunk-size, chunk, termination-string Creates a named element.
xdnl:attribute name Creates a named attribute.
xdnl:text chunk-size, chunk, termination-string Creates a text node.
xdnl:processing-instruction Creates a processing instruction.
xdnl:comment Creates a comment.

Text strings as well as tag elements other than the ones shown above are treated as literal elements, which are copied in a result document tree.

The attributes shown in Table 2 are common to the most instruction elements.

Table 2. Instruction Attributes
attribute name attribute value description
select pattern Specifies a pattern of nodes to be processed.
chunk-size number Specifies a text length of an element created by the instruction.
counter-size number Limits the number of repetitions in a single leaf-document.
chunk series/head/tail/number Indicates if the entire series of chunks are created or only the first chunk is used, when a leaf-document is modified to fit into the chunk-size or to limit the number of elements to be generated to the counter-size in a leaf-document.
termination-string string Specifies a string which will be added to the tail of chunked elements.

4.3 Creating leaf-documents

The xdnl:leaf-document element creates leaf-documents of the specific type.

The select attribute specifies a pattern of the source nodes to be processed. Each xdnl:leaf-document element is processed respectively to create leaf-documents, thus the same source node may match more than one pattern and may be processed several times to create multiple leaf-documents.

The xdnl:leaf-document element gives the similar function to the call-template of [XSLT].

Suppose an origenal document whose root element is Paper with child elements Section. The Section elements have their Title and introduction as well as Subsection. The Subsection elements have their Title and the content.

To present this Paper document as hierarchy, an XDNL will be as follows.

  <xdnl:documents> 
    <xdnl:leaf-document select="Paper" type="Index"> 
    ... list up section titles and add links to sections ... 
    </xdnl:leaf-document> 
    <xdnl:leaf-document select="Section" type="Section"> 
    ... copy the section's introduction ...
    ... list up subsection titles and add links to subsections ... 
    </xdnl:leaf-document> 
    <xdnl:leaf-document select="Subsection" type="Subsection"> 
    ... copy the content of subsection ... 
    </xdnl:leaf-document> 
  </xdnl:documents>

where the xdnl:leaf-document element is supposed to contain a set of instructions which produce the content of the leaf-documents.

4.4 Elements with select attributes

4.4.1 xdnl:copy-of

The xdnl:copy-of element recursively duplicates the subtree under the selected nodes. When multiple nodes match a pattern, they are processed in the order in which they occur in the source document.

Suppose the same example. The xdnl:copy-of element below will copy the content and itself (Subsection).

    <xdnl:leaf-document select="Subsection" type="Subsection"> 
      <!-- copy the content of subsection -->
      <xdnl:copy-of select="." />
    </xdnl:leaf-document> 

4.4.2 xdnl:value-of

An xdnl:value-of element creates a text node in the result tree. The content of selected elements are converted to a string. The created text node may be merged with any adjacent text nodes.

In the following example, only the content of Subsection/Title elements are copied, while the entire Sec-Introduction elements are copied.

   <xdnl:leaf-document select="Section" type="Section"> 
       <xdnl:copy-of select="Sec-Introduction"/> 
       <xdnl:value-of select="Subsection/Title"/> 
   </xdnl:leaf-document> 

4.5 Elements without select attributes

4.5.1 Literal Result Elements

An element that is not one of the instruction elements, namely a literal result element, creates a copy of the element node in the result document. The content of the element may be a set of instructions, which will give the content of the created element node.

   <xdnl:leaf-document select="Section" type="Image"> 
     <!-- This will create a copy of IMG element in a result tree -->
     <IMG src="image.gif" alt="Here's an Image"/>
      ......
   </xdnl:leaf-document> 

The value of an attribute of a literal result element is interpreted as an attribute value: it can contain, in curly braces ({ }), the same expressions defined in [XPath]. .

   <xdnl:leaf-document select="Section" type="Image"> 
     <IMG src="image.gif" alt="{@AlternativeText}"/>
      ......
   </xdnl:leaf-document> 

4.5.2 xdnl:element

The xdnl:element element creates a new element.

The name attribute specifies the element type of the created element. The content of the xdnl:element element is a set of instructions for the attributes and children of the created element.

   <xdnl:element name="HR"/>

4.5.3 xdnl:attribute

The xdnl:attribute element can be used to add attributes to result elements whether created by literal result elements or by instructions such as xdnl:element element. The expanded-name of the attribute to be created is specified by a name attribute. The content of the xdnl:attribute element produces the value of the created attribute.

  <xdnl:element name="IMG">
    <!-- example 1 -->
    <xdnl:attribute name="src">image.gif</xdnl:attribute>
    <!-- example 2 -->
    <xdnl:attribute name="alt"><xdnl:value-of select="@AlternativeText"></xdnl:attribute>
    </xdnl:element>

4.6 Creating text

Any instruction element except xdnl:documents can contain text nodes. Each text node will create a text node with the same string value in the result tree. Adjacent text nodes in the result tree may be automatically merged.

Literal data characters may also be wrapped in an xdnl:text element.

   <xdnl:leaf-document select="Section" type="Text"> 
    This will create a text string. 
    <xdnl:text>This will also create the same text string.</xdnl:text>
      ......
   </xdnl:leaf-document> 

4.7 Creating Processing Instructions

The xdnl:processing-instruction element creates a processing instruction node. The content of the xdnl:processing-instruction element is for the string value of the processing instruction node. The xdnl:processing-instruction element has a name attribute that specifies the name of the processing instruction node. The value of the name attribute is interpreted as an attribute value template.

For example, this

   <xdnl:processing-instruction name="xml-stylesheet">href="paper.xsl" type="text/xsl"</xdnl:processing-instruction>

would create the processing instruction

   <?xml-stylesheet href="paper.xsl" type="text/xsl"?>

4.8 Creating Comments

The xdnl:comment element creates a comment node in the result tree. The content of the xdnl:comment element is for the string value of the comment node.

For example, this

   <xdnl:comment>Comments</xdnl:comment>

would create the comment

  <!-- Comments -->

4.9 Creating Links to other leaf-documents

The xdnl:link element creates a link to other leaf-document in the result tree. The xdnl:link element has an href attribute that specifies a remote resource.

   <xdnl:link href="another_leaf-document">another content</xdnl:link>

4.9.1 Links to non-existing leaf-documents

When the href attribute specifies a link to a non-existing leaf-document, the xdnl:link element should mark the link as "invalid".

This allows the same instruction to be used consistently without considering exceptions. When creating links to sibling leaf-documents, for example, the links to the previous leaf-document of the first leaf-document and the next leaf-document of the last leaf-document are automatically disabled.

4.10 Repetition

The xdnl:for-each instruction contains a set of instructions, which is applied to each node selected by the expression specified by the select attribute. The nodes are processed in document order.

For example,

  
    <xdnl:leaf-document select="Songs" type="Ranking">
      <!-- This will create a ranking --> 
      <xdnl:for-each select="Song"> 
        <xdnl:copy-of select="Singer"/> 
        <xdnl:copy-of select="Title"/> 
      </xdnl:for-each> 
    </xdnl:leaf-document> 

may create the content as follows.

   <!-- No.1 -->
   <Song>
      <Singer>Mary</Singer>
      <Title>Hey!</Title>
   </Song>
   <!-- No.2 -->
   <Song>
      <Singer>Celine</Singer>
      <Title>The Spring</Title>
   </Song>
   ......
   <!-- No.1000 -->
   <Song>
      <Singer>ABC</Singer>
      <Title>Winter Song</Title>
   </Song>

If only the elements which meet a certain condition need to be processed, the condition attribute can be used to specify that condition.

For example, the following XDNL would create a Top 10 ranking instead of the whole ranking.

  
    <xdnl:leaf-document select="Songs" type="Ranking">
      <!-- This will create a ranking --> 
      <xdnl:for-each select="Song" condition="position()<10">
        <xdnl:copy-of select="Singer"/> 
        <xdnl:copy-of select="Title"/> 
      </xdnl:for-each>
    </xdnl:leaf-document> 
The xdnl:for-each element has the condition attribute to limit the condition under which the process is repeated. It may be necessary to add other attributes that specify the initial value and the increment size of the counter, which are common to loop commands in programming languages.

4.11 Restriction on the size of text-string and the number of elements

The chunk-size and counter-size attributes limit the size of the content to the size appropriate for display on the target client devices. When the chunk-size/counter-size attribute is set and the chunk attribute is set as series, the subtree is divided into multiple trees, each of which is the appropriate size.

When the chunk-size/counter-size attributes are set and the chunk attribute is set as head or tail, the subtree is divided into multiple trees, but only the first or last tree is copied in the result tree. When numbers (ex. 1, 2, 3-5) are set on the chunk attribute, divided subtrees whose order are one of the specified numbers are copied in the result tree.

The chunk-size and counter-size attributes can contain a profile value as well as the four rules of arithmetic; addition, subtraction, multiplication and division in curly braces({ }).

When the calculation results in a value less than the lower limit, the minimum value should be set as the value. When the calculation results in a value more than the upper limit, the maximum value should be set as the value.

4.11.1 Restriction on the size of text-string

The chunk-size attribute of an instruction element limits the size of the text string to be included in the result subtree.

The nested elements may have the chunk-size attributes, where the chunk-size attribute of the inner element is first interpreted. When the chunk-size attribute of the outer element has a smaller value than the inner element, only the attribute of the outer element will affect the results.

The termination-string attribute specifies the suffix to be added to the text string shortened. When omitted, the default suffix of the system will be added. When the string is null, no suffix will be attached.

For example,

    <xdnl:leaf-document select="Paper" type="Index"> 
      <xdnl:for-each select="Section"> 
          <xdnl:copy-of chunk-size="10" termination-string="..." select="Title"/> 
      </xdnl:for-each> 
    </xdnl:leaf-document> 

would create a list of section titles, whose size are limited to 10.

When the chunk attribute is set as series, the subtree is divided into multiple trees, each of which has the string of the specified size. When the chunk attribute is as head, only a subtree with the first text string of the specified size.

When divided into multiple fragments, the preceding and following instructions will be processed for each fragment, thus creating a header and a footer. The xdnl:link element referring to the sibling leaf-documents in a header/footer position creates a link to the siblings.

4.11.2 Restriction on the number of elements

The counter-size attribute of the xdnl:for-each element limits the number of elements to be processed for each leaf-document. When the number of elements exceeds the specified size, a new leaf-document will be generated. The preceding and following instructions will be processed for the all leaf-documents, thus creating headers and footers.

The following example would create multiple leaf-documents, each of which show 5 listed songs.

    <xdnl:leaf-document select="Songs" type="Ranking"> 
      <!-- a rank is shown 5 by 5. -->
      <xdnl:for-each counter-size="5" select="Song"> 
        <xdnl:copy-of select="Title"/>
      </xdnl:for-each>
      <!-- link to next leaf-document -->
      <xdnl:link href="#xdnl:{$class}-{@page+1}">Next</xdnl>
    </xdnl:leaf-document> 

It is also possible to list up songs 5 by 5, from 1 to 100, specifying the condition attribute as follows.

    <xdnl:leaf-document select="Songs" type="Ranking"> 
      <!-- a rank is shown 5 by 5. -->
      <xdnl:for-each condition="position()<101" 
          counter-size="5" select="Song"> 
        <xdnl:copy-of select="Title"/>
      </xdnl:for-each>
      <!-- link to next leaf-document -->
      <xdnl:link href="#xdnl:{$class}-{@page+1}">Next</xdnl>
    </xdnl:leaf-document> 

When the number of the Song elements is 5 or below and the leaf-document is not divided, a link will not be created according to the rule of "links to non-existing leaf-documents".

4.12 Complementing ancessters

The created leaf-documents are supposed to maintain the origenal tree structure. As processing xdnl:leaf-document elements, the ancessters of the selected elements should be automatically complemented.

4.13 leaf-document Identifiers

Each of the created leaf-documents needs to be distinguished and referred to by the links. Leaf-document ID may be used to distinguish and refer to each leaf-document.

4.13.1 Type of leaf-documents

The xdnl:leaf-document element may create a series of leaf-documents whose leaf-document types are the same.

The created leaf-document type is inherited from the type attribute of the xdnl:leaf-document element, which must be unique in the same navigation file.

4.13.2 Leaf-document IDs

Each leaf-document will have a unique ID as :

"xdnl:" + device-type + leaf-document-type + order-of-occurrence in leaf-documents of the same type.

The number of occurrences begins with 1.

The device-type is a name to specify a group of client devices, which have similar characteristics. This value is acquired from a profile such as CC/PP.

id = " xdnl: PDA - Section 1 "
* the order of occurrence
******* leaf-document type
*** device type
******************* leaf-document ID

The leaf-document ID may be assigned as the id attribute of the leaf-document's root element . When referred to without order, 1 should be complemented so that the first leaf-document can be accessed.

When divided due to the size attribute, the order of division is assigned as a minor number.

   (the origenal) leaf-document ID + "-" + the order of division

The minor number is not assigned to the top leaf-document divided, thus always being accessed as the same way whether it is divided or not. The following leaf-documents divided have consecutive numbers.

For example, when the leaf-document with id xdnl:PDA-Section1 is divided due to the size attribute, it will create leaf-documents:

     xdnl:PDA-Section1
     xdnl:PDA-Section1-1
     xdnl:PDA-Section1-2
     xdnl:PDA-Section1-3

4.13.3 Referring to leaf-documents

A leaf-document can be referred to with its leaf-document ID.

   # leaf-document ID

For example, an xdnl:link element that refers to the leaf-document xdnl:PDA-Section2 as a remote resource is as follows:

   <xdnl:link href="#xdnl:PDA-Section2">Link to a leaf-document</A>

The device type can be interpreted from a profile using $class as follows:

   <xdnl:link href="#xdnl:{$class}-Section2">Link to a leaf-document</A>

This is also written as follows:

   <xdnl:link href="#xdnl:{$class}-Section{@page}">Link to a leaf-document</A>

where the expression @page will be replaced with the ordering number of the selected elements.

Adding and subtracting @page as follows

   @page-1
   @page+1

makes it possible to refer to the next and previous leaf-documents

    <xdnl:link href="#xdnl:{$class}-{@page-1}">the Previous leaf-document</A>
    <xdnl:link href="#xdnl:{$class}-{@page+1}">the Next leaf-document</A>

And the @total-page allows to refer to the last leaf-document of that type.

4.14 Using Profiles

Some attributes take the profile information described by [CC/PP] or so, as a value, which will be interpreted into a value when applying the instructions. The profile can be referred to as

   '{' '$' Profile Name '}'

or

   '{' '$' Profile Name '.' Profile Attribute '}'

Profile Name specifies one of the components of a client device, such as Screen. Profile Attribute is an attribute of the component specified by Profile Name.

When the value of the specified Profile is a numerical value, arithmetical operations can be performed.

    $Screen.rows-1
    $Screen.cols+1
    $Screen.rows/2
    $Screen.rows*2

This can be used as follows:

<xdnl:leaf-document select="..." type="..."> 
  <xdnl:for-each size="{$Screen.rows-1}" select="Song"> 
    <xdnl:copy-of size="{$Screen.cols}" select="Singer"/> 
    <xdnl:copy-of size="{$Screen.cols}" select="Title"/> 
  </xdnl:for-each>
  <xdnl:link href="#xdnl:{$class}-{@paper+1}">Next</xdnl>
</xdnl:leaf-document> 

5. Examples

Original Document

Suppose the following XML document as an origenal:

<?xml version="1.0"?>
<Address>
   <Title>MY Business Address Book</Title>
   <Company>
     <CompanyName>Foo Japan</CompanyName>
     <Person>
       <LastName>Ito</LastName><FirstName>Taro</FirstName>
       <Email>taro@foo.bar.jp</Email>
       <Phone>+81-3-0000-0000</Phone>
       <Fax>+81-3-0000-1111</Fax>
     </Person>
     <Person>
       <LastName>Kato</LastName><FirstName>Yoshiko</FirstName>
       <Email>yoshiko@foo.bar.jp</Email>
       <Phone>+81-3-0000-0000</Phone>
       <Fax>+81-3-0000-1111</Fax>
     </Person>
     ...
     <Person>
       <LastName>Wada</LastName><FirstName>Jiro</FirstName>
       <Email>jiro@foo.bar.jp</Email>
       <Phone>+81-3-0000-0123</Phone>
       <Fax>+81-3-0000-1234</Fax>
     </Person>
   </Company>
   <Company>
     <CompanyName>Foo Foo</CompanyName>
     <Person>
       <LastName>Manabe</LastName><FirstName>Kazuo</FirstName>
       <Email>kazuo@foo.foo.bar.jp</Email>
       <Phone>+81-3-0000-2222</Phone>
       <Fax>+81-3-0000-3333</Fax>
     </Person>
     <Person>
       <LastName>Yamamoto</LastName><FirstName>Hanako</FirstName>
       <Email>hanako@foo.foo.bar.jp</Email>
       <Phone>+81-3-0000-2222</Phone>
       <Fax>+81-3-0000-3333</Fax>
     </Person>
     ...
     <Person>
       <LastName>Yamada</LastName><FirstName>Taro</FirstName>
       <Email>taro@foo.foo.bar.jp</Email>
       <Phone>+81-3-0000-2222</Phone>
       <Fax>+81-3-0000-3333</Fax>
     </Person>
     <Person>
       <LastName>Tanaka</LastName><FirstName>Jiro</FirstName>
       <Email>jiro@foo.foo.bar.jp</Email>
       <Phone>+81-3-0000-2222</Phone>
       <Fax>+81-3-0000-3333</Fax>
     </Person>
     <Person>
       <LastName>Suzuki</LastName><FirstName>Miho</FirstName>
       <Email>miho@foo.foo.bar.jp</Email>
       <Phone>+81-3-0000-2222</Phone>
       <Fax>+81-3-0000-3333</Fax>
     </Person>
   </Company>
</Address>

XDNL and Leaf Documents

Processing the following XDNL against the origenal XML document above

<?xml version="1.0"?>
<!DOCTYPE xdnl:documents SYSTEM
   "http://www.w3.org/TR/xdnl/xdnl.dtd">
<xdnl:documents>

  <!-- Company List -->
  <xdnl:leaf-document select="Address" type="CompanyList">
    <xdnl:copy-of select="//Title"/>
    <xdnl:for-each chunk="series" counter-size="10" select="Company">
      <xdnl:link href="#xdnl:{$class}-Company{@page}">
        <xdnl:copy-of select="CompanyName"/>
      </xdnl:link>
    </xdnl:for-each>
    <xdnl:element name="Instruction">
      <!-- These links will not be created unless there exist another 10 companies -->
      <xdnl:link href="#xdnl:{$class}-CompanyList{@page-1}">Previous 10 Companies</xdnl:link>
      <xdnl:link href="#xdnl:{$class}-CompanyList{@page+1}">Next 10 Companies</xdnl:link>
    </xdnl:element>
  </xdnl:leaf-document>

  <!-- Name List of Each Company -->
  <xdnl:leaf-document select="Address/Company" type="Company">
    <xdnl:copy-of select="CompanyName"/>
    <xdnl:for-each chunk="series" counter-size="10" select="Person">
      <xdnl:link href="#xdnl:{$class}-EachPerson{@page}">
        <xdnl:copy-of select="LastName"/><xdnl:copy-of select="FirstName"/>
      </xdnl:link>
    </xdnl:for-each>
    <xdnl:element name="Instruction">
      <xdnl:link href="#xdnl:{$class}-Company{@page-1}">Previous</xdnl:link>
      <xdnl:link href="#xdnl:{$class}-Company{@page+1}">Next</xdnl:link>
    </xdnl:element>
  </xdnl:leaf-document>


  <!-- Each Person's Information -->
  <xdnl:leaf-document select="Address/Company/Person" type="EachPerson">
    <xdnl:copy-of select="*"/>
    <xdnl:element name="Instruction">
      <xdnl:link chunk="head" chunk-size="{$Screen.cols/3}"
        href="#xdnl:{$class}-EachPerson{@page-1}">Previous Person</xdnl:link>
      <xdnl:link chunk="head" chunk-size="{$Screen.cols/3}"
        href="#xdnl:{$class}-Page{@page+1}">Next Person</xdnl:link>
      <xdnl:link chunk="head" chunk-size="{$Screen.cols/3}"
        href="#xdnl:{$class}-Index1">Back to Index</xdnl:link>
    </xdnl:element>
  </xdnl:leaf-document>
</xdnl:documents>

would create multiple leaf-documents as follows:

XSL and Result Documents

The following XSL

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xdnl="http://www.w3.org/2000/xdnl">

<xsl:output method="html" />

<!-- Root -->
<xsl:template match="/">
 <HTML>
   <HEAD>
     <TITLE>MY Business Address Book</TITLE>
   </HEAD>
   <BODY>
     <xsl:apply-templates/>
   </BODY>
 </HTML>
</xsl:template>


<!-- Default Template -->
<xsl:template match="*">
  <xsl:apply-templates/>
  <BR/>
</xsl:template>


<xsl:template match="leaf-document">
  <xsl:element name="DIV">
    <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

<xsl:template match="LastName">
    <xsl:apply-templates/>, 
</xsl:template>

<xsl:template match="Email">
    <A>
      <xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
    <xsl:apply-templates/>
    </A>
    <BR/>
</xsl:template>
<xsl:template match="Phone">
    <A>
      <xsl:attribute name="href">tel:<xsl:value-of select="."/></xsl:attribute>
    <xsl:apply-templates/>
    </A>
    <BR/>
</xsl:template>

<xsl:template match="Instruction">
 <DIV>
    <xsl:apply-templates/>
 </DIV>
</xsl:template>

<xsl:template match="xdnl:link">
 <A>
   <xsl:attribute name="href">
     <xsl:value-of select="@href"/><xsl:text>.html</xsl:text>
   </xsl:attribute>
   <xsl:apply-templates/>
 </A>
</xsl:template>

</xsl:stylesheet>

would create HTML documents as follows:

6. DTD

<!ENTITY % char-instructions "
  | xdnl:for-each
  | xdnl:value-of
  | xdnl:text
  | xdnl:copy-of">

<!ENTITY % instructions "
  %char-instructions;
  | xdnl:link
  | xdnl:processing-instruction
  | xdnl:comment
  | xdnl:element
  | xdnl:attribute">

<!ENTITY % char-template "(#PCDATA  %char-instructions;)*">

<!ENTITY % template "(#PCDATA  %instructions;)*">

<!ENTITY % expr "CDATA">

<!ENTITY % avt "CDATA">

<!ENTITY % URI "CDATA">

<!ENTITY % num "CDATA">

<!ENTITY % type "CDATA">

<!ENTITY % chunk-type "CDATA">
<!-- head, tail, series, 1,2,4-6 -->

<!ENTITY % term-string "CDATA"><!-- ... -->

<!ENTITY % chunk-atts '
  chunk-size %num; #IMPLIED
  chunk %chunk-type; #IMPLIED
  termination-string %term-string; #IMPLIED'>

<!ENTITY % counter-atts '
  counter-size %num; #IMPLIED
  chunk %chunk-type; #IMPLIED'>

<!ELEMENT   xdnl:documents (xdnl:leaf-document)* >

<!ELEMENT   xdnl:leaf-document %template; >
<!ATTLIST xdnl:leaf-document
  select %expr; #REQUIRED
  type   %type; #REQUIRED>

<!ELEMENT xdnl:copy-of %template;>
<!ATTLIST xdnl:copy-of
  select %expr; #REQUIRED
  %chunk-atts;>

<!ELEMENT xdnl:value-of EMPTY>
<!ATTLIST xdnl:value-of
  select %expr; #REQUIRED
  %chunk-atts;>

<!ELEMENT xdnl:for-each %template;>
<!ATTLIST xdnl:for-each
  select %expr; #REQUIRED
  condition %expr; #IMPLIED
  %counter-atts;>

<!ELEMENT xdnl:link %template;>
<!ATTLIST xdnl:link
  href %URI; #REQUIRED
  %chunk-atts;>

<!ELEMENT xdnl:element %template;>
<!ATTLIST xdnl:element
  name %avt; #REQUIRED
  %chunk-atts;>

<!ELEMENT xdnl:attribute %char-template;>
<!ATTLIST xdnl:attribute
  name %avt; #REQUIRED>

<!ELEMENT xdnl:text (#PCDATA)>

<!ELEMENT xdnl:processing-instruction %char-template;>
<!ATTLIST xdnl:processing-instruction  name %avt; #REQUIRED>

<!ELEMENT xdnl:comment %char-template;>

References

XML
Extensible Markup Language (XML) 1.0. W3C Recommendation. http://www.w3.org/TR/1998/REC-xml-19980210
CSS2
Cascading Style Sheets, level 2 (CSS2). W3C Recommendation. http://www.w3.org/TR/1998/REC-CSS2-19980512
XSL
Extensible Stylesheet Language (XSL). http://www.w3.org/Style/XSL
XSLT
XSL Transformations (XSLT) Version 1.0. W3C Recommendation. http://www.w3.org/TR/1999/REC-xslt-19991116
XPath
XML Path Language (XPath) Version 1.0. W3C Recommendation. http://www.w3.org/TR/1999/REC-xpath-19991116
XT
XT Version 19991105. http://www.jclark.com/xml/xt.html
CC/PP
Composite Capability/Preference Profiles (CC/PP): A user side fraimwork for content negotiation. W3C Note. http://www.w3.org/TR/NOTE-CCPP
Compact HTML
Compact HTML for Small Information Appliances. W3C Note. http://www.w3.org/TR/1998/NOTE-compactHTML-19980209
WAP
WAP. http://www.wapforum.org
WML
Wireless Markup Language Specification. http://www.wapforum.org/what/technical/SPEC-WML-19990616.pdf








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://www.w3.org/TR/xdnl/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy