File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Murach's Java Servlets and JSP this week in the Servlets 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

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:
<something src="../images/image1.gif"/>
<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.
Balaji Loganathan
author and deputy

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
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 ?

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