XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
james streitSubject: CSV to XML conversion
Author: james streit
Date: 07 Apr 2006 01:59 PM
We are currently evaluating your product to do a csv file conversion to XML.
I cannot figure out how to get two row element names into the same region.
I need to read one input row and write two different row element names.
Thanks.

Postnext
Tony LavinioSubject: CSV to XML conversion
Author: Tony Lavinio
Date: 07 Apr 2006 02:36 PM
Without seeing your CSV data, it's hard to say exactly, but here are
a few ideas:

1. Regions are used for separating physical parts of the file - say
a fixed-size header from the body. Probably not what you want.

2. If the data lies on differnt rows, you can use the 'match patterns'
to select the rows, and each row matching a pattern can emit a
different set of XML elements.

3. If you need to create more complicated data, the easiest way is to
use XSLT. In fact, you don't even need Convert-to-XML for this, although
you can use it. We'll do two samples here:

3a. Build your Convert-to-XML map as close as you can. Then create an
XSLT transform or XQuery program that takes that .conv and your .csv
file as input and transforms it further. For the input, you'd use
something like this:
adapter:///myconverter.conv?file:///myfile.csv

3b. If your data really is just plan CSV, you can use the built-in
CSV adapter and pump the data through XSLT or XQUery. In that case,
you'd prefix your file name with 'adapter:CSV?' like this:
adapter:CSV?file:///myfile.csv

Instead of imbuing Convert-to-XML with the capabilities of creating
every possible XML layout, we decided to design it to create the
'XML equivalent' of the input format, and let XSLT and/or XQuery do
what _they're_ really good at.

If you'd like us to take a look at it, you could send a sample of the
.csv and the expected output to stylus-field-report@progress.com.

Does this help?

Posttop
james streitSubject: CSV to XML conversion
Author: james streit
Date: 10 Apr 2006 02:06 PM
Thanks for the reply.
I'm going to attached my input file.
It consists of a header row and patient rows.
I'll also attached the xml file I'm trying to match.
It requires that I have a header row and each inputed patient
row split between two different opening tags underneath
the opening tag <patientleveldata>

If I need to use xslt I'll start looking there.


Unknowncahpstest2.csv


UnknownHCAHPS_Sample_XML_file.xml

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.