Hi,
I am new to xml. I need to combine the below sample two xmls and needs to produce the output also as a xml. How can i achieve this... I am using JDBC's Webrowset feature to get the input xmls from the DB.
<?xml version="1.0"?>
<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc
http://java.sun.com/xml/ns/jdbc/webrowset.xsd"> question.xml (input 1)
<data>
<currentRow>
<columnValue>2</columnValue>
<columnValue>Select all that apply to grim reaping.</columnValue>
</currentRow>
<currentRow>
<columnValue>3</columnValue>
<columnValue>How old was George when she died?</columnValue>
</currentRow>
</data>
</webRowSet>
option.xml (input xml 2)
<?xml version="1.0"?>
<webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc
http://java.sun.com/xml/ns/jdbc/webrowset.xsd"> <data>
<currentRow>
<columnValue>2</columnValue>
<columnValue>Post-Its</columnValue>
</currentRow>
<currentRow>
<columnValue>2</columnValue>
<columnValue>Black robe</columnValue>
</currentRow>
<currentRow>
<columnValue>2</columnValue>
<columnValue>E.T.D.</columnValue>
</currentRow>
</data>
</webRowSet>
The result should be something like the below xml format... I mean I need to match the first "columnValue" element of both xml and if the match then I need I take second "columnValue" element from both xml and need to insert into a new set of xml elements in the output...
<?xml version="1.0" encoding="UTF-8"?>
<QuestionBank>
<Test>
<question>Select all that apply to grim reaping</question>
<option>Post-Its</option>
<option>Black robe</option>
<option>E.T.D</option>
</Test>
</QuestionBank>
[ December 19, 2006: Message edited by: karthik venkatesan ]
[ December 19, 2006: Message edited by: karthik venkatesan ]