BizTalk Utilities CV ,   Jobs ,   Code library  
 
 
Page 11 of 15

 

Previous Page Table Of Contents Next Page

XSL Transformations, cont.

Generating Comments with xsl:comment

You can also create comments on the fly with the <xsl:comment> element. Here's an example; in this case, I'm creating comments that will replace <PLANET> elements, and I'll include the name of the planet in the text of the comment:

<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

 

<xsl:template match="PLANETS">

    <HTML>

        <HEAD>

            <TITLE>

                Planets

            </TITLE>

        </HEAD>

        <BODY>

            <xsl:apply-templates select="PLANET"/>

        </BODY>

    </HTML>

</xsl:template>

 

<xsl:template match="PLANET">

    <xsl:comment>This was the <xsl:value-of select="NAME"/> element</xsl:comment>

</xsl:template>

 

</xsl:stylesheet>

Here's the result:

<HTML>

<HEAD>

<TITLE>

                Planets

            </TITLE>

</HEAD>

<BODY>

<!--This was the Mercury element-->

<!--This was the Venus element-->

<!--This was the Earth element-->

</BODY>

</HTML>

 

Page 11 of 15

 

Previous Page Table Of Contents Next Page
 

Recent Jobs

An immediate job opportunity as a B
Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C

View all Jobs (Add yours)
View all CV (Add yours)



answering service
conference calling
swimming pool builder
spfxmasks
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP