[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Remapping image paths

Subject: Remapping image paths
From: Max Romantschuk <max@xxxxxxxxxx>
Date: Tue, 22 Jun 2004 09:14:10 +0300
image paths
I'm working on a system where I have an XHTML based data storage, an I'm using XSLT to extract the relevant bits and pieces into the page framework. I'm keeping my individual pages paths following this pattern: /content/name_of_page/

I'd like to use XSLT to take the paths of img elements referring to image files and make them relative to the root of the site, where my actual site engine resides.

Thus <img src="an_image_file.jpeg" /> would become <img src="content/name_of_page/an_image_file.jpeg" />

I'm using PHP and Sablotron, and I can pass the path of the current page's path into the stylesheet.

This should be rather trivial, but the XSLT references I've ran into so far aren't very detailed on string manipulation.

An additional requirement would be to leave src attribute values pointing to other sites (starting with 'http://') alone. I guess I can do this with xsl:if and a substring match?

Could someone give me an example, or (even better) point me to a decent reference on XSLT string manipulation?

Thanks in advance!

.max


-- Max Romantschuk http://max.nma.fi/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.