Find&Replace attribute values across files

Having trouble installing Oxygen? Got a bug to report? Post it all here.
syed
Posts: 77
Joined: Tue Nov 14, 2017 8:34 pm

Find&Replace attribute values across files

Post by syed »

Hi,
I have used audience=compA and audience=compB across dita files. This attribute is used by the ditaval file. I would like to swap the values. How can i do that effectively across files?

When i look for the value using 'Find and Replace in Files' option, the tool finds that across attributes. I would like the tool to find it only in the 'audience' attribute. Is there a way to specify that in the tool?

Thanks...
Radu
Posts: 9451
Joined: Fri Jul 09, 2004 5:18 pm

Re: Find&Replace attribute values across files

Post by Radu »

Hi,

The "Find/Replace in Files" dialog has a "Restrict to XPath" filter which could be set to @audience.
Or you can create a predefined XSLT-based XML refactoring operation:

https://www.oxygenxml.com/doc/versions/ ... ample.html

which uses a stylesheet like this to modify the values of a profiling attribute to something else:

https://github.com/oxygenxml/dita-refac ... eValue.xsl

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
syed
Posts: 77
Joined: Tue Nov 14, 2017 8:34 pm

Re: Find&Replace attribute values across files

Post by syed »

Thanks Radu. That helped.
Post Reply