Find&Replace attribute values across files

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
syed
Posts: 66
Joined: Tue Nov 14, 2017 8:34 pm

Find&Replace attribute values across files

Post by syed » Tue Apr 02, 2019 11:02 am

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: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: Find&Replace attribute values across files

Post by Radu » Tue Apr 02, 2019 2:47 pm

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: 66
Joined: Tue Nov 14, 2017 8:34 pm

Re: Find&Replace attribute values across files

Post by syed » Wed Apr 03, 2019 6:36 pm

Thanks Radu. That helped.

Post Reply