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
Daniel LuczakSubject: Help with getting Output XML file
Author: Daniel Luczak
Date: 29 Sep 2008 05:15 PM
Hello all,
I am new to Stylus--
Here is my question using Stylus Studio 2008
I have done the following
File|New|XSLT
For the input file,
choose your CSV file, and tell it to use the XML Converter
select the CSV converter
Switch to the mapping tab
On the right, load your XSD

After I do the mapping how do I save the CSV file into an XML file with only the mapped fields that I mapped from the XSD file.

My Source document is the .csv file and my target document is the XSD file-- How do I get the XML file


Thanks

Dan

Postnext
Minollo I.Subject: Help with getting Output XML file
Author: Minollo I.
Date: 30 Sep 2008 09:04 AM
The result of defining the mapping is an XSLT (in your case; or an XQuery if you create an XQuery instead); yo get the XML result of your mapping, you need to execute the XSLT (menu XSLT > Preview Result...).

That will generate the result in the Preview window; you can save the XML from there (there is a Save button at the left of the Preview window), or you can also instruct the XSLT to save the result to a specific URI every time the XSLT is executed (XSLT > Scenario Properties... > Output URL

Postnext
Daniel LuczakSubject: Help with getting Output XML file
Author: Daniel Luczak
Date: 30 Sep 2008 09:32 AM
I tried your suggestion but I get an xml file with no data
I am attaching the 3 files that I am using
.csv is the original data file which needs to be converted to XML but mapped to fields in the .xsd file
.xsd is the mapping file
.xsl file is the mapping file from stylus Studio.

Maybe I am doing this in the worng steps
I thought I could go from .csv to .xml using the mapping function


UnknownSalesforceaccounttestdata.csv


UnknownProject1.prj


UnknownSaletosellignet01.xsl


UnknownSelligentSchema.xsd

Postnext
Minollo I.Subject: Help with getting Output XML file
Author: Minollo I.
Date: 30 Sep 2008 09:45 AM
I see only one problem: the output URL shouldn't go through a conversion step, but it should just be a URL like "c:\test.xml"

What I get is this:
<?xml version="1.0"?>
<Selligent>
<Cpy NRID="">
<CpyTxtOpnFld22/>
<CpyTxtOpnFld74/>
<CpyTxtOpnFld78/>
<CpyTxtOpnFld79/>
<CpyTxtOpnFld80/>
<CpyTxtOpnFld81/>
<CpyType/>
</Cpy>
</Selligent>

...no data, but it looks like that data you are mapping is missing from the original CSV you posted, so I guess that's expected.

Postnext
Daniel LuczakSubject: Help with getting Output XML file
Author: Daniel Luczak
Date: 30 Sep 2008 10:04 AM
There is not much data that matches in the CSV and XSD but 2 records match the map where there is information in the cpytype (xsd file) and Primary_activity__c (csv file)-- I should get two records in the XML file

Postnext
Minollo I.Subject: Help with getting Output XML file
Author: Minollo I.
Date: 30 Sep 2008 10:13 AM
I see what you mean; the problem is that your mapping is not iterating through all the records in the source CSV file; you can do that easily, even if I'm not sure which corresponding elements in the XML Schema should be created for each record in the CSV file (I don't see elements marked with multiple occurrence in the XSD).

Anyway, click the right button of the mouse on "row" on the left, drag a line on top of "Cpy" on the right and drop it there; choose "Create repeatable link" and at that point you'll get on "Cpy" element in the output for each "row" in the input, and you'll see some data.

Postnext
Daniel LuczakSubject: Help with getting Output XML file
Author: Daniel Luczak
Date: 30 Sep 2008 11:57 AM
Thanks-
It is now working correctly--
One more question
Can I run this conversion from the command line and if yes is there documentation for this or do I need to do this in Java or C #. If it needs to be done in Java or C # do you have a link to sample code

Posttop
Minollo I.Subject: Help with getting Output XML file
Author: Minollo I.
Date: 30 Sep 2008 01:21 PM
You can do that from the command line using the built-in XSLT processor (StylusXslt.exe); or you can do that from the command line using Saxon (see saxonica dot com). You can also do that in Java or C# (XSLT > Generate Code).

As you are using XML Converters to do CSV to XML, you will need to get the proper XML Converters runtime license to be able to run the conversion through command line or API; the version bundled with Stylus can be used only from within the Stylus Studio UI and as a 14 days evaluation from command line/API. See www.xmlconveters.com/buy for details about how to contact DataDirect sales.

 
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.