OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] CSV to XML

[ Lists Home | Date Index | Thread Index ]

If you have your data in one format and need it in another format, you need
your data transformed. If you don't want to write it yourself and would
prefer to use an existing utility, I would ask whoever came up with your
target format if they have anything. If they don't, no one will. 

I really can't picture how starting with CSV would be any easier than
starting with XML, unless you're new to XML transformations (whether by
XSLT, SAX, or whatever) in general.

Bob

-----Original Message-----
From: Taco Fleur [mailto:taco@shelco.com.au] 
Sent: Wednesday, August 10, 2005 2:46 AM
To: xml-dev@lists.xml.org
Subject: [xml-dev] CSV to XML

I have sort of given up to get a Word Table into XML, OK I can get XML from
a Word Table, but it's not the format I want it in, I can't be bothered to
write some complicated transformation either.

Is there no way that anyone can think of to get the following CSV into the
following XML structure?

Message Header,M,,, ,,,,,,
,,Header Data,ZHD,Uniquely identifies the message type,M,,,,, ,,,,Must be =
'ASC201',,0018,M,V172,,HDa ,,,,,,,,V337,, ,,,,,,,,V338,, ,,,,Message version
,,0019,M,,,HDb ,,,,Message trace number ,,0016,M,,P027,HDc ,,Company
id,ZCO,"Company details - name, type, class, etc",M,,,,, ,,,,Company name
(including legal elements),,0006,C,V276,N003,01a ,,,,,,,,V280,N120, ,,,,Not
used for Form 201,,0007,U,,,01b ,,,,Company type,,0022,M,V025,,01c
,,,,Company class,,0022,M,V027,N005,01d ,,,,,,,,V327,N073,

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <root>
	<message name="201">
		<group 
			name="messageHeader" 
			required="true">
			<segment 
				name="ZHD" 
				display="Header Data" 
				description="Uniquely identifies the message
type" 
				required="true">
				<element 
					name="0018" 
					required="true" 
					item="HDa">
					ASC201
					<edit>V172</edit>
					<edit>V337</edit>
					<edit>V338</edit>
				</element>
				<element 
					name="0019" 
					display="Message version" 
					required="true" 
					item="HDb" />
				<element 
					name="0016" 
					display="Message trace number" 
					required="true" 
					item="HDc">
					<note>P027</note>
				</element>
			</segment>
			<segment 
				name="ZCO" 
				display="Company id" 
				description="Company details - name, type,
class, etc" 
				required="true">
				<element 
					name="0006" 
					display="Company name (including
legal elements)" 
					required="false" 
					item="01a">
					<edit>V276</edit>
					<edit>V280</edit>
					<note>N003</note>
					<note>N120</note>
				</element>
 
________________________________
Taco Fleur - E-commerce Development Manager Shelco Searches & Services An
Authorised ASIC Information Broker www.shelco.com.au
<blocked::http://www.shelco.com.au>
Ph: + 61 7 3236 2605


-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://www.oasis-open.org/mlmanage/index.php>




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS