xsl-list
[Top] [All Lists]

Best default value for a result tree fragment?

2005-09-28 04:54:18
Quick question about result tree fragments, having nothing to do with
extension "node-set" functions :-)

I'm generating XHTML from the XML spat out by a content management system.
Various pieces of content are passed to templates as parameters, not all
of which may be present: for example, an interview is just a bunch of
pargraphs, while a movie review also has links to external websites. So I
have templates like:

<xsl:template match"block">
   <xsl:param name="contentRTF"></xsl:param>
   <xsl:param name="linksRTF"></xsl:param>
   <div class="article">
      <xsl:copy-of select="contentRTF" />
      <xsl:copy-of select="linksRTF" />
   </div>
</xsl:template>

What do people think is the "best" way of specifying the default value for
the parameters:

<xsl:param name="contentRTF"></xsl:param>

which gives a RTF containing nothing, or

<xsl:param name="contentRTF" select="" />

which gives an empty nodeset (or something),or even

<xsl:param name="contentRTF select="''" />

which gives an empty string.

I appreciate that, for all practical purposes, I should get the same
output from all of them, but was wondering which might be seen as the
canonical way of doing it, given that any *passed* value will always be a
result tree fragment. Must have my strong-typing head on today :-)

Any thoughts?

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>