This seems like it's not a perl question (esp. since you didn't post any code).
in reply to xml join
But, by way of a non-perl answer, I have found that it can be very useful to concatenate a bunch of xml files that use a common schema/dtd, e.g. to get a global summary of contents.
All I need is some arbitrary tag to serve as the outer-most container for the concatenated set. Sometimes the files have this at the beginning:
(and sometimes that includes an 'encoding' attribute as well); those need to be filtered out. So the process boils down to a simple, 3-step sequence of shell commands (assuming there's one directory containing all the xml files of interest, and a separate path to use for output):
That also assumes that the order of file names you get from a default sort will put the files in the desired sequence (if that matters at all). If you want them in a sequence that differs from a default sort on the file names, you'll need to create a separate text file that lists the xml file names in the desired order, then pipe that list to "xargs cat" (instead of doing "cat inpath/*.xml").
echo '<arbitrary_tag>' > outpath/combined.xml
cat inpath/*.xml | fgrep -v '<?xml' >> outpath/combined.xml
echo '</arbitrary_tag>' >> output/combined.xml
That also assumes you're on a system where the unix/linux/osx/cygwin "cat", "echo", "fgrep" and "xargs" commands are available.