Starting with version 0.6.5, you should be able to use sx:choose in a record
mapping section, i.e.
<sx:onRecord>
<sx:choose>
<sx:when test="trade_amt > 10000 and acct_bal < 10000 and
third_party_ind='Y'"
<sx:fieldElementMap field="trade_amt" element="TradeAmt"/>
<sx:fieldElementMap field="acct_bal" element="AcctBal"/>
<risk>high</risk>
</when>
<sx:otherwise>
<risk>low</risk>
</sx:otherwise>
</sx:choose>
</sx:onRecord>
Daniel
----- Original Message -----
From: "Sandhya" <sa...@la...>
To: "Daniel Parker" <dan...@sy...>
Sent: Saturday, April 07, 2007 10:06 PM
Subject: RE: [BULK] Re: [Servingxml-help] reading file
> I would like to do some conditonal logic in record mapping. I can do it
> with <xsl:if etc.. Is there any other way to do it without using xsl.
>
> <sx:onRecord>
> if trade_amt > 10000 and acct_bal < 10000 and third_party_ind='Y'
> <sx:fieldElementMap field="trade_amt" element="TradeAmt"/>
> <sx:fieldElementMap field="acct_bal" element="AcctBal"/>
> <risk>high</risk>
> else
> <risk>low</risk>
> </sx:onRecord>
>
>
>
> On Sat, Apr 7, 2007 at 12:31 AM, Daniel Parker wrote:
>
>> The framework doesn't currently support that, and any support along those
>> lines is probably some ways off. To achieve this at all, you'd have to
>> modify ServingXML source, by extending FlatRecordReceiverImpl, overriding
>> the bodyRecord method, and modifying the received bytes before calling
>> super.bodyRecord. You could then use your class in the FlatFileReader
>> readRecords method, replacing "new FlatRecordReceiverImpl" with "new
>> MyFlatRecordReceiver". But I would suggest pre-filtering the input file
>> in a separate program instead.
>>
>> Daniel
>>
>> ----- Original Message ----- From: "Sandhya" <sa...@la...>
>> To: <ser...@li...>
>> Sent: Thursday, April 05, 2007 9:50 PM
>> Subject: [Servingxml-help] reading file
>>
>>
>>> Hi
>>>
>>> I would like to modify the data of a delimited file as it is being read,
>>> but before it is constructed into a Record object. Just the raw
>>> bytes/chars. Can you please help with this.
>>>
>>> Regards
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>>> your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>>
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> Servingxml-help mailing list
>>> Ser...@li...
>>> https://lists.sourceforge.net/lists/listinfo/servingxml-help
>>>
>>
>>
>
>
> undefined
>
|