Hi All,
Below its a sample transaction record that I am trying to process in XML stage.
There can be multiple TransferFund under one traansaction, when more than one TransferFund are coming then the detila inside the trasnfer fund should come in a new row with the Parent Tag Values.
Could you please lert me know how to solve this issue.
<TrxnRec><ProcessDate>20140702</ProcessDate>
<FundAcctID>26204388</FundAcctID>
<AcctDesig>1</AcctDesig>
<DlrCode>9190</DlrCode>
<DlrAcctID>543080691</DlrAcctID>
<RepCode>AAA</RepCode>
<AcctType>01</AcctType>
<OrdSrc>D</OrdSrc>
<OrdType>D</OrdType>
<SrcID>ETCOF0262043889</SrcID>
<ETCof>
<TrxnTyp>5</TrxnTyp>
<TrxnTypDtl>4</TrxnTypDtl>
<FromAcct>
<FundAcctID>26204388</FundAcctID>
<DlrCode>7568</DlrCode>
<DlrAcctID>543080691</DlrAcctID>
<AcctDesig>1</AcctDesig>
<AcctType>01</AcctType>
</FromAcct>
<TrnsfrFund>
<FundID>266</FundID>
<GrossAmt>0.00</GrossAmt>
<UnitTrxnd>0.0000</UnitTrxnd>
<AveCost>0.0000</AveCost>
</TrnsfrFund>
<TrnsfrFund>
<FundID>568</FundID>
<GrossAmt>21180.08</GrossAmt>
<UnitTrxnd>1650.7480</UnitTrxnd>
<AveCost>0.0000</AveCost>
</TrnsfrFund>
<TrnsfrFund>
<FundID>590</FundID>
<GrossAmt>11394.67</GrossAmt>
<UnitTrxnd>574.8760</UnitTrxnd>
<AveCost>0.0000</AveCost>
</TrnsfrFund>
<TrnsfrFund>
<FundID>702</FundID>
<GrossAmt>26314.79</GrossAmt>
<UnitTrxnd>1326.8990</UnitTrxnd>
<AveCost>0.0000</AveCost>
</TrnsfrFund>
<TradeDate>20140702</TradeDate>
<SettlDate>20140702</SettlDate>
<Demo>
</Demo>
</ETCof>
</TrxnRec>
</TrxnRecon>
XML Stage to convert child repeating elements into rows
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 32
- Joined: Tue Mar 09, 2010 5:56 am
- Location: Bangalore
XML Stage to convert child repeating elements into rows
Last edited by partha.natta on Fri Jul 11, 2014 2:24 pm, edited 2 times in total.
Thanks & Regards,
Partha
Partha
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
How about you describe to us what the actual issue is? What is it that you are trying to accomplish? For example are you looking to read or to generate XML of this kind?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 32
- Joined: Tue Mar 09, 2010 5:56 am
- Location: Bangalore
-
- Premium Member
- Posts: 32
- Joined: Tue Mar 09, 2010 5:56 am
- Location: Bangalore
Hi Michael,
I am doing the same steps in my job, and but I am getting only the first TransfrID values(FundID,GrossAmt,UnitTrxnd,AveCost) coming in output.For the other TransferID details should come in a different row in same column (FundID,GrossAmt,UnitTrxnd and AveCost) with the parent values i.e. extra new row need to be created.
I am doing the same steps in my job, and but I am getting only the first TransfrID values(FundID,GrossAmt,UnitTrxnd,AveCost) coming in output.For the other TransferID details should come in a different row in same column (FundID,GrossAmt,UnitTrxnd and AveCost) with the parent values i.e. extra new row need to be created.
Thanks & Regards,
Partha
Partha
-
- Premium Member
- Posts: 32
- Joined: Tue Mar 09, 2010 5:56 am
- Location: Bangalore
The output result should come like this.
Expected Result:
ProcessDate|FundAcctID|DlrAcctID|RepCode|FundID|GrossAmt|UnitTrxnd|AveCost
20140702|26204388|543080691|AAA|266|0|0|0
20140702|26204388|543080691|AAA|568|21180.08|1650.748|0
20140702|26204388|543080691|AAA|590|11394.67|574.876|0
20140702|26204388|543080691|AAA|702|26314.79|1326.899|0
But currently I am getting only the first record.
Expected Result:
ProcessDate|FundAcctID|DlrAcctID|RepCode|FundID|GrossAmt|UnitTrxnd|AveCost
20140702|26204388|543080691|AAA|266|0|0|0
20140702|26204388|543080691|AAA|568|21180.08|1650.748|0
20140702|26204388|543080691|AAA|590|11394.67|574.876|0
20140702|26204388|543080691|AAA|702|26314.79|1326.899|0
But currently I am getting only the first record.
Thanks & Regards,
Partha
Partha
That often indicates that you either mapped to the wrong list, or that your "list" isn't correctly defined. Be sure that in your xsd, the node that you want multiple rows has a proper "maxOccurs=unbounded" or some number greater than 1.
It must be formally stated...the default for xsd's is maxOccurs=1.....
The xml Stage obeys the xsd standard.
Ernie
It must be formally stated...the default for xsd's is maxOccurs=1.....
The xml Stage obeys the xsd standard.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Premium Member
- Posts: 32
- Joined: Tue Mar 09, 2010 5:56 am
- Location: Bangalore
Hi Ernie,
Thanks for your response.
This way it is mentioned in XSD.
<xsd:element name="ETCof">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="TrxnTyp"/>
<xsd:element ref="TrxnTypDtl"/>
<xsd:element ref="CntbWdCode" minOccurs="0"/>
<xsd:element ref="OrdFundID" minOccurs="0"/>
<xsd:choice>
<xsd:element ref="ToAcct"/>
<xsd:element ref="FromAcct"/>
</xsd:choice>
<xsd:choice maxOccurs="unbounded">
<xsd:element ref="TrnsfrAAFund"/>
<xsd:element ref="TrnsfrFund"/>
</xsd:choice>
<xsd:element ref="TaxEvnt" minOccurs="0"/>
<xsd:element ref="OrigNtwrk" minOccurs="0"/>
<xsd:element ref="TradeDate"/>
<xsd:element ref="SettlDate"/>
<xsd:element ref="Demo" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Thanks for your response.
This way it is mentioned in XSD.
<xsd:element name="ETCof">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="TrxnTyp"/>
<xsd:element ref="TrxnTypDtl"/>
<xsd:element ref="CntbWdCode" minOccurs="0"/>
<xsd:element ref="OrdFundID" minOccurs="0"/>
<xsd:choice>
<xsd:element ref="ToAcct"/>
<xsd:element ref="FromAcct"/>
</xsd:choice>
<xsd:choice maxOccurs="unbounded">
<xsd:element ref="TrnsfrAAFund"/>
<xsd:element ref="TrnsfrFund"/>
</xsd:choice>
<xsd:element ref="TaxEvnt" minOccurs="0"/>
<xsd:element ref="OrigNtwrk" minOccurs="0"/>
<xsd:element ref="TradeDate"/>
<xsd:element ref="SettlDate"/>
<xsd:element ref="Demo" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Thanks & Regards,
Partha
Partha