This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DOM and XML parser


Hi Américo,

> yes, it is an interesting idea. but that whouldn't be the same as
> setting the variable after the match??
> like:
> <xsl:template match="book[@price]">
>  <xsl:variable name="v" select="@price"/>
>  ...

The same in effect, yes, but the point in fxgrep is that with:

<xsl:template match="book[%@price]">
  ...
</xsl:template>

the price attribute could be bound to the variable *during* the
matching rather than after finding the node. This saves you from
having to scan the node and its relationships with other nodes more
than once, which is particularly useful as you get to use more complex
match patterns.

Anyway, I'm not particularly advocating the idea -- I wouldn't want to
see XSLT complicated in this way (after all, it's getting complicated
enough by XPath 2.0 without anything like this!) -- just thought it
was an interesting approach.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]