
What is the "When this XPath expression is true" parameter of an action definition evaluated relative to? The docs just say "an XPath expression that applies to elements and attributes;" but they don't say what the current element is at the time the xpath is evaluated. My reason for asking is this: I want to create a button to add an element to a document. But since this element is only allowed once inside its parent element, I would like the button to either disappear or be disabled if the parent element already contains the element that the button inserts. Ideally, I would like to do this using the stylesheet to remove the button when the child element already exists, but CSS does not provide a selector for an element that contains (or does not contain) another element, so there does not seem to be a way to do that. (Enhancement request for an Oxygen CSS extension for this purpose) So since that does not work, my next approach is to invalidate the button if the child element already exists. To do this, I think I would need the "When this XPath expression is true" parameter to be evaluated relative to the path specified in the "insertLocation" parameter, but that does not seem to be how it works. So, what is the current element when "When this XPath expression is true" parameter is evaluated. And, more generally, can anyone think of a way to do what I am trying to do here? Thanks, Mark