Sylvain, Gregory [USA] wrote: > Hi, > > I have a system which currently translates several legacy message > formats into XML DOM (does some manipulation and verification) and then > translates the XML DOM back to the legacy message format. It currently > does all of the legacy translation by hand. Accordingly, there are > some 'gaps', as well as hard to find bugs, in the translation. > > I am looking to replace the hand translation with ANTLR. However, I > would like to keep the XML DOM middle representation as there is already > quite a few architectural features built around that model. > > Does anyone have experience translating from ANTLR AST to XML DOM? I > have a bit of trouble trying to grasp how the tree grammar would/could > output XML DOM.
An immediate idea occuring to me would be to use yet another layer in between - but it's a pretty easy layer. Assuming you're using Java, create a data binding of your XML, using (for example) JAXB. Then have the tree grammar build these Java objects, and then use JAXB's internal capability to turn them into DOM. Sometimes an extra step saves time. -- Sam Barnett-Cormack List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---