Skip to content

XMLMerger can not handle merge of subnodes properly #691

@jan-vcapgemini

Description

@jan-vcapgemini

Expected behavior

As an IDEasy intellij user I expect the merger to merge my jdktables.xml properly.

Actual behavior

The XMLMerger ignores the name() attribute if the parent node and the child node have the same name (not the id).

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Try to merge the following example:

root:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application xmlns:merge="https://github.com/devonfw/IDEasy/merge" merge:strategy="COMBINE">
  <roots>
    <annotationsPath>
      <root type="composite" merge:id="name()">
        <root type="simple" name="test"/>
      </root>
    </annotationsPath>
  </roots>
</application>

target:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application>
  <roots>
    <annotationsPath>
      <root type="composite">
        <root type="simple" name="test2"/>
      </root>
    </annotationsPath>
  </roots>
</application>

UPDATE/Question: What if we add merge:id="@name" to the inner root

Related/Dependent Issues

Blocks: #582

Comments/Hints:

Affected version:

  • IDEasy: 2024.09.002-beta-SNAPSHOT
  • OS: Windows

Metadata

Metadata

Labels

intellijIntelliJ IDE from Jet-Brains

Type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions