Re: [Servingxml-help] Need urgent help
Brought to you by:
danielaparker
From: Daniel P. <dan...@sy...> - 2006-04-28 03:50:24
|
Hello Ram, When one record identifier's width is different, you can do the = following. <sx:flatRecordTypeChoice> <sx:positionalField name=3D"record_type" width=3D"4"/> <sx:positionalField name=3D"type" start=3D"1" width=3D"1"/>=20 <sx:when ... Here, record_type occupies the first four characters of the record, and = type occupies the first character. There's an example of this in the = "hot 1" example, with the flat to XML examples. Note that you can't have more than one sx:flatRecordTypeChoice element. Regards, Daniel Parker ----- Original Message -----=20 From: rams=20 To: Daniel Parker=20 Cc: Vaidyanathan Narayanan=20 Sent: Thursday, April 27, 2006 5:42 AM Subject: Re: [Servingxml-help] Need urgent help Hi Daniel, Thanks for all of your valuable inputs which you gave me in time. I need one more favour from you. The problem i am facing is explained below: Data in flat file looks like this: XD3100103/25/2005 1:50:00This is a trade recordytyty XD270002X1234A child transactionyuyuyuyyyyyyyuuiui XD28TN0003X1235Another child transactionyuiyuiyuiyui XD3100103/25/2005 1uuuurrrrrs:50:00This is a trade recordytyty Dtttttttuuuuuu77777777777777777777oooooooooooooooo999999999999 F56456mmmmmmmm7777777777kkkkkkkkkkkk333333333333333 D55555555hhhhhhhhhhhhhkkkkkkkkkkllllllllll E55555555hhhhhhhhhhhhhkkkkkkkkkkllllllllll In the above data, some of the rows have 4 characters as Record = Identifier, and for some it is one character. Example, XD31, XD27, XD28, = XD31, D, F and E are record identifiers. Problem is, when the record identifier's width is different, how to = process? As of now, Resource File looks like this: <?xml version=3D"1.0"?> <sx:resources xmlns:sx=3D"http://www.servingxml.com/core"> <sx:service name=3D"cybs"> <sx:serialize> <sx:transform> <sx:content ref=3D"cybs"/> </sx:transform> </sx:serialize> </sx:service> <sx:recordContent name=3D"cybs"> <sx:flatFileReader> <sx:urlSource url=3D"data/cybs-data.txt"/> <sx:flatFile ref=3D"tradesFlatFile"/> </sx:flatFileReader> <sx:recordMapping ref=3D"tradesToXmlMapping"/> </sx:recordContent> <sx:flatFile name=3D"tradesFlatFile"> <sx:commentSymbol value=3D"#"/> <sx:flatFileBody> <sx:flatRecordTypeChoice> <sx:positionalField name=3D"record_type" width=3D"4"/> <sx:when test=3D"record_type=3D'XD28'"> <sx:flatRecordType name=3D"XD28"> <sx:positionalField name=3D"record_type" width=3D"4"/> <sx:positionalField name=3D"sequence_number" width=3D"6"/> <sx:positionalField name=3D"dest_zip" width=3D"10"/> <sx:positionalField name=3D"merchant_zip" width=3D"10"/> <sx:positionalField name=3D"ship_from_zip" width=3D"10"/> <sx:positionalField name=3D"filler" width=3D"40"/> </sx:flatRecordType> </sx:when> </sx:flatRecordTypeChoice> <sx:flatRecordTypeChoice> <sx:positionalField name=3D"type" width=3D"1"/>=20 <sx:when test=3D"type=3D'D'"> <sx:flatRecordType name=3D"D"> <sx:positionalField name=3D"type" width=3D"1"/> <sx:positionalField name=3D"sequence_number" width=3D"6"/> <sx:positionalField name=3D"dest_zip" width=3D"10"/> <sx:positionalField name=3D"merchant_zip" width=3D"10"/> <sx:positionalField name=3D"ship_from_zip" width=3D"10"/> <sx:positionalField name=3D"filler" width=3D"40"/> </sx:flatRecordType> </sx:when> </sx:flatRecordTypeChoice> </sx:flatFileBody> </sx:flatFile> </sx:resources> One more thing is, when we used this kind of resource file, it is = considering only rows with record identifier width 4. Please suggest us how to proceed at your earliest. Thanks and Regards, Ram Reddy This e-mail and any files transmitted with it are for the sole use of = the intended recipient(s) and may contain confidential and privileged = information. If you are not the intended recipient or received it in = error, please contact the sender by reply e-mail and destroy all copies = of the original message. Please do not copy it for any purpose or = disclose its contents. Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights = Reserved |