Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Book Cover Professional VB XML
66476 times
Rated
Read 66,476 times

Contents

Related Categories

Using XML Queries and Transformations - Simplified Syntax

Simplified Syntax

For very simple stylesheets that consist of only one template matching the root, a special simplified syntax is specified. In this simplified syntax, the whole document is the content of the template. The stylesheets that can use this simplified syntax are often doing transformations, mostly consisting of literals defining a template document. Only a few values from the source document are entered in specific locations.

The XML documents defining an article's content could be transformed by this stylesheet:

<HTML xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<BODY>
<H1><xsl:value-of select="/Article/Title"/></H1>
<p><b><xsl:value-of select="/Article/Intro"/></b></p>
<p><xsl:value-of select="/Article/Body"/></p>
</BODY></HTML>

XSLT Language Extensions

XSLT processor vendors are free to add their own private extensions to the language. The XSLT specification even specifies how they should indicate if an extension element or extension function is supported by their implementation.

In the stylesheet, certain namespaces can be specified to be XSLT extension namespaces with the xsl:extension-element-prefixes attribute on the stylesheet element. Elements in those namespaces will be processed using the extensions of the used processor.

If the stylesheet author wants to know if the processor supports a certain extension element, the function element-available() can be called with the element name as the parameter. If the processor supports this element, the function should return true.

Comments

  • Another truncated page

    Posted by RobS on 02 Nov 2004

    The table under "format attribute" on the following page also seems to be truncated: http://www.developerfusion.com/show/89/10/

  • Posted by James Crowley on 16 Jun 2002

    my apologies for that, it appears the article became truncated. The rest of the text on 'giving style to XML' is now there. :)

    Regards,

  • Wow.

    Posted by godtsaa on 16 Jun 2002

    The 'giving style to XML' part of the article (which is the only part that interested me, sigh) is apparently corrupt - It ends in the middle of a sentence, and so it doesn't explain one bit of what i...