[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: The evaluate function

Subject: RE: The evaluate function
From: "Evan Lenz" <elenz@xxxxxxxxxxx>
Date: Thu, 3 Jan 2002 11:57:02 -0800
resources concat
Jeni Tennison wrote:
> Make it optional? Or partially optional if there's a subset of
> expressions that these implementers could handle.

>From one perspective (not necessarily that of the XSL WG's), it already is
optional. See "12.1 Multiple Source Documents", beginning at the fourth
paragraph.

XPointer becoming Recommendation may be the only thing keeping XSLT 1.0
processors from conformantly (and optionally?) implementing what effectively
can be used as an alternative to an explicit evaluate().

This wouldn't meet all of Jeni's use cases, but it would meet 90%+ of the
theoretical eventual uses of evaluate(), I bet.

Take the Linking use case:

> 3. Linking
>
> A third example is where someone has used XPath as a means of
> specifying the links between two pieces of data. The link needs to be
> interpreted on the fly in order to pull in information from the linked
> source.
>
> For example, you might have something like:
>
> <para>
>   The picture is <insert resource="images/image[3]" />.
> </para>
>
> And need to do:
>
> <xsl:template match="insert">
>   <xsl:copy-of
>     select="document('resources.xml')/resources/evaluate(@resource)" />
> </xsl:template>

With an XSLT processor that supported XPointer, I would just write the
following instead:

<xsl:template match="insert">
  <xsl:copy-of

select="document(concat('resources.xml#xpointer(/resources)/',@resource))"/>
</xsl:template>

The string passed to document() doesn't have to be a literal, so I've just
sneaked dynamic expressions into XSLT.

Evan


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.