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 (1126)
- Stylus Studio Technical Forum (13843)
-> - How to disable automatic and m... (1)
-> + Does Stylus Studio / DataDirec... (4)
-> + Stylus Studio fails with 'The ... (12)
-> + Struzzo.exe side by side confi... (7)
-> + unable to use converter (5)
-> + How to enable XSD 1.1 for Saxo... (3)
-> + XSD v.1.1 validation and Xerce... (5)
-> + FATAL ERROR: unsupported XML v... (2)
-> + Java Runtime Environment boot ... (2)
-> + Associate XML with Schema (3)
-> + JVM not found in stylus studio... (2)
-> + Change newline to Linux (on Wi... (4)
-> + Indent XML Tags only partially... (2)
-> + dealing with invalid character... (2)
-> + Unable to call Webservice thro... (2)
-> + XML to CSV Video create csv te... (5)
-> + Try to test this product, (2)
-> + How to migrate license? (2)
-> - kepp your settings on X15 upda... (1)
-> + No Topic (2)
-> + XSD validation scalability iss... (2)
-> + Installing documentation in ai... (4)
-> + Stylus Studio is currently una... (2)
-> + Change from SS Pro 2011 to SS ... (2)
-> + Problem with pipeline function... (2)
-> + Min and Max Occurs for Choices... (2)
-> + XSLT without Preview window ou... (3)
-> + How to achieve this transforma... (2)
-> + Licence Authentication Failed (2)
-> - using Oracle V2 for validation... (1)
-> + Steps needed to execute standa... (2)
-> + xsi:noNamespaceSchemaLocation ... (8)
-> + Using Saxon 9.4 and integrated... (4)
-> + "net XML Parser (5)
-> + How to undo in Stylus Studio X... (2)
-> + .RENAME section not loaded cor... (3)
-> + Stylus StudioŽ X14 Release 2 X... (2)
-> + The JVM initialization failed ... (2)
-> + XML schema to XML does not wor... (4)
-> + missing ExtraLines (3)
-> + EDI validation tool (2)
-> + Registering Custom Tool from c... (5)
-> + Setting Default XML Validation... (2)
-> + Project Directory in Custom Do... (3)
-> + Problem with Saxon 9.4.0.4 AVT... (5)
-> + XML To HL7 (3)
-> + Siblings not repeating when mi... (7)
-> + Nesting of records from fixed ... (5)
-> + Licensing (3)
-> + CSV set up to support predefin... (10)
-> + Scripting conversion (2)
-> + Edi/Euritmo automatic conversi... (4)
-> + Have new stylesheet automatica... (3)
-> + Text file to CSV to xml (9)
-> + EDIFACT to XML (4)
-> + About Stylus Studio... dialog ... (5)
-> + Set Stylus as default editor f... (3)
-> + CSV to XML (11)
-> + Indent XML tags no longer work... (9)
-> + XSL code completion moe like o... (3)
-> + xsl:fo - unable to use any fon... (5)
-> + Bug when calling a ms script f... (13)
-> - url schema (1)
-> + Quickbooks invoice to XML (4)
-> + X14 locks up, Unresponsive (4)
-> + Fields missing from middle of ... (2)
-> + Cannot install trial (2)
-> + Text File with Page breaks - H... (8)
-> + Complex transactional CSV mapp... (2)
-> + XML Report (2)
-> - Create an XML feed for videos (1)
-> + word doc (2)
-> + Saving to a UNC path (7)
-> + sharing violation (3)
-> + Convert XML to XML (6)
-> + DBF converter with the Cyrilli... (3)
-> + Stylus Studio caching document... (3)
-> + Stylus Studio Online help inst... (9)
-> + specific colors (2)
-> + Formatting problems when creat... (2)
-> - Headers and Footers (1)
-> + XML output's a URL in Browser ... (2)
-> + Generating Java Code for XML (3)
-> + format dates in publisher (2)
-> + grouping in Stylus Studio Publ... (5)
-> + Can schema documentation title... (3)
-> + Stylus can not find the right ... (2)
-> + Problem to create Schema from ... (5)
-> - Design a DTD to represent the ... (1)
-> + Surround SCM integration (3)
-> + Converting a csv file to xml u... (5)
-> + Legacy Format Handling (3)
-> + Size limit for XML documents (2)
-> + Can Stylus Studio easily expor... (3)
-> + Problem convert excel to xml (5)
-> + convert X12 EDI into XML in a... (2)
-> + Capturing the return data for ... (3)
-> + stamps.com wsdl issues (3)
-> + Preview issues (2)
-> + Stylus Studio X14 - XML to EDI... (3)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (244)
+ XSLT Help and Discussion (7447)
+ XQuery Help and Discussion (1870)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (361)
+ Stylus Studio Announcements (113)
Topic  
Postnext
peter cameronSubject: splitting a row into multiple into multiple fields to convert to xml
Author: peter cameron
Date: 07 Jun 2011 08:58 AM
Hello,

I have imported a customer source file and am creating a conv file to convert to xml.The source file that is basically text, an example below has 3 rows. Row A is one Row(table) in xml and the 2 rows starting with B are the second XML row(table) in the xml. The data in the B rows repeat a number of times within the rows as well as seperate rows. I can pattern match the rows by ^B at the beginning. The issue i have is to map the fields within a row, i need to split up the data within a row.

A999ABC777
B123EEE123CC22POI666ABC789LL33XDR
B223CBA321BB12XOI789ZZZ927MWQ2BAT

This is the result i am looking for:

<ROOT>
<TABLE_A>
<TABLE_REF>A</TABLE_REF>
<REF>999</REF>
<NAME>ABC</NAME>
<ID>777</ID>
</TABLE_A>
<TABLE_B>
<TABLE_REF>B</TABLE_REF>
<CUST_NO>123</CUST_NO>
<ADDR>EEE</ADDR>
<APP_NO>123</APP_NO>
<CONTACT>CC22POI</CONTACT>
</TABLE_B>
<TABLE_B>
<TABLE_REF>B</TABLE_REF>
<CUST_NO>666</CUST_NO>
<ADDR>ABC</ADDR>
<APP_NO>789</APP_NO>
<CONTACT>LL33XDR</CONTACT>
</TABLE_B>
<TABLE_B>
<TABLE_REF>B</TABLE_REF>
<CUST_NO>223</CUST_NO>
<ADDR>CBA</ADDR>
<APP_NO>321</APP_NO>
<CONTACT>BB12XOI</CONTACT>
</TABLE_B>
<TABLE_B>
<TABLE_REF>B</TABLE_REF>
<CUST_NO>789</CUST_NO>
<ADDR>ZZZ</ADDR>
<APP_NO>927</APP_NO>
<CONTACT>MWQ2BAT
</CONTACT>
</TABLE_B>

Postnext
Ivan PedruzziSubject: splitting a row into multiple into multiple fields to convert to xml
Author: Ivan Pedruzzi
Date: 08 Jun 2011 12:00 AM

If these records are based on fixed layout you can mix pattern matching with fixed layout region; have a look at the online documentation -> Adjusting Fixed-Width Regions.




Posttop
peter cameronSubject: splitting a row into multiple into multiple fields to convert to xml
Author: peter cameron
Date: 08 Jun 2011 06:04 AM
thanks for reply. Having a little difficulty trying to apply what you have said. the first customer row (example A above) will be fixed, however the B row will have a maximum width but we don;t know how many records will be in the next B rows, so the maximum number of records in the first B row will be say 10, then if we have another 2 B rows the second one will contain 10 records and the 3rd we don't know could be anything from 1 to 10 records. However the records in each row do follow a pattern like my example i.e.

can you help me a litte more with the solution to my challange?

thanks

   
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-2011 All Rights Reserved.