• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URL rewriting with cocoon and xslt

 
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic