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
Homer NajafiSubject: CSV to XML: Ignore Missing Fields?
Author: Homer Najafi
Date: 05 Jul 2006 11:49 AM
I am trying to convert a CVS file to XML using "Convert To XML" for creating Adaptor and then use Java to call that Adaptor.

I have these two questions:

1- My input file has either 32 or 36 fields in it (not even empty ',,'). How can I say ignore the missing 4 fields if there are not there and fill out the rest?

2- Some of the fields in my CVS file are suranded by Double-Quetes. Is there anyway to remove them during conversion? (e.g. John, “Smith”, 33 --> John, Smith, 33 --> XML)

Postnext
Tony LavinioSubject: CSV to XML: Ignore Missing Fields?
Author: Tony Lavinio
Date: 05 Jul 2006 02:27 PM
>1- My input file has either 32 or 36 fields in it (not even
>empty ',,'). How can I say ignore the missing 4 fields if
>there are not there and fill out the rest?

I don't quite follow. If there is no field value present, the
default behavior is not to emit an empty element. Could you post
an example of the 32- and 36-field lines and point out what the
problem is?

The property in question is 'Omit from Output' and the default
value is 'When Empty' - which should be what you want.

>2- Some of the fields in my CVS file are suranded by
>Double-Quetes. Is there anyway to remove them during
>conversion? (e.g. John, “Smith”, 33 --> John, Smith, 33 --> XML)

Use 'Delimiter Pairs' and set the value to '"','"' (or the equivalent
34,34 if the previous is too hard to type in - 34 is the UNICODE value
for quote marks).

Posttop
Homer NajafiSubject: CSV to XML: Ignore Missing Fields?
Author: Homer Najafi
Date: 05 Jul 2006 03:24 PM
Thanks Tony. Actually you've answered my question.
I needed to set the "Omit from Output" to "Never" since I want those fields to be there regardless of being present, empty or not present

 
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.