Support Requests item #1691187, was opened at 2007-03-30 04:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=216035&aid=1691187&group_id=16035

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: merge multiple XML files, problem with existing nodes

Initial Comment:
Hello, I have several similar XML files which must be merged together to one 
DOM tree / XML file:
 e.g.
-------------
<Root >
    <SubNetwork > 
        <ManagedElement >
            <Attribute name="id" value="ME1" />
            <Attribute name="b" value="50" />
        </ManagedElement>
    </SubNetwork>
</Root>
-------------
<Root >
    <SubNetwork >
        <ManagedElement >
            <Attribute name="id" value="ME1" />
            <Attribute name="c" value="20" />
        </ManagedElement>
    </SubNetwork>
</Root>
-------------
<Root >
    <SubNetwork >
        <ManagedElement >
            <Attribute name="id" value="ME2" />
            <Attribute name="b" value="20" />
        </ManagedElement>
    </SubNetwork>
</Root>
-------------
Result file should be:
-------------
<Root >
    <SubNetwork >
        <ManagedElement >
            <Attribute name="id" value="ME1" />
            <Attribute name="b" value="50" />
            <Attribute name="c" value="20" />
        </ManagedElement>
        <ManagedElement >
            <Attribute name="id" value="ME2" />
            <Attribute name="b" value="20" />
        </ManagedElement>
    </SubNetwork>
</Root>


Existing nodes must remain, additional child nodes (like the <Attribute 
name="c" value="20" />) must be inserted under the right path.

I've tried appendContent for the new document but got IllegalAddException for 
the already existing nodes.

Can someone help me out please?

thx
Bernie




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=216035&aid=1691187&group_id=16035

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to