Hi Guvenc
The SetValue QPAC does not allow you to use predicates (i.e. square brackets) on the left hand side of an assignment.
In other words:
/process_data/@myvalue = /process_data/myxml/root/repeat[3]/name
is okay, but
/process_data/myxml/root/repeat[3]/name = /process_data/@myvalue
is not okay.
There are actually some good reasons for this behaviour - Xpath is a way of retrieving data, not creating it - this is actually very unfortunate, because it would be very helpful, as you've found. (There are some interesting technical problems around using XPath to create xml, such as: what should it do if /repeat[1] and repeat[2] don't exist?)
One way to work around this is to create the entire xml document in a string or XML variable, and then assign the entire thing to the root node of your form. You may have to mess with the syntax a bit (I haven't verified that this expression is exactly correct), but it would be something like:
/process_data/formvar/form-data/data/xdp/datasets/data =
deserialize(/process_data/@xml_as_a_string)
We have a SetText QPAC which makes it a little easier to construct a large xml file as a string like this (with embedded xpath expressions), but you can also create it by using SetValue and the Xpath concatenate() function.
You can downlaod SetText from:
http://www.avoka.com/avoka/qpac_library.shtmlDepending what you're trying to do, you could also write a custom QPAC (once you have a DOM, you can do whatever you need to), or we would be happy to write one for you.
Good luck...
Howard
http://www.avoka.com