|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Merging an dynamic set of XML files into 1 with AN
Jirtme, Tuesday, December 11, 2007, 4:29:26 PM, you wrote: JH> I have to extract XML elements from a set of XML files, and to JH> gather these elements into one XML file. JH> (Let's imagine each XML file is a chapter, and I want to extract JH> Title element to build the Table Of Contents) JH> I have to do this using an ANT target. JH> My main problem is that is must be DYNAMIC : I have to scan the JH> contents of a folder, sort files alphabetically, and build the TOC according to that. Wouldn't it be easier to solve this using groovy's ant-task instead of XSLT? You could pass the files in a fileset to the groovy-script, parse those using SAX and generate the TOC. At the end you write the TOC into a new file. http://groovy.codehaus.org/The+groovy+Ant+Task http://groovy.codehaus.org/Reading+XML+with+Groovy+and+SAX http://groovy.codehaus.org/Creating+XML+using+Groovy%27s+StreamingMarkupBuilder http://groovy.codehaus.org/Creating+XML+with+Groovy+and+DOM4J http://groovy.codehaus.org/Input+Output Just an alternate idea... regards Martin
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








