Diagram represents the transformation process: taking in an XML document, applying the XSLT file to the nodes of the XML document, and generating another document of the desired format.
A D V E R T I S E M E N T
It consist of two functions. The first function simply reads an XML document and then transforms the data using an XSLT file. The second function reads an XML document, transforms the data, and then writes a new XML document from the transformed data.
<w3.org ownedBy="The World Wide Web Consortium">
<host>
www
<use>World Wide Web site</use>
</host>
<host>
validator
<use>web developers who want to get it right</use>
</host>
</w3.org>
</domains>
<!--Table headers and outline-->
<xsl:template match="domains/*">
<h1><xsl:value-of select="@ownedBy"/></h1>
<p>The following host names are currently in use at
<strong><xsl:value-of select="local-name(.)"/></strong>
</p>
<table>
<tr><th>Host name</th><th>URL</th><th>Used by</th></tr>
<xsl:apply-templates/>
</table>
</xsl:template>
<!--Table row and first two columns-->
<xsl:template match="host">
<!--Create variable for 'url', as it's used twice-->
<xsl:variable name="url" select=
"normalize-space(concat('http://', normalize-space(node()), '.',
local-name(..)))"/>
<tr>
<td><xsl:value-of select="node()"/></td>
<td><a href="{$url}"><xsl:value-of select="$url"/></a></td>
<xsl:apply-templates select="use"/>
</tr>
</xsl:template>
<h1>The World Wide Web Consortium</h1>
<p>The following host names are currently in use at
<strong>w3.org</strong></p>
<table>
<tr>
<th>Host name</th>
<th>URL</th>
<th>Used by</th>
</tr>
<tr>
<td>www</td>
<td><a href="http://www.w3.org">http://www.w3.org</a></td>
<td>World Wide Web site</td>
</tr>
<tr>
<td>validator</td>
<td><a href="http://validator.w3.org">http://validator.w3.org</a></td>
<td>web developers who want to get it
right</td>
</tr>
</table>
</body>
</html>
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords xslt transform,
xsl transform,
xslt transform xml,
xml xsl transform,
xalan transform,
xsl transforms,
c# xsl transform,
net xsl transform,
xslt transforms,
javascript xsl transform,
transform xml with xsl,
java xsl transform,
transform xml using xslt,
net xslt transform,
java xslt transform,
xsl identity transform,
xslt for each,
asp net xslt,
asp net transform,
xslt transformation.