How to search XML code in all my topics?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 102
- Joined: Fri Oct 19, 2018 2:19 am
How to search XML code in all my topics?
This problem has vexed me ever since I started using OxygenXML: how do I search for specific XML code? For example, I want to find all occurrences of:
And replace it with:
I've tried different options under "Find/Replace in Files", but I can't get it to work. I have selected "Enable XML search options" and then selected all the options beneath it, but it doesn't find anything. I know that there are dozens of incorrect references in my project.
Your online help seems to give conflicting information, as it mentions deselecting "Enable XML search options" as a way to get it to search the entire file. But that doesn't work either.
Code: Select all
conkeyref="corp-vars/corp"
Code: Select all
conkeyref="strings-corp/corp"
Your online help seems to give conflicting information, as it mentions deselecting "Enable XML search options" as a way to get it to search the entire file. But that doesn't work either.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to search XML code in all my topics?
Hi,
Here are a couple of ways to do this:
- Search for corp-vars/corp, set in the Restrict to XPath field the value @conkeyref to restrict the search only to this specific attribute
You can also "Enable XML Search Options" and check the "Attribute Values" checkbox but the xpath field restriction is enough to make this work.
If this still does not work for you, maybe you are not searching in the entire set of DITA resources or maybe there are no DITA resources with that particular reference inside them, so you should also look at the "Include files" filter.
- If you have the main DITA Map opened in the DITA Maps Manager view, right click there on the topic reference on which the key is defined and choose "Refactoring->Rename Key".
Regards,
Radu
Here are a couple of ways to do this:
- Search for corp-vars/corp, set in the Restrict to XPath field the value @conkeyref to restrict the search only to this specific attribute
You can also "Enable XML Search Options" and check the "Attribute Values" checkbox but the xpath field restriction is enough to make this work.
If this still does not work for you, maybe you are not searching in the entire set of DITA resources or maybe there are no DITA resources with that particular reference inside them, so you should also look at the "Include files" filter.
- If you have the main DITA Map opened in the DITA Maps Manager view, right click there on the topic reference on which the key is defined and choose "Refactoring->Rename Key".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 102
- Joined: Fri Oct 19, 2018 2:19 am
Re: How to search XML code in all my topics?
Thanks Radu. I have attached a screenshot showing my Find settings. I believe I've made it as liberal as I could, yet I still get:
Scanned Files: 357
Occurrences: 0
I copied the conkeyref[/b] string directly from my topic and I know there are many many instances of this string in my project. I cannot understand why Oxygen doesn't find any of them!
Scanned Files: 357
Occurrences: 0
I copied the conkeyref[/b] string directly from my topic and I know there are many many instances of this string in my project. I cannot understand why Oxygen doesn't find any of them!
Selection_067.png
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to search XML code in all my topics?
Hi,
If you check the "Enable XML search options" checkbox the document will be split in several intervals and in each interval the text that you want to find will be searched. So as you have already checked the "Attribute names" and "Attribute values" checkboxes, you will get separate search intervals for attribute names and for attribute values, but you are searching for a string which contains both the attribute name and value and this is why the string is not found in any of the search intervals.
So please uncheck the "Enable XML search options" checkbox and use that "Restrict to XPath" filter I suggested in my initial reply.
Radu
If you check the "Enable XML search options" checkbox the document will be split in several intervals and in each interval the text that you want to find will be searched. So as you have already checked the "Attribute names" and "Attribute values" checkboxes, you will get separate search intervals for attribute names and for attribute values, but you are searching for a string which contains both the attribute name and value and this is why the string is not found in any of the search intervals.
So please uncheck the "Enable XML search options" checkbox and use that "Restrict to XPath" filter I suggested in my initial reply.
searchWithRestrictedXPath.png
Regards,Radu
You do not have the required permissions to view the files attached to this post.
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 102
- Joined: Fri Oct 19, 2018 2:19 am
Re: How to search XML code in all my topics?
Yes, using the "Restrict to XPath" option worked. I never would have figured this out myself--talk about non-obvious!
Can't you make a search that actually searches ALL the text in a dita topic? A simple text string search is all I need.
Can't you make a search that actually searches ALL the text in a dita topic? A simple text string search is all I need.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to search XML code in all my topics?
Hi Carl,
Regards,
Radu
By default that dialog has the "XML Search Options" checkbox disabled so this is what it does by default, it does simple text searches in the entire XML content. Problems started when you checked the "XML Search Options" which divides the XML document in intervals (element names, text content, attribute names, attribute values) and searches only in those intervals for the text to find.Can't you make a search that actually searches ALL the text in a dita topic? A simple text string search is all I need.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service