Merging of two xml files
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 1
- Joined: Mon Apr 16, 2007 1:33 pm
- Location: Germany
Merging of two xml files
Post by Bhavana Boddu »
Hi,
i using Jdom.i have two xml files say sys1.xml and sys2.xml.
they contain following data:
sys1.xml
<application>
<source name="S0" >
<ports>
<outputport name="o1" />
</ports>
</source>
<task name="T0" >
<ports>
</ports>
</task>
<sink name="S1" >
<ports>
<inputport name=>
<inputrequirement>
</inputrequirement>
</inputport>
</ports>
</sink>
</application>
sys2.xml
<application>
<source name="S0" >
<ports>
<outputport name="o0" orientation="false"/>
</ports>
</source>
<task name="T0" >
<ports>
</ports>
</task>
<sink name="S1" >
<ports>
<inputport name="i0" orientation="false">
<inputrequirement>
</inputrequirement>
</inputport>
</ports>
</sink>
</application>
here the thing is i have to merge these two files and write in two 3 rd xml file.
points to note:
--suppose we take first xml file and add second one to it.
Attributes from second xml should be add to first one at same attributes in first xml.
--suppose if s0(source name) is already in sys1.xml and now you are adding sys2.xml.
now it should default take as s1.
-same case with sink also.
i wrote code but while getting the root of second one i am getting errror (root alredy exits)
can anyone help me for solving this problem.
bhavana.
i using Jdom.i have two xml files say sys1.xml and sys2.xml.
they contain following data:
sys1.xml
<application>
<source name="S0" >
<ports>
<outputport name="o1" />
</ports>
</source>
<task name="T0" >
<ports>
</ports>
</task>
<sink name="S1" >
<ports>
<inputport name=>
<inputrequirement>
</inputrequirement>
</inputport>
</ports>
</sink>
</application>
sys2.xml
<application>
<source name="S0" >
<ports>
<outputport name="o0" orientation="false"/>
</ports>
</source>
<task name="T0" >
<ports>
</ports>
</task>
<sink name="S1" >
<ports>
<inputport name="i0" orientation="false">
<inputrequirement>
</inputrequirement>
</inputport>
</ports>
</sink>
</application>
here the thing is i have to merge these two files and write in two 3 rd xml file.
points to note:
--suppose we take first xml file and add second one to it.
Attributes from second xml should be add to first one at same attributes in first xml.
--suppose if s0(source name) is already in sys1.xml and now you are adding sys2.xml.
now it should default take as s1.
-same case with sink also.
i wrote code but while getting the root of second one i am getting errror (root alredy exits)
can anyone help me for solving this problem.
bhavana.
bhavana
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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