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?
|
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)
|
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
|
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
|
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.
|