| HTML Tutorials |
|
|
| XML Tutorials |
|
|
| Browser Scripting |
|
|
| Server Scripting |
|
|
| .NET (dotnet) |
|
|
| Multimedia |
|
|
| Web Building |
|
|
| Java Tutorials |
|
|
| Programming Langauges |
|
|
| Soft Skills |
|
|
|
|
XSL Output Element
|
|
An "xsl:output" element allows the stylesheet authors to specify how do they wish a
result tree to be output. If the XSL processor outputs a result tree, it must
do so as specified by a xsl:output element; however, it is required not to do so.
An xsl:output element is allowed only as the top-level element.
outputs as html
|
XML Source
<source>
<hr/>
<hr/>
<hr/>
</source>
|
Output
<source>
<hr>
<hr>
<hr>
</source>
|
|
XSL stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:copy-of select="/source"/>
</xsl:template>
</xsl:stylesheet>
|
|
|
HTML Method
|
|
When xml:output element is not present the default output method is "xml"
(see to XSL stylesheet 1 ), And if the document element of output has a value "html"
which is case insensitive and it does not have the 'xmlns' attribute, then the html
method is made used
|
XML Source
<source>
<h1> XML output </h1>
<hr/>
</source>
|
Output
<h1> XML output </h1>
<hr/>
|
|
XSL stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<xsl:copy-of select="/source/*"/>
</xsl:template>
</xsl:stylesheet>
|
|
|
HTML Output Method
|
|
An html output method must not output the end-tag for an empty elements specified in
the HTML specification. An html output method must not perform the escaping for a content
of the script and also the style elements.
|
XML Source
<source>
<h1> HTML output </h1>
<AAA/>
<HR/>
<script>if (a < b) foo(); if (cc < dd) foo() </script>
<hr/>
<hr/>
<Hr/>
<hR/>
</source>
|
Output
<h1> HTML output </h1>
<AAA></AAA>
<HR><script>if (a < b) foo();
if (cc < dd) foo()
</script><hr>
<hr>
<Hr>
<hR>
|
|
XSL stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:copy-of select="/source/*"/>
</xsl:template>
</xsl:stylesheet>
|
|
|
Encoding Attribute
|
|
Encoding attribute do specify the preferred encoding to be made used. An html output
method must add the META element immediately after start-tag of HEAD element
specifying a character encoding actually been used. XSL stylesheet 1 outputs in the UTF-8,
An xml source do contains the characters which are not present in the specified character
set and they are therefore been escaped.
|
XML Source
<source>
<html>
<head>
<title>HTML</title>
</head>
<body>
<h1> HTML output </h1> ?í?ala ?nek ko?ka pa?ez be?ka me?ec vyr
</body>
</html>
</source>
|
Output
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HTML</title>
</head>
<body>
<h1> HTML output </h1>
?í?ala ?nek
ko?ka pa?ez
be?ka mě?ec vyr
</body>
</html>
|
|
XSL stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:copy-of select="/source/*"/>
</xsl:template>
</xsl:stylesheet>
|
|
|
Text Output Method
|
|
A text output method outputs result tree by outputting a string-value of every
text node in a result tree in the document order without doing any escaping.
|
XML Source
<source>
<AAA id="12"/>
</source>
|
Output
<!ELEMENT AAA ANY><!ATTLIST AAAid ID #REQUIRED>Look at my source in your browser
|
|
XSL stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="text"/>
<xsl:template match="AAA">
<xsl:text><!ELEMENT </xsl:text>
<xsl:value-of select="name()"/>
<xsl:text> ANY></xsl:text>
<xsl:text><!ATTLIST </xsl:text>
<xsl:value-of select="name()"/>
<xsl:text/>
<xsl:value-of select="name(@*)"/>
<xsl:text> ID #REQUIRED></xsl:text>
<xsl:text>Look at my source in your browser</xsl:text>
</xsl:template>
</xsl:stylesheet>
|
|
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords XSL Output Element, xsl namespace, xsl variable, xsl xpath, xsl document, xsl javascript,
xsl entity, xsl text, xsl css, xsl count, xsl doctype, xsl sort, xsl editor, xsl xhtml,
saxon xsl, jsp xsl, xsl schema, xsl href, xsl encoding, xsl param, xsl stylesheet,
w3c xsl, rss xsl, xsl template, xsl if, xsl include, xsl html, xsl function, xsl parameter,
xsl processor, xsl node, xsl id, xsl select, xsl date, xsl fop, xsl dom, xsl fo, docbook xsl,
c# xsl, xsl parser, xsl transf, xalan xsl
|
|
| HTML Quizes |
|
|
| XML Quizes |
|
|
| Browser Scripting Quizes |
|
|
| Server Scripting Quizes |
|
|
| .NET (dotnet) Quizes |
|
|
| Multimedia Quizes |
|
|
| Web Building Quizes |
|
|
| Java Quizes |
|
|
| Programming Langauges Quizes |
|
|
| Soft Skills Quizes |
|
|
|