Hello!
Hi, I need to merge few XML DB file in one big XML, nay easy way biside
reading one by one and writing a new big one ??
You could use XSLT and its document()-function, maybe something like
this (untested, possibly wrong)
<transform xmlns="..." xmlns:o="out">
<template match="/">
<o:bigfile>
<for-each select="/files/file">
<copy-of select="document(.)/root/node()" />
</for-each>
</o:bigfile>
</template>
</transform>
input:
<files>
<file>foo.xml</file>
<file>bar.xml</file>
</files>
foo.xml:
<root xmlns="foo">
<content>
<of the="file"/>
</content>
</root>
bar.xml:
<root xmlns="bar">
<bar/>
</root>
output, maybe:
<bigfile xmlns="out" xmlns:f="foo" xmlns:b="bar">
<f:content>
<f:of the="file" />
</f:content>
<b:bar />
</bigfile>
If you really want to merge the files, not just concat them, it will
become more difficult...
--
Pascal Schmitt