Posts

Showing posts with the label transformation

Babel plugins run order

Babel plugins run order TL;DR: Is there a way how to specify the order in which the Babel plugins are supposed to be run? How does Babel determine this order? Is there any spec how this works apart from diving into Babel sources? I'm developing my own Babel plugin. I noticed, that when I run it, my plugin is run before other es2015 plugins. For example having code such as: const a = () => 1 and visitor such as: visitor: { ArrowFunctionExpression(path) { console.log('ArrowFunction') }, FunctionExpression(path) { console.log('Function') }, } my plugin observes ArrowFunction (and not Function). I played with the order in which the plugins are listed in Babel configuration, but that didn't change anything: plugins: ['path_to_myplugin', 'transform-es2015-arrow-functions'], plugins: ['transform-es2015-arrow-functions', 'path_to_myplugin'], OTOH, this looks like the order DOES somehow matter: https://phabricator.babelj...

What is the best way to implement an application in Java that converts xml in one format into another? [on hold]

What is the best way to implement an application in Java that converts xml in one format into another? [on hold] I have to write an application that processes a large amount of xml files and transforms xml defined by xsd1 to xml defined by xsd2. The xsd1 file will change frequently during the project. The single xml file is at most 200Kb. There will be a lot of business logic in a transformation. I would like to be as close as possible to the Java standard libraries. What would be the best approach to implement this application in terms of the xml file processing? Should I use in this case DOM,SAX,JAXB,XPATH or something else? To be more precise the only change that might happen is addition of the anonymous inner elements in the xsd, so that there will be for example multiple times an anonymous inner element item defined, which results in Item1,Item2,...,ItemN classes generated. When the new anonymous Item3 is added then Item1 becomes Item3 and every occurrence in code of Item1 has to ...