Re: [xsl] Using XPath for node assignment

Subject: Re: [xsl] Using XPath for node assignment
From: Johannes Döbler <jd@xxxxxxxxxxxxxx>
Date: Sat, 07 Apr 2001 00:17:11 +0200
Hello Andrew,

using a XPath expression you can only define a set of nodes but not change the nodes directly. But if you only want to change node values (and not the tree structure) you can use XPath to select a set of nodes (represented by a data structure of the XPath implementation) and then let your program loop over the nodes in the set and assign a new value to them. Could be a very elegant solution compared to a direct manipulation of a DOM tree.

Johannes


Hello all,
I'm working on an application that will require in-memory modification of a DOM tree. This is a tedious task using only raw DOM manipulation.
Unfortunately, the existing XML<->Object frameworks (DXML, JDOM, etc.) are not suitable for my purposes.


I thought it might be somewhat interesting to turn XPath inside out and use it to assign values to nodes rather than extract node values. So, I'm wondering if this functionality exists anywhere or if my thinking is in some way flawed.

Andrew


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


Current Thread