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
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Ron ZimmermanSubject: custom xml conversion
Author: Ron Zimmerman
Date: 19 Jun 2008 03:29 PM
What are the steps one should use to create an xml conversion adapter when your input *.txt file has 3 different record types with different numbers of fields and field sizes for each? Attached is an example of what my issue is. It would be greatly appreciated if you could outline the normal procedure for handling these kinds.
Thanks,
Ron Zimmerman


Unknown07-10-23.txt


UnknownSampleInputDef.doc

Postnext
Tony LavinioSubject: custom xml conversion
Author: Tony Lavinio
Date: 20 Jun 2008 07:50 AM
You want to use the 'Add node and pattern' option.

On each row that has a different type of row, you create a new
row pattern.

In your case, you have what appears to be three layouts, and
they can be distinguished by their first character.

So create one row with the pattern '^PM' (starting with PM),
one with pattern '^L' and then a third for the third row type.

Now, each row can be broken up into fields.

Postnext
Ron ZimmermanSubject: custom xml conversion
Author: Ron Zimmerman
Date: 20 Jun 2008 08:15 AM
In a line-oriented region, how to you define the fields for each row?

Postnext
Tony LavinioSubject: custom xml conversion
Author: Tony Lavinio
Date: 20 Jun 2008 01:57 PM
You actually want just one fixed-width region for the whole file.
A fixed-width region can have the lines separated by CR,LF - that's
what you want.
Then to start a new field, put the cursor on the first character of
that field, right-click, and choose 'begin field here'. You can
drag the field lines once drawn, and remove them just by clicking on
the first character and unchecking the 'begin here' item.

Postnext
Ron ZimmermanSubject: custom xml conversion
Author: Ron Zimmerman
Date: 23 Jun 2008 10:50 AM
OK, I got it.
Thanks, Tony!

Postnext
Ron ZimmermanSubject: custom xml conversion
Author: Ron Zimmerman
Date: 23 Jun 2008 11:15 AM
One more question: is it possible to pass the actual file name of the input file to the output xml file?

Postnext
Tony LavinioSubject: custom xml conversion
Author: Tony Lavinio
Date: 23 Jun 2008 03:54 PM
No; you'd have to post-process it or have the caller add it in.

Postnext
Ron ZimmermanSubject: custom xml conversion
Author: Ron Zimmerman
Date: 01 Jul 2008 09:29 AM
new question: The input file I'm working with is tab delimited. Sometimes not all the fields are present. How do you get the adapter to recognize this?

Postnext
Tony LavinioSubject: custom xml conversion
Author: Tony Lavinio
Date: 01 Jul 2008 10:57 AM
Can you give an example?

I'm assuming you're using the TAB converter.

You might note that the 'Collapse consecutive separators' is
set to 'yes' by default, so TAB-TAB-TAB for example would be
treated as just TAB.

If you are using the Custom XML Converter that creates a .conv
file, could you let us know what the definitions are, and maybe
give us a peek at a small sample file?

Posttop
Ron ZimmermanSubject: custom xml conversion
Author: Ron Zimmerman
Date: 02 Jul 2008 08:14 AM
Changing the setting on this parameter - 'Collapse consecutive separators' - did the trick. Thanks!

 
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.