From: alex <aly...@ya...> - 2008-07-29 02:57:16
|
Hi all, I've recently graduated from making embarrassingly stupid newbie mistakes retrieving things from exist, to making painfully boneheaded newbie mistakes updating stuff already in exist. And the first problem i've run into is - how does one go about adding an attribute to an element? I tried > update value $element/@newAttr with 'attrValue' but that doesn't work, probably because $element/@newAttr doesn't yet exist. From the real XUF recommendation, it looks like you'd do something like > insert node (attribute newAttr {'attrValue'}) into $element but that doesn't even compile. It doesn't look from the doc like "update insert" would work in this case - do i need to do an "update replace", somehow including the entire element plus the new attribute in exprSingle? If so, what might that look like? Thanks, --alex. |