substring replace in Find/Replace
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
substring replace in Find/Replace
Post by shudson310 »
Hello,
I'm trying to fix a series of issues with some keyrefs:
<xref keyref="topicname#topicname"/>
I basically want to search across the keyrefs in a project or directory and remove the # and substring after.
The result should be:
<xref keyref="topicname"/>
If I do a find in a file, I can use the regex #.*$, but I can't seem to restrict the search/replace to @keyref.
I've tried putting //@keyref in the Xpath field, and have the Regular Expressions checkbox selected, but I get 0 results.
What am I missing?
oXygen Editor v23.1 build 2021061407
I'm trying to fix a series of issues with some keyrefs:
<xref keyref="topicname#topicname"/>
I basically want to search across the keyrefs in a project or directory and remove the # and substring after.
The result should be:
<xref keyref="topicname"/>
If I do a find in a file, I can use the regex #.*$, but I can't seem to restrict the search/replace to @keyref.
I've tried putting //@keyref in the Xpath field, and have the Regular Expressions checkbox selected, but I get 0 results.
What am I missing?
oXygen Editor v23.1 build 2021061407
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
Re: substring replace in Find/Replace
Hello,
The XPath is fine. The problem is the $ from "#.*$". Oxygen always treats ^ and $ as line start and line end. Note that even if ^ and $ would refer to region start and region end, it still wouldn't work for the given case since the XPath region also includes the ending quotes.
So, a quick fix for this is to exclude the single and double quotes, with the regular expression:
Regards,
Adrian
The XPath is fine. The problem is the $ from "#.*$". Oxygen always treats ^ and $ as line start and line end. Note that even if ^ and $ would refer to region start and region end, it still wouldn't work for the given case since the XPath region also includes the ending quotes.
So, a quick fix for this is to exclude the single and double quotes, with the regular expression:
Code: Select all
#[^'"]*
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: substring replace in Find/Replace
Post by shudson310 »
Worked perfectly. Thanks!
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.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