# Using PHP in XSL

**URL:** <https://forum.kirupa.com/t/using-php-in-xsl/236533>\
**Category:** programming\
**Created:** [August 21, 2007, 7:05pm UTC](https://forum.kirupa.com/t/using-php-in-xsl/236533 "2007-08-21T19:05:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![camargo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/camargo/32/1363_2.png) [@camargo](https://forum.kirupa.com/u/camargo)\
**Post date:** [August 21, 2007, 7:05pm UTC](https://forum.kirupa.com/t/using-php-in-xsl/236533/1 "2007-08-21T19:05:00Z")

</div>

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.

```auto
<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!

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

```

Now then, I’d like to use a PHP image resize script, [like this one](http://tech.mikelopez.info/2006/03/02/php-image-resize-script/). 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:

```auto
<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?
