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 (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2016)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Taron BarberSubject: CSV to XML conversion help
Author: Taron Barber
Date: 18 Mar 2008 05:36 PM
Hi,

I have just begun to work with XML and am in the process of trying to convert a csv file to XML but am having trouble. I need to get a CDATA section under one of the field elements. I need to get it setup to import as follows:

<inv>
<inventory>
<sku>
<quantity>
<url><![CDATA [import data from csv file.........
</inventory
</inv>



I can not get it to format in this way. I can only get it to import as follows:

<inv>
<inventory>
<sku>
<quantity>
<url>
</inventory>
</inv>

How do I get that CDATA section under the <url> field element?

I hope this makes a little sense. I just started getting involved in XML so I dont really know the correct terminology.

Thank you for any help


Posttop
(Deleted User) Subject: CSV to XML conversion help
Author: (Deleted User)
Date: 19 Mar 2008 06:19 AM
Hi,
ths CSV to XML converter doesn't allow to specify whether the data should be enclosed in CDATA sections, as in XML the CDATA section is just a syntactic feature that allows a user to freely type any text without the need of escaping the reserved characters (i.e. it's only useful if a human being is actually typing the data).
So an XML-compliant parser should find no difference between <[CDATA[http://www.xxxx.com/some/URL?key=value&key=value]]> and http://www.xxxx.com/some/URL?key=value&amp;key=value (note that & turned into &amp;). As a workaround, if your requirement to use CDATA sections cannot be avoided, you can post process the generated XML with an XSL indentity transformation that specifies the cdata-section-elements="url" attribute in the xsl:output instruction.

Hope this helps,
Alberto

   
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.