Wrote a little java function that does what I need. Oracle’s JDeveloper version of XMLDom doesn’t support Xpath so I have to search every node by hand and then find the one with the attribute set to the value I want to find, sigh. Then I update the attribute I need to update. However it does work so fine.
Ok says I, now that I know what to do let’s translate it into PL/SQL.
I’m convinced that the two functions are logically equivalent but no, they return different results, the PL/SQL one being wrong.
Will try again on Monday. Joy.
Not that I don’t have a whole ruck of more important stuff to do, of course.
This really shouldn’t be that hard and XPath should be implemented everywhere, not just for the XMLtype. But that would be too easy, wouldn’t it.
I will post the code here once I’ve got it working…
Update: I think that you can do the XPath thing with one of the document methods that gets lists of nodes (I remember this from ages ago) but haven’t had time to look into it properly.