xsl-list
[Top] [All Lists]

[xsl] Re: <xsl:element> and literal elements

2006-05-27 10:29:49
Hi there,

 Wendell Piez wrote:
 At 06:31 PM 5/25/2006, you wrote:
 I'd be curious if people on this list
 have opinions on whether or not they've come up with rules for when to
 use literal result elements and when to use xsl:element.


 My $0.02:

 Use literal result elements when you can; use xsl:element when you have to.

 Interesting -- my instincts are completely the opposite. I like the
 clarity of <xsl:element and <xsl:attribute. I like all actual elements
 in the stylesheet to be in the xsl namespace if possible. I don't like
 the idea of literal text containing angle brackets that turn into
 elements in the output data; it seems a little confusing. I think I
 would actually prefer it if this:

        <xsl:template match="xml_blah">
                <html_blah />
        </xsl:template>

 resulted in this output:
        
        &lt;html_blah /&gt;

 while this:

        <xsl:template match="xml_blah">
                <xsl:element name="html_blah" />
        </xsl:template>

 resulted in this:

        <html_blah />

 I use <xsl:element and <xsl:attribute wherever I can, and I've never
 noticed any real impact on speed (although most of my slower stylesheets
 are slow because of lots of looping and recursion, rather than because
 I'm not using literal elements.

 Cheers,
 Martin


--~------------------------------------------------------------------
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>