Lists Home |
Date Index |
>I have a situation to create an XML output based on a
>DTD and pipe delimited data file, meaning the inputs
>are a DTD which is variable and a pipe delimited file
>with data for the tags in the DTD, the output should
>be an XML file.
>I have not heard of any pre-build general program
>(kinda parser) to do this function. I wanted to double
>check with ya all.
>Any input would be highly useful.
The following is a quick & dirty approach, which works as long as the source
file is table-like:
Rather than taking a DTD as the definition (not a bad idea...) it takes a
simple text file giving the field names etc. Example below.
John Smith, The Nook, firstname.lastname@example.org,
Tim Bot, High Street, email@example.com,
Fred Gregory, Tidza, firstname.lastname@example.org
comment=Generated using CSVToXML
java CSVToXML [properties file] [source file] [destination file]
<DOCTYPE addressbook SYSTEM addresses.dtd>
<!-- Generated using CSVToXML -->