PDA

View Full Version : Generate HTML page out of XML+images


SickMothaF
07-22-2006, 10:49 AM
Hi guys and girls if any,

I am tring to print a folder with images.
Each time the picture count is different.
The names are always like pic01.jpg , pic02.jpg, pic03.jpg.
I have an XML file containing the picture count and all the picturues names with paths.

How can I make it out of one press of a button (from a .swf or .html file) to pop up one HTML file containing all the pictures and ready for print? (like 2 pictures per page .. )

Thanks! :thumbsup:

probey20
08-14-2006, 10:12 PM
I haven't tested this code, but would something like this in your source XSLT work? In your onClick event you would pass in the image values from the XML file.

<html>
<head>
<script language="JavaScript"><![CDATA[
function popupWindow(img1, img2)
{
var outputString = "<html><body><table>";
outputString += "<tr><td><img src='" + img1 + "'/></td><td><img src='" + img2 + "'/></td></tr>";
outputString += "</table></body></html>";

var openWindow = window.open("", "newwin","scrollbars=no,resizable=yes,toolbar=no,menubar=yes,status=yes,width=800,height=600,left=0,top=0");
openWindow.document.write(outputString);
openWindow.offscreenBuffering = true;
openWindow.location.reload();
}
]]></script>
</head>
<body>
<input type="button" onClick="javascript:popupWindow('pic01.jpg', 'pic02.jpg');"/>
</body>
</html>