Bug in multi-file find & replace?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Wed Dec 26, 2007 10:55 pm
Bug in multi-file find & replace?
Post by Joe Wicentowski »
I'm observing some differences in the single- and multi- file find & replace. I'm trying to find instances of:
<note>...</note>
<note>...</note>
and collapse the notes together - thus:
<note>... ...</note>
To do so, I am searching for:
</note>\s*<note>
and replacing this string with a single space. This works fine in single-file find and replace, but not in multi-file find and replace. Any suggestions? I'm using oXygen 9.1 on WinXP.
Thanks!
Joe
<note>...</note>
<note>...</note>
and collapse the notes together - thus:
<note>... ...</note>
To do so, I am searching for:
</note>\s*<note>
and replacing this string with a single space. This works fine in single-file find and replace, but not in multi-file find and replace. Any suggestions? I'm using oXygen 9.1 on WinXP.
Thanks!
Joe
-
- Posts: 9469
- Joined: Fri Jul 09, 2004 5:18 pm
Dear Joe,
Thank you for contacting us.
The Find Replace in Files dialog does not apply the regular expression on multiple lines so a regular expression which spans multiple lines like yours is not correctly found or replaced.
When performing find/replace in an opened editor multi-line regular expression matching is correctly supported.
I'll file an enhancement request to our internal bugs list so that multi-line regular expressions are supported also when find/replace in files is performed.
In the meantime you can also apply XSLT transforms to obtain similar results.
For a sample XML like:
applying the XSL:
would merge all note tags into one.
Regards,
Radu
Thank you for contacting us.
The Find Replace in Files dialog does not apply the regular expression on multiple lines so a regular expression which spans multiple lines like yours is not correctly found or replaced.
When performing find/replace in an opened editor multi-line regular expression matching is correctly supported.
I'll file an enhancement request to our internal bugs list so that multi-line regular expressions are supported also when find/replace in files is performed.
In the meantime you can also apply XSLT transforms to obtain similar results.
For a sample XML like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<root>
<note>1</note>
<note>2</note>
<note>3</note>
<note>4</note>
</root>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="root">
<root>
<xsl:if test="count(note) > 0">
<note>
<xsl:for-each select="note">
<xsl:value-of select="text()"/>
</xsl:for-each>
</note>
</xsl:if>
</root>
</xsl:template>
</xsl:stylesheet>
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)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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