Subject: Re: [xsl] value-of or apply-templates From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 10 Mar 2004 12:24:47 GMT |
<xsl:apply-templates /> or: <xsl:value-of select="."> when you get to the node nested at the lowest level and you simply want to get its content? if you know that you should probably use value-of as it's probably a fraction quicker, and it _definitely_ produces what you want (apply-templates will produce whatever the template for text nodes does which may or may not be the same as value-of. On the other hand, for document types that I control, whenever I've used value-of because I "know" I'm at a leaf we've later extended the document type to deal with something or other and allowed markup there so then I've had to go back and change to apply-templates. So, for fixed public things, docbook, xhtml, etc I'd use value-of but for more fluid things I'd use apply-templates. -- http://www.dcarlisle.demon.co.uk/matthew ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] value-of or apply-templates, Richard Lewis | Thread | Re: [xsl] value-of or apply-templat, Wendell Piez |
[xsl] Embedding html within xml, John Reid | Date | Re: [xsl] Embedding html within xml, David Carlisle |
Month |