Copy xml document's images in different source locations into single output directory

leios76

New Member
I am having a xml document with uses xinclude for access several other xml files.\[code\]<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="http://stackoverflow.com/questions/some-doc/section1.xml"/><xi:include href="http://stackoverflow.com/questions/some-doc/section2.xml"/>\[/code\]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 \[code\]<xsl:template match="@*|node()">\[/code\] as \[code\]<xsl:template match="*">\[/code\] 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.
 
Back
Top