The XML originates in this format
Code: Select all
<Start>
<PAIEMENT>
<E1_ENTITE>ENTLEGACY</E1_ENTITE>
<E1_CODE_REGLMNT>E </E1_CODE_REGLMNT>
<E1_MONTANT>250 </E1_MONTANT>
<E1_MODE_PAIEMENT>VIR</E1_MODE_PAIEMENT>
<E1_DEVISE_REGLEMENT>EUR</E1_DEVISE_REGLEMENT>
<E1_TAUX_CONV>1.00 </E1_TAUX_CONV>
<E1_DT_RECEPTION>31/10/2009 </E1_DT_RECEPTION>
<E1_IBAN>MIDGL2050505 </E1_IBAN>
<CLIENT>
<E1_CODE_CLIENT>CLILEGACY </E1_CODE_CLIENT>
</CLIENT>
<CLIENT>
<E1_CODE_CLIENT>CLILEGACY </E1_CODE_CLIENT>
</CLIENT>
<PIECE>
<E1_CODE_ATTRIBUT_REF>FL </E1_CODE_ATTRIBUT_REF>
<E1_REFERENCE>FACLEGACY </E1_REFERENCE>
<E1_MONTANT>200 </E1_MONTANT>
</PIECE>
<PIECE>
<E1_CODE_ATTRIBUT_REF>AL </E1_CODE_ATTRIBUT_REF>
<E1_REFERENCE>AFFLEGACY </E1_REFERENCE>
<E1_MONTANT>50 </E1_MONTANT>
</PIECE>
</PAIEMENT>
<PAIEMENT> .....
What I do is remove the top level start and take the paiementS and then separate them into transactions at the Xpath level of Start/PAIEMENT , hence the transaction id.
All the transactions are then stored in a dataset and only the valid transactions (determined later) are used .The invalid ones are be used to reconstruct a valid XML file to be passed onto error processing. This is the part I am having difficulty with.
One of the problems is that I have created this XML from a very dodgy specification and it could actually be incorrect.However in its present form it is valid XML
The unique attribute is the E1_CODE_REGLEMENT and indeed I use this further along the job. But for the invalid transaction processing, I don't want to have to extract all the fields just to add the <Start> <\Start> flags
Is this any clearer ?
Are there any dates on when this becomes more fun ?