Found 55 pages:

# Page Tags and summary
1 XSLT: Extensible Stylesheet Language Transformations XSLT
^ This description of XSLT is obtained from the Wikipedia XSLT article.
2 Common XSLT Errors XSLT
Your server needs to send both the source and the stylesheet with a XML mime type, text/xml or application/xml. To find out the current type, load the file in Mozilla and look at the page info. Or use a download tool, those usually tell the mime type.
3 Index Index, Reference, XSLT
Found 55 pages:
4 PI Parameters XSLT
No summary!
5 The XSLT/JavaScript Interface in Gecko XSLT
No summary!
6 Advanced Example XSLT
The advanced example will sort several divs based on their content. The example allows to sort the content multiple times, alternating between ascending and descending sorting. The JavaScript only loads the .xsl file the first time, and sets the xslloaded variable to true once it has finished loading the file. Using the XSLTProcessor.getParameter() method, the code can figure wether to sort by ascending or descending. It defaults to ascending if the parameter is empty (first time the sorting happens, as there is no value for it in the XSLT file). The sorting value is set using XSLTProcessor.setParameter().
7 Basic Example XSLT
The basic example will load an XML file and apply a XSL transformation on it. These are the same files used in the Generating HTML example in the XSLT in Netscape Gecko article. The XML file describes an article and the XSL file formats the information for display.
8 Interface List
See XSLTProcessor in the Web API documentation section.
9 Introduction
With modern browsers supporting XSLT, developers can now use JavaScript to access the power that XSLT provides. JavaScript can enable a web application to load XML data, process it via XSLT into a presentable form and then add it into an existing document. Since the XML data loaded only contains the raw information without any presentation data, it can load quickly even on dialup.
10 JavaScript/XSLT Bindings
JavaScript can run XSLT transformations through the XSLTProcessor object. Once instantiated, an XSLTProcessor has an XSLTProcessor.importStylesheet() method that takes as an argument the XSLT stylesheet to be used in the transformation. The stylesheet has to be passed in as an XML document, which means that the .xsl file has to be loaded by the page before calling XSLTProcessor.importStylesheet(). This can be done via XMLHttpRequest or XMLDocument.load().
11 Resources XSLT
No summary!
12 Setting Parameters XSLT
While running transformations using precoded .xsl and .xml files is quite useful, configuring the .xsl file from JavaScript may be even more useful. For example, JavaScript and XSLT could be used to sort XML data and then display it. The sorting would have to alternate between ascending and descending sorting.
13 Transforming XML with XSLT NeedsMigration, Transforming_XML_with_XSLT, XML, XSLT
The separation of content and presentation is a key design feature of XML. The structure of an XML document is designed to reflect and clarify important relationships among the individual aspects of the content itself, unhindered by a need to provide any indication about how this data should eventually be presented. This intelligent structuring is particularly important as more and more data transfers are automated and take place between highly heterogeneous machines linked by a network.
14 An Overview NeedsHelp, NeedsMarkupWork, Transforming_XML_with_XSLT, XML, XSLT
The eXtensible Stylesheet Language/Transform is a very powerful language, and a complete discussion of it is well beyond the scope of this article, but a brief discussion of some basic concepts will be helpful in understanding the description of Netscape's capabilities that follows.
15 For Further Reading NeedsContent, NeedsHelp, Transforming_XML_with_XSLT, XML, XSLT
16 Resources
No summary!
17 The Netscape XSLT/XPath Reference
No summary!
18 Using the Mozilla JavaScript interface to XSL Transformations XSLT
This document describes the JavaScript interface in Mozilla 1.2 and up to the XSLT Processing Engine (TransforMiiX).
19 XSLT elements reference XSLT, XSLT_Reference
On a related note, any attribute in an LRE and some attributes of a limited number of XSLT elements can also include what is known as an attribute value template. An attribute value template is simply a string that includes an embedded XPath expression which is used to specify the value of an attribute. At run-time the expression is evaluated and the result of the evaluation is substituted for the XPath expression. For example, assume that a variable "image-dir" is defined as follows:
20 apply-imports XSLT, XSLT_Reference

