[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Xalan to transform only selected elements of XML

Subject: RE: Xalan to transform only selected elements of XML
From: Heather Lindsay <heather.lindsay@xxxxxxxxxxxxx>
Date: Tue, 30 May 2000 16:09:20 -0400
xsl transform selected elements
<xsl:apply-templates/> will call all templates of the children of the
current node.  If no template is given for a particular node then the
default template is called which prints out the value of the given element
(if applicable).  

Say you have the following XML document:
<root>
<child1> text1 </child1>
<child2> text2 </child2>
<child3> text3 </child3>
</root>

And the following XSL:
<xsl:template match="/">     
	<HTML>
	   <BODY>
	      <xsl:apply-template select="child1">
	   <BODY>
	</HTML>
</xsl:template>

<xsl:template match="child1">
	<p><xsl:value-of select="."/></p>  
</xsl:template>

Then you get the following html output:
<HTML>
   <BODY>
	<p> text1 </p>
   </BODY>
</HTML>


So:
If you only want some elements to get transformed then you only get those
elements that you want transformed.  There is no need to remove elements
from an XML file in order to only output some of the elements.

Hope this helps,
Heather
__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.