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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1175)
- Stylus Studio Technical Forum (14532)
-> - XML related issue (1)
-> + Need help regarding pipeline o... (2)
-> + Error converting XML to EDIFAC... (4)
-> + XSLT Profiling for XSLT 1.0 s... (2)
-> + Grouping (2)
-> - Best Toner for Sensitive Skin (1)
-> + Best Practice for Pipeline err... (2)
-> + pdf generation (4)
-> + Problems excuting a Pipeline w... (2)
-> + XML serializer (3)
-> + Supported EDIFACT versions (5)
-> - Anyone know XActimate ESX file... (1)
-> + Stylus Studio with OpenJDK (2)
-> - Encoding error when importing ... (1)
-> - SEO Service in Delhi, India (1)
-> - HP Printer Support (1)
-> + Stylus Studio X16 Professional... (5)
-> + Stylus Studio X16 Enterprise -... (4)
-> - Overly complicated formatting ... (1)
-> + java apparently running, canno... (2)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (247)
+ XSLT Help and Discussion (7614)
+ XQuery Help and Discussion (1944)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.