P
parth
I have the following XML file -
<root>
<book>
<section>art</section>
<title>abc</title>
<author>mark</author>
</book>
<book>
<section>science</section>
<title>def</title>
<author>jeff</author>
</book>
<book>
<section>art</section>
<title>pqr</title>
<author>tracy</author>
</book>
<book>
<section>science</section>
<title>xyz</title>
<author>albert</author>
</book>
</root>
I want to convert the above schema to look like the following schema
-
<root>
<section>
<name>art</name>
<book>
<title>abc</title>
<author>mark</author>
</book>
<book>
<title>pqr</title>
<author>tracy</author>
</book>
</section>
<section>
<name>science</name>
<book>
<title>def</title>
<author>jeff</author>
</book>
<book>
<title>xyz</title>
<author>albert</author>
</book>
</section>
</root>
Can this be done using XSLT? How can I change the schema?
Thanks in advance.
- Parth
<root>
<book>
<section>art</section>
<title>abc</title>
<author>mark</author>
</book>
<book>
<section>science</section>
<title>def</title>
<author>jeff</author>
</book>
<book>
<section>art</section>
<title>pqr</title>
<author>tracy</author>
</book>
<book>
<section>science</section>
<title>xyz</title>
<author>albert</author>
</book>
</root>
I want to convert the above schema to look like the following schema
-
<root>
<section>
<name>art</name>
<book>
<title>abc</title>
<author>mark</author>
</book>
<book>
<title>pqr</title>
<author>tracy</author>
</book>
</section>
<section>
<name>science</name>
<book>
<title>def</title>
<author>jeff</author>
</book>
<book>
<title>xyz</title>
<author>albert</author>
</book>
</section>
</root>
Can this be done using XSLT? How can I change the schema?
Thanks in advance.
- Parth