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

RE: Call for feedback : Update extensions

Subject: RE: Call for feedback : Update extensions
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 18 Nov 1999 10:09:41 -0000
kay updating
> The basic update statement I suggest (to update the source DOM) is :
> 
>   <xslql:update
>     match = pattern 
>     select = expression>
>   <!-- Content: template -->
>   </xslql:template> 
> 
Match=pattern suggests you have to search the whole document looking for the
nodes that match, which is pretty inefficient.

SAXON only allows update of attributes on the current (element) node, and
uses the syntax 
<saxon:set-attribute name="attname"
[select="expr"]>[value]</saxon:set-attribute>
If you want to do update multiple nodes, or update a node that is not
current, you use xsl:for-each, e.g
<xsl:for-each select="//item[not(@price)]">
<saxon:set-attribute name="price" select="100.00"/>
</xsl:for-each>
It would be easy to extend this syntax to modify the value of a text node;
other updates such as adding or deleting nodes would require more careful
thought, not only as regards the syntax, but also as regards the
side-effects, e.g. on the value of variables that hold a node-set. Generally
speaking, updating the source tree rather violates the spirit of the
language. The main reason I implemented saxon:set-attribute was part of the
attempt to create a version of XSL that worked without building the full
tree in memory, though it can also be very handy for expanding defaults e.g.
before doing totalling or sorting. I have mixed feelings on whether it was a
good idea.

Mike Kay


 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.