[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

Subject: Re: Merging an dynamic set of XML files into 1 with ANT / XSLT ?
From: Martin Heiden <martin.heiden@xxxxxxxxxxxxx>
Date: Tue, 11 Dec 2007 22:21:39 +0100
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.