Order of XML

42 views
Skip to first unread message

Lee Pedley

unread,
Oct 25, 2022, 5:45:20 AM10/25/22
to Bots Open Source EDI Translator
Hi,

I have got my grammars set up, and everything is working but the order of the feed is not coming out the same as I need.

My grammar has this
{ID:'Sender',MIN:0,MAX:99999,LEVEL:[ 
{ID:'Credential',MIN:0,MAX:99999}, 
]},

My mapping has this

out.put({'BOTSID':'cXML'},{'BOTSID':'Header'},{'BOTSID':'Sender'},{'BOTSID':'Credential','Credential__domain':"domain"})

        out.put({'BOTSID':'cXML'},{'BOTSID':'Header'},{'BOTSID':'Sender'},{'BOTSID':'Credential','Identity':"identity"})

        out.put({'BOTSID':'cXML'},{'BOTSID':'Header'},{'BOTSID':'Sender'},{'BOTSID':'UserAgent':"My agent"})


But when it outputs it comes out with the UserAgent on top but needs to be at the bottom (the same order as the mapping).

How do I get the UserAgent to display at the bottom?


Expected:


                             <Sender>

                                           <Credential domain="domain">

                                                          <Identity>ID</Identity>

                                           </Credential>

                                           <UserAgent>Agent</UserAgent>

                             </Sender>

 

Received:


                             <Sender>

                                           <UserAgent>Agent</UserAgent>

                                           <Credential domain="domain">

                                                          <Identity>ID</Identity>

                                           </Credential>

                             </Sender>


Thanks


Lee

 





Lee Pedley

unread,
Oct 25, 2022, 5:47:36 AM10/25/22
to Bots Open Source EDI Translator
Sorry just realised I have copied the wrong line in the mapping;

        out.put({'BOTSID':'cXML'},{'BOTSID':'Header'},{'BOTSID':'Sender','UserAgent':"Comfy Gateway"})

This is it (I was playing around and forgot to change it back).


Thanks



Lee Pedley

unread,
Oct 26, 2022, 5:12:25 AM10/26/22
to Bots Open Source EDI Translator
I am presuming there isn't a resolution for this? anybody have any ideas on which file would need to be altered to allow me to change the order of this?

Eppye Bots

unread,
Oct 26, 2022, 5:14:09 AM10/26/22
to bots...@googlegroups.com
check mailing list, question has been asked quite some times.

kind regards, Henk-Jan Ebbers


--
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/d063e25b-f0f7-41e5-adfe-e3bf94b148ban%40googlegroups.com.

Lee Pedley

unread,
Oct 26, 2022, 5:22:21 AM10/26/22
to Bots Open Source EDI Translator
Thanks Henk, I will have another check, any ideas on the search terms I should be typing, as I have tried 'order' and 'xml order' but its not coming up with the right listing.  Thank you so much for your time on this anyway.
Reply all
Reply to author
Forward
0 new messages