The <xsl:apply-imports> element is fairly arcane, used mostly in complex stylesheets. Import precedence requires that template rules in main stylesheets have higher precedence than template rules in imported stylesheets. Sometimes, however, it is useful to be able to force the processor to use a template rule from the (lower precedence) imported stylesheet rather than an equivalent rule in the main stylesheet.
21 apply-templates XSLT, XSLT_Reference
The <xsl:apply-templates> element selects a set of nodes in the input tree and instructs the processor to apply the proper templates to them.
22 attribute XSLT, XSLT_Reference
The <xsl:attribute> element creates an attribute in the output document, using any values that can be accessed from the stylesheet. The element must be defined before any other output document element inside the output document element for which it establishes attribute values. But it may be after or inside elements that won't be part of the output (like <xsl:choose> or <xsl:apply-templates> etc.).
23 attribute-set XSLT, XSLT_Reference
The <xsl:attribute-set> element creates a named set of attributes, which can then be applied as whole to the output document, in a manner similar to named styles in CSS.
24 call-template XSLT, XSLT_Reference
The <xsl:call-template> element invokes a named template.
25 choose XSLT, XSLT_Reference
The <xsl:choose> element defines a choice among a number of alternatives. It behaves like a switch statement in procedural languages.
26 comment XSLT, XSLT_Reference
The <xsl:comment> element writes a comment to the output document. It must include only text.
27 copy XSLT, XSLT_Reference
The <xsl:copy> element transfers a shallow copy (the node and any associated namespace node) of the current node to the output document. It does not copy any children or attributes of the current node.
28 copy-of XSLT, XSLT_Reference
The <xsl:copy-of> element makes a deep copy (including descendant nodes) of whatever the select attribute specifies to the output document.
29 decimal-format XSLT, XSLT_Reference
The <xsl:decimal-format> element defines the characters and symbols that are to be used in converting numbers into strings using theformat-number( ) function.
30 element XSLT, XSLT_Reference
The <xsl:element> element creates an element in the output document.
31 fallback XSLT, XSLT_Reference
The <xsl:fallback> element specifies what template to use if a given extension (or, eventually, newer version) element is not supported.
32 for-each XSLT, XSLT_Reference
The <xsl:for-each> element selects a set of nodes and processes each of them in the same way. It is often used to iterate through a set of nodes or to change the current node. If one or more <xsl:sort> elements appear as the children of this element, sorting occurs before processing. Otherwise, nodes are processed in document order.
33 if XSLT, XSLT_Reference
The <xsl:if> element contains a test attribute and a template. If the test evaluates to true, the template is processed. In this it is similar to an if statement in other languages. To achieve the functionality of an if-then-else statement, however, use the <xsl:choose> element with one <xsl:when> and one <xsl:otherwise> children.
34 import XSLT, XSLT_Reference
The <xsl:import> element is a top-level element that serves to import the contents of one stylesheet into another stylesheet. Generally speaking, the contents of the imported stylesheet have a lower import precedence than that of the importing stylesheet. This is in contrast to <xsl:include> where the contents of the included stylesheet have exactly the same precedence as the contents of the including stylesheet.
35 include XSLT, XSLT_Reference
The <xsl:include> element merges the contents of one stylesheet with another. Unlike the case of <xsl:import>, the contents of an included stylesheet have exactly the same precedence as the contents of the including stylesheet.
36 key XSLT, XSLT_Reference
The <xsl:key> element declares a named key which can be used elsewhere in the stylesheet with the key( ) function.
37 message XSLT, XSLT_Reference
The <xsl:message> element outputs a message (to the JavaScript Console in NS) and optionally terminates execution of the stylesheet. It can be useful for debugging.
38 namespace-alias XSLT, XSLT_Reference
The <xsl:namespace-alias> element is a rarely used device that maps a namespace in the stylesheet to a different namespace in the output tree. The most common use for this element is in generating a stylesheet from another stylesheet. To prevent a normally xsl:-prefixed literal result element (which should simply be copied as-is to the result tree) from being misunderstood by the processor, it is assigned a temporary namespace which is appropriately re-converted back to the XSLT namespace in the output tree.
39 number XSLT, XSLT_Reference
The <xsl:number> element counts things sequentially. It can also be used to quickly format a number.
40 otherwise XSLT, XSLT_Reference
The <xsl:otherwise> element is used to define the action that should be taken when none of the <xsl:when> conditions apply. It is similar to the else or default case in other programing languages.
41 output XSLT, XSLT_Reference
The <xsl:output> element controls the characteristics of the output document. To function correctly in Netscape, this element, with the method attribute, must be used. As of 7.0, method="text" works as expected.
42 param XSLT, XSLT_Reference
The <xsl:param> element establishes a parameter by name and, optionally, a default value for that parameter. When used as a top-level element, the parameter is global . When used inside an <xsl:template> element, the parameter is local to that template. In this case it must be the first child element of the template.
43 preserve-space XSLT, XSLT_Reference
The <xsl:preserve-space> element defines the elements in the source document for which whitespace should be preserved. If there is more than one element, separate the names with a whitespace character. Preserving whitespace is the default setting, so this element only needs to be used to counteract an <xsl:strip-space> element.
44 processing-instruction XSLT, XSLT_Reference
The <xsl:processing-instruction> element writes a processing instruction to the output document.
45 regexp
No summary!
46 sort XSLT, XSLT_Reference
The <xsl:sort> element defines a sort key for nodes selected by <xsl:apply-templates> or <xsl:for-each> and determines the order in which they are processed.
47 strip-space XSLT, XSLT_Reference
The <xsl:strip-space> element defines the elements in the source document for which whitespace should be removed.
48 stylesheet XSLT, XSLT_Reference
The <xsl:stylesheet> element (or the equivalent <xsl:transform> element) is the outermost element of a stylesheet.
49 template XSLT, XSLT_Reference
The <xsl:template> element defines an output producing template. This element must have either the match attribute or the name attribute set.
50 text XSLT, XSLT_Reference
The <xsl:text> element writes literal text to the output tree. It may contain #PCDATA, literal text, and entity references.
51 transform XSLT, XSLT_Reference
The <xsl:transform> element is exactly equivalent to the <xsl:stylesheet> element.
52 value-of XSLT, XSLT_Reference
The <xsl:value-of> element evaluates an XPath expression, converts it to a string, and writes that string to the result tree.
53 variable XSLT, XSLT_Reference
The <xsl:variable> element declares a global or local variable in a stylesheet and gives it a value. Because XSLT permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of scope
54 when XSLT, XSLT_Reference
The <xsl:when> element always appears within an <xsl:choose> element, acting like a case statement.
55 with-param XSLT, XSLT_Reference
The <xsl:with-param> element sets the value of a parameter to be passed into a template.

Document Tags and Contributors

Contributors to this page: mfluehr, Fredchat, fscholz
Last updated by: mfluehr,