I am having a xml document with uses xinclude for access several other xml files.
<chapter xml:id="chapter1">
<title>Chapter in Main Doc</title>
<section xml:id="section">
<title>Section in Main Doc 1</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/car.jpg"/>
</imageobject>
</mediaobject>
</section>
<xi:include href="../some-doc/section1.xml"/>
<xi:include href="../some-doc/section2.xml"/>
These other section1 and section2 xml files uses different images in different source locations. I need to copy those all images to single output directory. There fore at first, I am planning to use XSLT to parse entire xml documents and generate a list of images to be copied. How can I generate that list of images of xml files using XSLT? Your ideas really appreciated.
Thanks in advance..!!
Added:
I tried with below answered XSLT 1.0 code. When I generate html output using it, it only displays chapter and section ids like "chapter1, section ...". It does not display image path value inside imagedata node.
But when I changed <xsl:template match="@*|node()">
as <xsl:template match="*">
then it displays all image path values of xincluded xml files also. But there are other node's values like above also. I need to filter all values other than image paths.
Here I need to copy only image paths of all xml documents and keep those all paths in a array or some thing like it. Then I can use those saved image paths for image coping purpose using a java class.