jmporterog / maven-replacer-plugin

Automatically exported from code.google.com/p/maven-replacer-plugin
MIT License
0 stars 0 forks source link

xpath replaces text content with duplication #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Use a replacement like this:
                        <replacement>
                            <xpath>/application/initialWindow/content/text()</xpath>
                            <token>.*</token>
                            <value>foobar</value>
                        </replacement>

What is the expected output? What do you see instead?

The content element ends up as "foobarfoobar", instead of "foobar"

What version of the product are you using?
1.5.2

Please provide any additional information below.
Frankly, in this case, I wish the token were optional.  I want to change the 
entire text element.

Original issue reported on code.google.com by dcor...@zcorum.com on 1 Apr 2014 at 12:22

GoogleCodeExporter commented 9 years ago
I cannot reproduce this problem using my test harness 
https://maven-replacer-plugin.googlecode.com/svn/test-plugin-use

Can you see how the execution id "xpath-with-text-selector" compares to your 
setup?

Original comment by baker.st...@gmail.com on 30 Apr 2014 at 7:43

GoogleCodeExporter commented 9 years ago
Closing - no response.

Original comment by baker.st...@gmail.com on 19 May 2014 at 11:12

GoogleCodeExporter commented 9 years ago
I get quite the same issue with:

                   <replacement>
                       <xpath>repository/@name</xpath>
                       <token>.*</token>
                       <value>foobar</value>
                   </replacement>  

With a target like:
<repository 
name='file:/media/raoul/devspace/dev/workspace-osgi4/xtpop.aggregator/third-part
ies/repository/target/repository - artifacts' [...]

the new content is:
<repository name="foobarfoobar" [...]

To avoid this, I use:
         <token>^.*$</token>

Nothing in the original text explains this behavior.

Do I need to open a new issue or is it OK with the current one.

Original comment by p.m.ra...@gmail.com on 22 Oct 2014 at 9:55