aspose file tools*
The moose likes XML and Related Technologies and the fly likes dom problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "dom problem" Watch "dom problem" New topic
Author

dom problem

prat narang
Greenhorn

Joined: Oct 27, 2003
Posts: 10
hi group,
i've one dome application which takes two xml files as input, say X1 and X2. This application picks a particular node from X2 and replace it in X1 and then write a new X3.xml file.

xml files are
X1
<?xml version="1.0" encoding="UTF-8"?>
<book>
<constructed-response id="cr.5.501">
<constructed-response-group>
<constructed-response-item id="cri.5.40">
<question></question>
<solution></solution>
</constructed-response-item>
</constructed-response-group>
</constructed-response>
</book>
X2
<?xml version="1.0" encoding="utf-8"?>
<book id="book_inter">
<constructed-response id="cr.5.26">
<constructed-response-group>
<constructed-response-item id="cri.5.40" where.from="sub2.5.1.1.2">
<solution item-sequence-number="4" identifier-no="cri.5.40">
<solution-step>
<equation id="eq.5.86">prateek</equation>
</solution-step>
<correct-answer identifier-no="cri.5.40">
<equation id="eq.5.87">narang</equation>
</correct-answer>
</solution>
</constructed-response-item>
</constructed-response-group>
</constructed-response>
</book>
and the final file which i am getting
<?xml version="1.0" encoding="UTF-8"?>
<book>
<constructed-response id="cr.5.501">
<constructed-response-group>
<constructed-response-item id="cri.5.40">
<question/>

<solution identifier-no="cri.5.40" item-sequence-number="">
<solution-step>
<equation id="">prateek</equation>
</solution-step>
<correct-answer identifier-no="">
<equation id="">narang</equation>
</correct-answer>
</solution></constructed-response-item>
</constructed-response-group>
</constructed-response>
</book>
u can easily see that the value of few attributes are missing in the result file. i want the attribute values to in the result file. could anyone help me to find out that where i am missing the point.
thank you
--prateek--
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
"true adonis",
We don't have many rules at JavaRanch, but we do have our naming policy which your obviously fictious name is in violation of. Please head overhere and change yours, pronto. Thanks!
prat narang
Greenhorn

Joined: Oct 27, 2003
Posts: 10
i've got the solution for my problem. that was xerces bug..with the xerces 2 result is according to out need.
and i think now my name is not violating the group's code.
--prateek--
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The name is fine. And thanks for sharing the solution with us!


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dom problem
 
Similar Threads
problem in modification of the value in xml file
java.lang.string
Help regarding how to check the element entered is equal or not in xml file
Problem Overwriting XML Section
xml error_please help