Skip to content

Question about the file merge #3

@qweik

Description

@qweik

I have 2 files and I don't really understand what parameters need to be passed so that they combine correctly.
Example:

File 1:

<?xml version='1.0' encoding='UTF-8'?>
<yml_catalog date='2022-09-28 23:32'>
    <shop>
        <categories>
            <category id='61'>Category 1</category>
        </categories>
        <offers>
            <offer id='123'>
                <name>Test 1</name>
            </offer>
        </offers>
    </shop>
</yml_catalog>

File 2:

<?xml version='1.0' encoding='UTF-8'?>
<yml_catalog date='2022-09-28 23:31'>
    <shop>
        <categories>
            <category id='41'>Category 2</category>
        </categories>
        <offers>
            <offer id='456'>
                <name>Test 2</name>
            </offer>
        </offers>
    </shop>
</yml_catalog>

Need to get a result:

<?xml version='1.0' encoding='UTF-8'?>
<yml_catalog date='2022-09-28 23:32'>
    <shop>
        <categories>
            <category id='61'>Category 1</category>
            <category id='41'>Category 2</category>
        </categories>
        <offers>
           <offer id='123'>
                <name>Test 1</name>
            </offer>
            <offer id='456'>
                <name>Test 2</name>
            </offer>
        </offers>
    </shop>
</yml_catalog>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions