[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Converting XML to Fixed Length Text Data

Subject: Re: Converting XML to Fixed Length Text Data
From: "Garvin Franco" <garvin_franco@xxxxxxxxxxx>
Date: Mon, 25 Mar 2002 14:37:29 -0500
xsl fixed length text
David thanks for the response, but I am not quite clear on the solution.
1) How does the attribute "att1" vs the element "child1" know where to position themselves on the output file? Shouldn't positional info be declared somewhere?
2) What about the element <xsl:text>, is this not required?


See below for original message and your response.

Garvin

Your response:
From: David Carlisle <davidc@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Converting XML to Fixed Length Text Data
Date: Mon, 25 Mar 2002 16:45:23 GMT

<xsl:variable name="pad1" select="' '"/>

<xsl:template match="child1">
 <xsl:value-of select="."/>
 <xsl:value-of select="substring($child1,string-length(.))"/>
</xsl:template>

and similarly the other children. (This doesn't do any error checking
for over-run, although that could be added.)

David


Original Message:
Ladies and Gents, I need some guidance .  I searched the archives and found
some info but it was not sufficient. Basically I want to convert an xml file
to a fixed length data file.  The following is a sample of what I am trying
to do

Position of data for output file:
field: child1     start 1    length 7
field: att1       start 12   length 5
field: child2     start 27   length 12
field: child3     start 39   length 15
field: att2       start 56   length 3

Input:
<parent att1="foo">
<child1>aChild</child1>
<child2>anotherChild</child2>
<child3 att2="bar">yetAnotherChild</child3>
</parent>

Output:
aChild     foo            anotherChildyetAnotherChild  bar

I would really appreciate any help on this.

Thanks
Garvin Franco
garvin_franco@xxxxxxxxxxx



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.