Using PHP in XSL

Good morning Kirupans!

I have a question about XSL. Let’s say I’m trying to build an inventory list of cars. I’ve got a table, and each row displays the model, price, etc. and an image of the car. All of the information is populated from an XML file, including the image file name.

<carInventory>
    <car>
        <make>Mercedes-Benz</make>
        <year>2003</year>
        <model>C320W</model>
        <type>4-Door Sedan</type>
        <price>25000</price>
        <extColor>Red</extColor>
        <intColor>Black</intColor>
        **<image>C320.jpg</image>**
    </car>
</carInventory>

The XSL file for displaying the image is quite clean and easy. And above all else, it works!

<span class="image"><img src="{image}" /></span>

Now then, I’d like to use a PHP image resize script, like this one. It does a fantastic job at resizing any image, and displaying it at a constrained width/height.

The problem here is, if I change the XSL code to look like this:

<span class="image"><img src="imgsize.php?w=100&h=100&img={image}" /></span>

I will start getting errors about how my XSL file is “not well-formed.”

So my question to you all is, how do I get the two to play nice?