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 (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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?

   
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.