IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Generation of XML from Excel using XSD Options · View
Shala
Posted: Monday, March 24, 2014 5:59:31 AM
Rank: Newbie

Joined: 3/24/2014
Posts: 1
Location: Chennai
Can someone advise me whether XML SPY has the capability to generate XML file from Excel using XSD. I have an excel template with multiple worksheets populated with data and I have XSD which defines structure and validation of those excel data. If I feed these 2 files to XML SPY, will it generate XSD validated XML file? if so, how easy to generate?
vlad
Posted: Monday, March 24, 2014 8:56:09 AM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
You need Altova MapForce instead of XMLSpy for this task. It will do exactly what you want.

The only thing which you can do in XMLSpy is copy data in Excel and paste it in XMLSpy Table View (part of Grid View)
Milko
Posted: Sunday, May 4, 2014 7:09:02 PM
Rank: Advanced Member

Joined: 6/28/2011
Posts: 76
Location: Vicenza
Shala wrote:
Can someone advise me whether XML SPY has the capability to generate XML file from Excel using XSD. I have an excel template with multiple worksheets populated with data and I have XSD which defines structure and validation of those excel data. If I feed these 2 files to XML SPY, will it generate XSD validated XML file? if so, how easy to generate?


hi shala,
you need to map (excel - developer tab) a xsd to your excel sheet and than you can export your excel data as xml file
smk
Posted: Friday, April 28, 2017 2:48:18 PM
Rank: Newbie

Joined: 4/28/2017
Posts: 1
vlad wrote:
You need Altova MapForce instead of XMLSpy for this task. It will do exactly what you want.

The only thing which you can do in XMLSpy is copy data in Excel and paste it in XMLSpy Table View (part of Grid View)


Hi, just downloaded trial of MapForce but the issue I have is mapping when the CSV to XML using XSD and data has a multiple rows such as "order" and "order-items"... My example is two "order" each with two "order-items". The XML created has a separate "order" element for each "order-item".

order-no,customer-id,order-item-id,product-id,quantity,net-price,tax-price
123456,AAA,1,300000,3,39.95,12.55
123456,AAA,2,300001,3,39.95,12.55
123457,BBB,1,400000,3,39.95,12.55
123457,BBB,2,400001,3,39.95,12.55

Code:

<orders xsi:noNamespaceSchemaLocation="file:///C:/Users/akelly/Desktop/new_dw.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <order order-no="123456">
        <customer>
            <customer-no>AAA</customer-no>
        </customer>
        <product-lineitems>
            <product-lineitem>
                <net-price>39.95</net-price>
                <tax>12.55</tax>
                <position>1</position>
                <product-id>300000</product-id>
                <quantity>3</quantity>
            </product-lineitem>
        </product-lineitems>
    </order>
    <order order-no="123456">
        <customer>
            <customer-no>AAA</customer-no>
        </customer>
        <product-lineitems>
            <product-lineitem>
                <net-price>39.95</net-price>
                <tax>12.55</tax>
                <position>2</position>
                <product-id>300001</product-id>
                <quantity>3</quantity>
            </product-lineitem>
        </product-lineitems>
    </order>


But want each product-lineitem element within same order like this...

Code:

<orders xsi:noNamespaceSchemaLocation="file:///C:/Users/akelly/Desktop/new_dw.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <order order-no="123456">
        <customer>
            <customer-no>AAA</customer-no>
        </customer>

        <product-lineitems>
            <product-lineitem>
                <net-price>39.95</net-price>
                <tax>12.55</tax>
                <position>1</position>
                <product-id>300000</product-id>
                <quantity>3</quantity>
            </product-lineitem>
            <product-lineitem>
                <net-price>39.95</net-price>
                <tax>12.55</tax>
                <position>2</position>
                <product-id>300001</product-id>
                <quantity>3</quantity>
            </product-lineitem>
        </product-lineitems>

    </order>



Cheers
Andrew
island
Posted: Friday, May 5, 2017 9:21:44 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
use "group-by" function... there are several examples of grouping in the Mapforce forum.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.