Find dialog, XPath, and attributes

Having trouble installing Oxygen? Got a bug to report? Post it all here.
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

Find dialog, XPath, and attributes

Post 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?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Find dialog, XPath, and attributes

Post 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
Post Reply