xsl-list
[Top] [All Lists]

Re: [xsl] XSLT and XML in the same document

2007-05-29 03:11:21
On 5/29/07, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

> It's been a while since I bothered with this, but I think the pattern
> goes something like:
>
> <xsl:variable name="foo-rtf">
>
> and
>
> <xsl:variable name="foo">
>   <xsl:choose>
>     <xsl:when test="function-available(...)">
> ....

the problem is that that pattern makes $foo into an rtf again so you are
back where you started (or at least you are a line or two further on,
but you have to keep nesting with consequent doubling in code paths
everywhere you need to call the function.

er, yeah.  So it should be:

<xsl:variable name="foo-msxml" select="msxsl:node-set()"/>
<xsl:variable name="foo-exslt" select="exslt:node-set()"/>

<xsl:variable name="is-msxml">
 <xsl:choose>
   <xsl:when test="function-available(msxsl:node-set())">true</
  ..
..

and then in the body of the code:

<xsl:choose>
 <xsl:when test="$is-msxml">...

or some other long-winded, verbose approach.  Oh don't forget
whitespace.  Then then different versions of MSXML and whether they're
in side-by-side or replace mode.  Then there's whether the result tree
is serialized or parsed directly... and um loads of other
considerations that I don't know because I gave up long ago and move
to the garden of peace and tranquility that is XSLT 2.0.

> I guess its good that people persist with client side XSLT (as one day
> it might be worthwhile), but I reckon its just a hangover from the
> original intentions of XML.

heretic.

:) pragmatist more like... (but I agree that client side transforms
are some kind of religion)

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