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 (1175)
- Stylus Studio Technical Forum (14531)
-> + Need help regarding pipeline o... (2)
-> + Error converting XML to EDIFAC... (4)
-> + XSLT Profiling for XSLT 1.0 s... (2)
-> + Grouping (2)
-> - Best Toner for Sensitive Skin (1)
-> + Best Practice for Pipeline err... (2)
-> + pdf generation (4)
-> + Problems excuting a Pipeline w... (2)
-> + XML serializer (3)
-> + Supported EDIFACT versions (5)
-> - Anyone know XActimate ESX file... (1)
-> + Stylus Studio with OpenJDK (2)
-> - Encoding error when importing ... (1)
-> - SEO Service in Delhi, India (1)
-> - HP Printer Support (1)
-> + Stylus Studio X16 Professional... (5)
-> + Stylus Studio X16 Enterprise -... (4)
-> - Overly complicated formatting ... (1)
-> + java apparently running, canno... (2)
-> + Stylus on Citrix - unable to v... (6)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (247)
+ XSLT Help and Discussion (7605)
+ XQuery Help and Discussion (1944)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (365)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Larry JohnsonSubject: Text to XML conversion issue
Author: Larry Johnson
Date: 03 Dec 2008 02:20 PM
I'm fairly new to using the .conv files. First let me say thanks for the tutorial videos... they are very helpful. I have a situation that I'm not sure how to handle, though. I have an input file that contains legacy mainframe data. Each line can be no longer than 80 characters. Since that isn't enough room to represent some information, it has a structure similar to the following:

120 01 Field1 Field2 Field3
120 03 Field4 AnotherField YetAnotherField
122 01 Field1 Field2
122 02 Field3 Field4 Field5
122 03 Field6 Field7

The first number (120, 122) is the record type. The second number is a sub-type which tells me what information is in that row. So, even though it took two rows to represent a 120 record in my example, it is one logical record and I want it to be a single <Record120> element in my output.

Now for the harder part, the 122 records are detail records that belong to the 120 record. Each 120 record can have multiple 122 records. I would like the 122 records to be children of their respective 120 elements in my output. So, I would like my XML to be formatted something like this:

<Record120>
<Field1>...</Field1>
<Field2>...</Field2>
<Record122>
<Field1>...</Field2>
.
.
<Field7>...</Field7>
</Record122>
<Record122>
<Field1>..</Field1>
.
.
</Record122>
</Record120>

</Record120>

I haven't been able to figure out how define the node much less how to output it in a hierarchical manner. Can anyone point me in the right direction?

Posttop
Tony LavinioSubject: Text to XML conversion issue
Author: Tony Lavinio
Date: 03 Dec 2008 05:47 PM
The Custom XML Converter module's job is to get the data into
XML. The job of formatting the XML into a shape that is specifically
useful for a given case is left to XSLT or XQuery, which were
designed specifically for transforming XML.

You can use the output of the CXC as input to XSLT by specifying
the filename like this for the XSLT:

converter:file:///c:/myconvfile.conv?file:///c:/myinputfile.txt

XSLT 2.0 has excellent features for grouping data; Jeni Tennison
has some pointers for doing grouping if you are using XSLT 1.0 on
her web site http://www.jenitennison.com/

   
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.