Creating the Result Tree

Creating the Result Tree
Literal Result Elements
Any element in a template rule that is not in the XSL (or other extension) namespace is copied literally to the result tree
The content of <xsl:text> elements is copied directly to the result tree; whitespace is preserved by default

<xsl:text>Literal result text</xsl:text>

Inserts the value of an expression into the result tree, converting it to a string first if necessary

<xsl:value-of select=”$count + 1″/>

<xsl:copy> and <xsl:copy-of>
Copies the current node or, in the case of xsl:copy-of, the selected nodes, into the result tree without first converting them to a string

<xsl:copy-of select=”title”/>

Instantiates the named element

<xsl:param name=”header”>h3</xsl:param>

<xsl:element name=”{$header}”>
Adds the named attribute to the nearest containing element
<xsl:if test=”@pgwide=’1′”>
<xsl:attribute name=”width”>100%</xsl:attribute> </xsl:if>

Source code of xsl_result_tree.xsl:
<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE xsl:stylesheet[

	<!ENTITY nbsp " ">


<xsl:stylesheet version="1.0" xmlns:xsl="">

<xsl:output method="html" encoding="iso-8859-1" />

<xsl:variable name="tbl">







 <xsl:attribute-set name="tblAttrib">

 <xsl:attribute name="border">



 <xsl:attribute name="cellspacing">



 <xsl:attribute name="bordercolor">





<xsl:template match="/">



<title>XSLT xsl:element Example</title>



<span style="width 600px;border: 2px outset blue solidl;display:block">


</span><br />

<table xsl:use-attribute-sets="tblAttrib">

<xsl:copy-of select="$tbl" />

<xsl:for-each select="ebiz/employee_details">


	<td><xsl:element name="emp_name">

 <xsl:value-of select="fname" />  <xsl:value-of select="lname" />


	<td><xsl:value-of select="address" /></td>

	<td><xsl:value-of select="designation" /></td>




<br /> 




Scroll to Top