xml tag repeats in the same level

35 views
Skip to first unread message

shik...@gmail.com

unread,
Nov 24, 2021, 7:58:29 AM11/24/21
to Bots Open Source EDI Translator
Hello, 

the xml tag in the same level repeats itself, like: 
<PostalAddress name="Standardwert">
<DeliverTo></DeliverTo>
<DeliverTo></DeliverTo>
<Street></Street>
<Street></Street>
<Street></Street>
<City></City>
<PostalCode></PostalCode>
<Country isoCountryCode=""></Country>
</PostalAddress>

In order to be able to get the each value in <DeloverTo> and <Street>, i set the both in the grammer as records: 
'PostalAddress':
[
['BOTSID', 'M', 256, 'AN'],
['PostalAddress__name', 'C', 256, 'AN'],
['City', 'C', 256, 'AN'],
['PostalCode', 'C', 256, 'AN'],
['Country', 'C', 256, 'AN'],
['Country__isoCountryCode', 'C', 256, 'AN'],
['State', 'C', 256, 'AN'],
],
'DeliverTo':
[
['BOTSID', 'M', 256, 'AN'],
],
'Street':
[
['BOTSID', 'M', 256, 'AN'],
],
then in the mapping script i try to loop the record and get the value, like this:
for index, DeliverTo in enumerate(inn.getloop({"BOTSID":'cXML'}, {"BOTSID":'Request'},{'BOTSID': 'OrderRequest'}, {"BOTSID":'OrderRequestHeader'},{"BOTSID":'ShipTo'},{'BOTSID': 'Address'}, {'BOTSID':'PostalAddress'},{'BOTSID':'DeliverTo'})):
delivery_name = DeliverTo.get({'BOTSID':'DeliverTo','DeliverTo':None})
But in this way i can't get the value in the tags.
Can you help me with this?

regards,
Ke

Eppye Bots

unread,
Nov 24, 2021, 8:03:35 AM11/24/21
to 'Chuck Turco' via Bots Open Source EDI Translator
marked as red what should be changed.

kind regards, Henk-Jan Ebbers


['BOTSCONTENT', 'M', 256, 'AN'],
],
'Street':
[
['BOTSID', 'M', 256, 'AN'],
],
then in the mapping script i try to loop the record and get the value, like this:
for index, DeliverTo in enumerate(inn.getloop({"BOTSID":'cXML'}, {"BOTSID":'Request'},{'BOTSID': 'OrderRequest'}, {"BOTSID":'OrderRequestHeader'},{"BOTSID":'ShipTo'},{'BOTSID': 'Address'}, {'BOTSID':'PostalAddress'},{'BOTSID':'DeliverTo'})):
delivery_name = DeliverTo.get({'BOTSID':'DeliverTo','BOTSCONTENT':None})
But in this way i can't get the value in the tags.
Can you help me with this?

regards,
Ke

--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/61bc0d8a-3974-4c4f-aaa8-a059bba17811n%40googlegroups.com.

shik...@gmail.com

unread,
Nov 24, 2021, 8:07:10 AM11/24/21
to Bots Open Source EDI Translator

hey henk-Jan,

you are so helpful!!! thanks a lot.

regards,
Ke
Reply all
Reply to author
Forward
0 new messages