This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Xalan to transform only selected elements of XML


<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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]