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
chris johnsonSubject: how to convert a file to xml
Author: chris johnson
Date: 14 May 2006 07:49 PM
I have a text which I would like to convert a specific xml output. I am having problem creating my specific xml output. I’m not sure if it’s even possible with stylus studio. If it is, please let me know. If I can get stylus studio to convert to this specific xml output, I will purchase a copy of the software.

I am trying to create child nodes under a specific node.

My text file looks like this

H10120060126BBS000010000345670000987
S00000001ChrisSmith1234parkrd1234565700004595
G00000001A6800099
G00000001C8700032
A00000001B7800000
T0000000200000001000000001


I need my xml to look like this.

<Root>
<Header>
<Type>H</Type>
<Element>101</Element>
<Element>20060126</Element>
<Element>BBS</Element>
<Element>00001</Element>
<Element>000034567</Element>
<Element>0000987</Element>
</Header>
<Student>
<Number>00000001</Number>
<Name> ChrisSmith </Name>
<Address>1234parkrd </Address>
<Student_Number>12345657</Student_Number>
<ISN>00004595</ISN>
<Grade>
<Number>00000001</Number>
<Letter_Grade>A</Letter_Grade>
<Numeric_Grade>68</Numeric_Grade>
<Course>00099</Course>

</Grade>
<Grade>
<Number>00000001</Number>
<Letter_Grade>C</Letter_Grade>
<Numeric_Grade>87</Numeric_Grade>
<Course>00099</Course>
</Grade>
<Additional_Info>
<Number>00000001</Number>
<Letter_Grade>B</Letter_Grade>
<Numeric_Grade>78</Numeric_Grade>
<Course>00000</Course>
</Additional_Info>
</Student>
<Total>
<Number>00000002</Number>
<Count1>00000001</Count1>
<Count2>000000001</Count2>
</Total>

Can you please show me how to create such a specific output using the converttoXML feature in stylus Studio 2006.

Postnext
Ivan PedruzziSubject: how to convert a file to xml
Author: Ivan Pedruzzi
Date: 14 May 2006 10:56 PM

Hi Chris,

Please take a look to the "Convert to XML" fetaure
http://www.stylusstudio.com/convert_to_xml.html

Ivan Pedruzzi
Stylus Studio Team

Postnext
chris johnsonSubject: how to convert a file to xml
Author: chris johnson
Date: 15 May 2006 04:44 PM
thanks but i that does help me figure out how to create my specific xml format from the suppied text file. I need to know how to create child node under a node. so if i have <root>
<dept>
<type>A</type>
<course>
<name>math></name>
</course>

Postnext
chris johnsonSubject: how to convert a file to xml
Author: chris johnson
Date: 15 May 2006 04:45 PM
sorry I clicked the post button by accident before i could finish. I need to know how to create the course node under the dept node.

Posttop
Tony LavinioSubject: how to convert a file to xml
Author: Tony Lavinio
Date: 16 May 2006 09:29 AM
Convert-to-XML will do part of the job - it will get the non-XML
file into XML.

You can use XSLT to finish the job, and take the file from relatively
flat XML to XML of any arbitrary complexity.

Here's how:

First, create and save a .conv file with the definitions necessary to
extract the fields from your source file as XML elements.

Then, when you create the XSLT file, use as input the non-XML file,
and check the box on the File|Open dialog that says 'open using
adapter'. This will give you a second dialog that will let you choose
the .conv file with the non-XML to XML definitions that you created.

Now you can manipulate the non-XML using XSLT.

Does this help?

 
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.