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
Thomas DorganSubject: Text File to xml conversion with groups
Author: Thomas Dorgan
Date: 14 Jun 2007 03:03 PM
In the Create Custom xml Converter module, I cannot find a way to set hierarchical levels in the xml output. For instance, making a name-address group in the detail loop. I believe I have to do a flat conversion and add the grouping (like the EDI adaptor does) using a secondary xslt. Is there any way to do this in one step using the converter definition? (by the way, my current file is a fixed-length format IDOC file.)

Postnext
Ivan PedruzziSubject: Text File to xml conversion with groups
Author: Ivan Pedruzzi
Date: 14 Jun 2007 04:04 PM
Hi Thomas,

Could you please provide a complete example that shows what you are trying to accomplish?

Thanks!
Ivan Pedruzzi
Stylus Studio Team

Postnext
Thomas DorganSubject: Text File to xml conversion with groups
Author: Thomas Dorgan
Date: 14 Jun 2007 04:45 PM
I am attaching an IDOC file. What I need is the looping in the xml file like the attached xml file. I used a different method to parse it into xml and added the loops with an xslt. I want to change to the Stylus Studio adapter and have the looping added with the adapter. I am also attaching an EDIFACT file in xml form. (Notice the use of groups). If I can get a file that is similar in structure it would make data transforming manageable.

If you need more, please let me know.


DocumentLoopFiles.zip
Sample Files

Postnext
Thomas DorganSubject: Text File to xml conversion with groups
Author: Thomas Dorgan
Date: 21 Jun 2007 09:56 AM
I see from Stylus Studio Technical Forum » Converting Text File, Tony Lavinio stated, "There is no 'loop'
mechanism." The standard adaptors have this feature. This is not a difficult task as it is done by any EDI translator I have ever used when building a file definition. If there is a way to open a standard adaptor (like the EDI converter), as a .conv file, I am sure I could use that to build a converter with "looping".
This is an integral part of defining a file. Without it, it is difficult to build an xslt (though not impossible).

Please let me know wht this deficiency has not been addressed when you are on release 8.

Postnext
Tony LavinioSubject: Text File to xml conversion with groups
Author: Tony Lavinio
Date: 21 Jun 2007 12:04 PM
You misunderstood.

'regions' are not the mechanism you want to use. Regions do not loop.
They are for physical partitions of the file.

What you want to use is the pattern matching feature. Your file only
has one region, but many different record layouts.

First, open the file as fixed-width, and choose as the
'Line Terminator' the value LF.

Then, for each unique row structure, right-click on the row
and choose 'Add Node and Pattern'. This will let you enter a
regular expression that uniquely matches lines of that layout,
and you can then create fields within that line by using the
right-click and 'Begin Field in This Column' choice. You can
also name those fields.

The node/patterns will be applied within the region as they
are seen.

See http://www.stylusstudio.com/docs/v2007R2/d_flatfileconversion35.html
for more details.

Postnext
Thomas DorganSubject: Text File to xml conversion with groups
Author: Thomas Dorgan
Date: 21 Jun 2007 02:01 PM
Okay, let's start again. I am attaching 2 files. One is a text extract of a file definition created in the Gentran translator. it will show you the structure of the converter I need to build. It has grouping, that defines the looping characteristics of the file. It also shows the pattern match.
The other file is a 3pl Oracle flat file. The Record Identifier is at offset 92. When I try to build a converter using the Record Number I get erroneous matches. The only way to uniquely identify the records is using the characters at offset 92. Otherwise, when I look for the 0070 record, for instance, record 1000 is a match for 0070 (the previous record type) because it contains the date 20070509.
So there are actually two problems with this method; no way to identify the exact characters to read for the match test and the lack of a means to set hierarchical levels (looping structures) within the file.


UnknownPOO6786.3pl


Unknown3plFileDefinition.txt

Postnext
Tony LavinioSubject: Text File to xml conversion with groups
Author: Tony Lavinio
Date: 22 Jun 2007 09:23 AM
The way to match something that isn't at the start of the record
is to use something like "^.{89}XYZ" which means 'from the start
of the row (^) match any 89 characters (.{89}) and then, match
only the literal XYZ (XYZ)'.

For hierarchies, we went in a different direction. Rather than
trying to make the Custom XML Converter system do everything, it
does one thing - that is, it converts input to XML.

We depend on XQuery or XSLT to take the output from that step
and reorder or group according to the final requirements. This
way, those languages can be used for what they are good at, and
users can take full advantage of the mapper functionality present
and refined within them.

Either the Pipeline designer can be used to pull the pieces together,
or the input specified to the XQuery or XSLT can be of the form:
converter:myconverter.conv?file:///c:/myoriginalfile.txt

Postnext
Thomas DorganSubject: Text File to xml conversion with groups
Author: Thomas Dorgan
Date: 22 Jun 2007 03:20 PM
The pattern match worked. I have been building xslt's to add loops to the input document, but I have been using a template match to do so. If I convert the input format to a schema and edit the schema and edit the schema with hierarchies, it may work better. The issue I have had is with ptional records at the beginiing or end of a group. I will work out a better solution for this.

Thank you.

Posttop
venessa KentSubject: Text File to xml conversion with groups
Author: venessa Kent
Date: 25 Jul 2007 09:41 AM
Hi Thomas,

I think i have the solution you are looking for to solve this problem adn other porblems you have posted on other threads..

Can you please send me your email address (use my email below)

Regards,
Venessa kent
contact me: stylus.xpert@gmail.com

 
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.