Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

XSL Tutorial
XSL Introduction
Introduction to XSL
XSL Templates
XSL Attributes
The XSL Axes
Repetitions And Sortings in XSL
XSL Elements
XSL Conditional processing
Number generation and formatting in XSL
XSL Variables
Numeric Calculation in XSL
XSL Boolean Function
XSL String Functions
XSL Nodeset
XSL Output Element
Copy and Copy-of Constructs in XSL
Miscellaneous Additional Functions
XSL Combining
XSL Internationalization
Summary to xsl

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


XSL Output Element

Previous Next



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.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

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
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.