Page 1 of 1

Find dialog, XPath, and attributes

Posted: Tue Nov 25, 2008 7:43 pm
by sanderson
I love being able to limit searches using XPath in the find dialog. However, either I'm using it wrong, or I can't use it to limit the search to values in attributes.

Here's the kind of thing I'm doing. First the source:

Code: Select all

<relcell>
<topicref href="..\homepage\home_taskbar.xml">foo\bar</topicref>
</relcell>
I'd like to change the \ character in the href attribute to a / but leave the \ in "foo\bar" alone.

If I do a find/replace and use //@href, the example code isn't found. If, instead, I do //*[@href], it is found. However, the replace would change the string "foo\bar" to "foo/bar".

Any tips on how to do this in oxygen?

Re: Find dialog, XPath, and attributes

Posted: Wed Nov 26, 2008 4:57 pm
by sorin_ristache
Hello,

The precision of the XPath filter is not so high. You can filter only at the element level, not at the attribute level as you can read in the tooltip of the XPath field. This is why the query //*[@href] worked for you. If you want to find matches also inside the XML tags (attribute names, attribute values) just make sure the option Search also in tags is selected in the Find/Replace dialog.


Regards,
Sorin