This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes URL rewriting with cocoon and xslt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "URL rewriting with cocoon and xslt" Watch "URL rewriting with cocoon and xslt" New topic
Author

URL rewriting with cocoon and xslt

karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi ranchers

we are presenting some content to the users via COCOON.
now i need to rewrite all the URLs in this content so they are absolute.
here is an example of what i want to do:
input:
<something src="../images/image1.gif"/>
output:
<something src="IP ORT/context/path/../images/image1.gif"/>

how can i achieve this in my XSLT without hardcoding the IP/PORT/PATH values ?
can i pass in this values as parameters trough the sitemap.xmap of cocoon ?

thanks a lot.
k
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Not sure how it can done using coccoon properties but with xslt,
you can create a small xslt file called resource.xsl with a variable called IPPORT in it, then import/include this xsl in to your main xslt and pass the variable as an input the URL.
Not good solution: if you have too many xslt files


Spritle Software Blogs
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi
well, i'd like to have this without any additional properties. i guess its possible with the sitemap.xmap file to pass all the required parameters in.
any ideas ?

k
 
jQuery in Action, 2nd edition
 
subject: URL rewriting with cocoon and xslt
 
Similar Threads
Displaying images using JSP
Jsp retrieve Image
images in HTML/JSP
Image not getting displayed in JSP
showing dynamic images with xml/xsl