Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL rewriting with cocoon and xslt

 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic