aspose file tools*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
 
Don't get me started about those stupid light bulbs.
 
subject: URL rewriting with cocoon and xslt