[XML Records] Questions about using XMLConfig

[XML Records] Questions about using XMLConfig

  
Forge Component
(24)
Published on 15 Jun by Ricardo Silva
24 votes
Published on 15 Jun by Ricardo Silva
Hi!

I'm having some problems using XMLConfig... 

I have a record with an attribute that is a Record List of "Child" records and I want to ommit the parent element of the record list.

So instead of having something like

<PmtInf>
  <DrctDbtTxInf_RL>
    <DrctDbtTxInf></DrctDbtTxInf>
    <DrctDbtTxInf></DrctDbtTxInf>
    <DrctDbtTxInf></DrctDbtTxInf>
  </DrctDbtTxInf_RL>
<PmtInf>

what I want is

<PmtInf>
  <DrctDbtTxInf></DrctDbtTxInf>
  <DrctDbtTxInf></DrctDbtTxInf>
  <DrctDbtTxInf></DrctDbtTxInf>
<PmtInf>

Im my picture the record with the attribute that is a record list is PAYMENT_INFORMATION and the attribute name is DrctDbtTxInfRL.

What is wrong with my RecordXmlConfig that is not producing the desired effect of ommiting the parent element?




 

PS: You might want to open/save the image to see the rest of it. The configuration details on the right are "cutted".
Joao


In your structure "PAYMENT_INFORMATION"

Rename the record list from "DrctDbtTxInf_RL" to "PmtInf" and you will be able to achieve the desired result.

Hello João,

In the original discussion for the XML Records Extension you'll find a post by Gonçalo Borrêga (posted on 2010-06-19) explaining the use of DefaultConfig and XMLConfig.

Here's a snippet about DefaultConfig that I think will help you:
  • RecordListMode: C or S (Child or Sequence). When you have a Record "Master" with an attribute "ChildList" that is a RecordList of "Child" Records, when RecordListMode is set to C the output will be something like <Master><ChildList><Child>...</Child><Child>...</Child></ChildList></Master>. When it is set to S, the output will be  <Master><Child>...</Child><Child>...</Child></Master> (ommits the parent element of the recordlist.
If you set this option to "S", then when generating the contents of a list the root for the list won't be included, in your case DrctDbtTxInf_RL won't be included in the XML structure.

Best regards,
Gonçalo Fonseca
Thank you @Robert and @Gonçalo.

I ended up using the RecordListMode setting with success...it passed by me the first time I lookup up the topic.

Regards,
João Heleno