Two elements having similar structures, group by the same column name using xsd to control conversion from xml to excel



I have an xml file which contains two elements containing similar structure (example as following). When converting this xml to excel sheet by referring to my xsd file, the second element's ID will be in column ID2 as comparing to first element's in column ID. I want to write a xsd letting excel know that should be converted to the same column. How can I make it happen?



<?xml version="1.0" encoding="UTF-8"?>
<publications xmlns:xsi="http://ift.tt/ra1lAU" xsi:noNamespaceSchemaLocation="sample.xsd">
<textbook title="Programming with XML">
<isbn>0-11-011111-0</isbn>
<author>Mary Brown</author>
<author>Alex Page</author>
<publicationDate>2002</publicationDate>
<university>University of London</university>
</textbook>
<childrensbook title="Children's Fables">
<isbn>5-55-555555-5</isbn>
<author>Bob Carter</author>
<author>Melaine Snowe</author>
<publicationDate>1999</publicationDate>
</childrensbook>
</publications>


In the example above, I want to have isbn, author and publication date of element 'childrenbook' appear in the same column as them of 'textbook'.


Thanks in advance.


Note that I'm trying to convert from xml to excel. If there is other way to convert it from xml to any database to excel, it's still acceptable.


No comments:

Post a Comment