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 (1168)
+ Stylus Studio Technical Forum (14386)
+ Website Feedback (244)
+ XSLT Help and Discussion (7583)
+ XQuery Help and Discussion (1941)
+ Stylus Studio FAQs (159)
- Stylus Studio Code Samples & Utilities (363)
-> + Legacy File (2)
-> + XSD to XML Creation with all O... (2)
-> - How XML to X12 be converted an... (1)
-> - Encode and decode XML to and f... (1)
-> + Evaluating StylusStudio - .cnv... (2)
-> - Build safe NCName (1)
-> - generating .Net dataset (1)
-> + Converters for .NET (2)
-> - TRADACOMS - Code Generation (1)
-> - Flat File Custom XML conversio... (1)
-> - Need help in Generate a checkb... (1)
-> + Evaluation period for the buil... (2)
-> + Reports with ifs (2)
-> + Need Help Creating Custom XML ... (6)
-> + Need help with unique particle... (10)
-> - In need for help on converting... (3)
-> ->In need for help on conve...
-> ->In need for help on conve...
-> - import xml into an access (1)
-> + jaxb support (3)
-> + Large XML sample file (2)
-> + Stylus Studio 2008 R2 - From X... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio Announcements (113)
Topic  
Postnext
Sebastien VinchonSubject: In need for help on converting record oriented flat file to XML
Author: Sebastien Vinchon
Date: 15 Jun 2009 11:36 AM
Hello,

I am in need for an advice on how to tell Stylus Studio Flat File to XML conversion engine to process differently lines depending on the value at a specific position.

As an example, when processing the attached file, I want to create a complex node called:
- L1 when the four character starting at position 85 are equal to 0012
- L2 when the four character starting at position 85 are equal to 0022
- L3 when the four character starting at position 85 are different from 0012 and 0013

Many thanks for any help.

Sebastien


UnknownMECHETOK.multi.dat

Postnext
Sebastien VinchonSubject: In need for help on converting record oriented flat file to XML
Author: Sebastien Vinchon
Date: 15 Jun 2009 01:16 PM
Here are how my CONV and xQuery currently look like.


UnknownMECHETOK_Flux.dat.1.conv


UnknownMECHETOK_Flux.dat.1.conv.xquery

Posttop
Tony LavinioSubject: In need for help on converting record oriented flat file to XML
Author: Tony Lavinio
Date: 03 Aug 2009 11:30 PM
What you want to do is create a separate record layout
for each type. To do this, we use what we call "patterns".

Load the file into Custom XML Converters, and do this:

Right-click on the line that will become L1 and choose
"Add node/pattern". For the name, use L1, and for the
pattern use the regular expression ^.{85}0012

Now do similar for L2 with ^.{85}0022

Now, look at the schema tree on the right. It will have several
branches. Go to the one without a pattern showing, and select
the row name and press F2 to rename, and put in L3.

What the .^{85}0012 etc. means is:
^ start matching from the start of the string
.{85} match 85 occurrences of any character
0012 match the string "0012"

You can find more on "regular expressions" by Googling.

Now, with the different record layouts, you can break things
into different fields for each one independently.

   
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.