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] Csv2dsml

[ Lists Home | Date Index | Thread Index ]

you might be using something where java is your only option, but i would 
probably use tcl, perl, or awk :) as simple, efficient scripting 
languages to do this.

perhaps a dozen lines of code....

rick

Brad Tumy wrote:

>I was asked to write a "script" that would take a csv file as input and
>create a dsml file as output.  We are receiving employee data as csv and
>importing to an identity management system using DSML.  I finished this
>last night...pretty small java code...I ended up using StringTokenizer
>to capture the columns from each row and then constructed the output as
>a String for each element...and then using File.write.  So I ended up
>with a write "line" for each XML element.  Not too efficient and not
>scaleable...
>
>I looked at some resources on the web...saw a csv2xml...but it looked
>like it was taking the column headers from the csv to use as element
>names...in this particular situation I had specific element names that
>were different then the column headers.  I also looked at java's SAX and
>DOM libraries but couldn't quite get a handle on how to leverage these
>if I wasn't starting with an XML file.
>
>As anyone else been down this road?  What kind of solutions did you end
>up with...also, if anyone knows how to utilize DOM or SAX to create a
>XML file from another source I would love to learn how to do this.
>
>Thanks!
>Brad
>
>-----------------------------------------------------------------
>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>
>
>
>  
>

begin:vcard
fn:Rick  Marshall
n:Marshall;Rick 
email;internet:rjm@zenucom.com
tel;cell:+61 411 287 530
x-mozilla-html:TRUE
version:2.1
end:vcard


  • References:
    • Csv2dsml
      • From: "Brad Tumy" <btumy@authsec.com>



 

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

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