Library sample chapters
Using XML Queries and Transformations
- Introduction
- XPath Query Syntax
- Building a Path
- Selecting Subsets
- Built-In Functions
- IE5 Conformance
- XLST
- XLST Elements
- Pre-defined Templates
- Number Calculation Example
- Commands
- Control of Flow
- Variables and Parameters
- Top Level Settings
- Built-in Functions
- Simplified Syntax
- The IE5 Implementation
- XLST Examples
- Giving Style to XML
- Summary
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.
Related articles
Related discussion
-
How to import Xml file into a table in MS-ACCESS database using Visual Basic 6.0?
by sutanu_halder (0 replies)
-
XML transformation: how to save it into a hmtl file.
by srinathnrk (1 replies)
-
Run-time error '91'
by converter2009 (1 replies)
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
The table under "format attribute" on the following page also seems to be truncated: http://www.developerfusion.com/show/89/10/
my apologies for that, it appears the article became truncated. The rest of the text on 'giving style to XML' is now there.
Regards,
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 it promises to...
This thread is for discussions of Using XML Queries and Transformations.