|
[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
<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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








