xsl-list
[Top] [All Lists]

Re: literal result elements vs. <xsl:element>

2003-10-01 10:11:01
Abie,

At 12:21 PM 10/1/2003, you wrote:
can someone please explain what the difference is between using literal result elements and using <xsl:element>, and what pros and cons exist?

Stay tuned, someone will say....

I have been using <xsl:element>, b/c it had seemed the more correct somehow, but from what I'm reading on literal result elements, they should work just as well, and they even offer the advantage of being able categorically to use attribute value templates. (-and they're in the book, so that means they're legitimate.;) ).

They're legitimate as can be.

I mainly use literal result elements because they're easier to type and to read and debug (since they look like fragments of the target).

However I know an esteemed XML uber-guru who uses xsl:element so that he can use the tagging support in his preferred coding environment (Emacs) with validation and tag completion.

There are a number of things you can do with xsl:element that aren't possible with literal result elements, whose advantage is mainly conciseness and ease of use.

Also there's the "literal result element as stylesheet" feature (check the spec), which isn't actually used all that much in my experience: it's syntax sugar for a "pull" stylesheet.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list