Jump to content

Changing IMG src


MrAdam

Recommended Posts

Hey guys! ... im new to XML and learning the basics.Is it possibile to create an XML feed to change an img src for each section. Im making a members section for a website using an XML feed (so it's easier for the admin to edit) .. except i want an image for each member... so i would like to ideally change the src of the image depending upon an XML tag like:<imgsrc>images/image.jpg</imgsrc>How could i achieve this in XSL ? .. hope this made sense..Thanks alot! Adam Boxall

Link to comment
Share on other sites

First stop: not every XML file is a "feed".Second: entering every member's information is not good for performance reasons. SQL database could be better in this case.as for how to achieve this is XSLT. Simple:

<xsl:variable name="src" select="imgsrc" /><img src="{$src}" />

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...