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: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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Xalan to transform only selecte, Mike Brown | Thread | Re: Xalan to transform only selecte, P. DEXTER |
Re: Xalan to transform only selecte, Mike Brown | Date | Re: XHTML to WML problem, Tom Myers |
Month |