# How do I show an image in XSLT using a URL in my XML file?



## benzrf (Nov 8, 2008)

Say I have an image URL in the path "information/files/image". When I make an XSLT stylesheet, how do I display the image at the URL stored at that path? And I want to be able to change the URL and have it use the new URL without editing my XSLT; If you're going to answer, "Just use <img> with a concrete value and change it when it needs to be changed", please don't bother.


----------



## benzrf (Nov 8, 2008)

bumpitybumpbumpbump


----------



## benzrf (Nov 8, 2008)

bumpitybumpbumpbump


----------



## dm01 (Oct 10, 2006)

Er, you don't _really _need to do that. The Web Design board isn't _that_ busy.

How often would you be changing this path? Every click, page load, or whenever you feel like?


----------



## benzrf (Nov 8, 2008)

I dunno. But my point here is that I want to be able to apply this XSLT file to more than one XML file with the same structure, so it's really inconvenient to have to go back and forth editing my XSLT every time I want to view a different XML file.


----------



## dm01 (Oct 10, 2006)

I don't think you understand, the path is relative to the XLST file, not the XML file. You don't have to change anything, because the XML page imports(?) the XSLT file.


----------



## benzrf (Nov 8, 2008)

Oh! I see. You misunderstood me. I meant the _XPath_ information/files/image. So the URL is defined in the XML, and could be different for different XML files.


----------



## benzrf (Nov 8, 2008)

bumpitybumpbumpbump


----------



## benzrf (Nov 8, 2008)

bumpitybumpbumpbump


----------



## dm01 (Oct 10, 2006)

Like I said before, we're not very busy here. In fact, this is the the first new post all day. Kindly cease and desist this behaviour or you may find your support disappears. I am very busy with mid-terms, and as a result I don't have the free time that I used to enjoy.

The answer is you don't. If you want your site to be secure, you have to change them yourself. Of course one could write a script to handle this, but that would probably leave all kinds of security holes open, and if the script started mucking about and changing things it wasn't supposed to (it happens), then your site is going to be completely useless.


----------



## benzrf (Nov 8, 2008)

Ok. Sorry about that. I'll stop.

By the way, could you tell me what this script is? This is for data on my own computer, so security isn't important. Plus, there's no sensitive information on my laptop, so even if it does get hacked, it's not quite as bad as you might think.


----------



## dm01 (Oct 10, 2006)

I actually have no idea . I think Python _could_ do it, but I don't know enough to even begin coding something for you. I'm mostly concentrating on the higher-level languages (C [and variants], Java, etc.) that would have a fit if you tried to use them this way.


----------

