• 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

Transforming URL

 
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

How can I get this URL working in XSL,

XML:




And corresponding XSL:

Option - 1:



Option - 2:



None of them are working. More over its trying to open relative to context like,



Any ideas to open as a absolute URL. Thanks.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

you can use the following sample xsl code.......



This xsl worked fine if I replace "&" symbol with & amp; in xml file. I have used xalan to run this.
[ July 18, 2006: Message edited by: Vallidevi Appana ]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am confused about the "it" that is "opening" a URL in that question.

Normally XSL is used to transform XML into HTML, as in your example. And it seems that the resulting HTML is processed by the "it" that you didn't describe. The XSL would not be doing that processing. So, what is "it"? And have you looked at the resulting HTML to see whether it looks correct?
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vallidevi, I will try your code.

Sorry Paul for not being clear. What I meant was, the URL in resulting HTML is not giving correct URL.

For eg.,
Say, www.abc.com is the value for <link> in above XML.
The URL in resulting HTML page supposed to show www.abc.com but URL is shown as <a href="http://<app_server>/<app_context>/<b rel="nofollow">www.abc.com</b>" target="_blank">http://<app_server>/<app_context>/www.abc.com (relative to application context).

I am doing XML to HTML transformation by using Xalan XSLT Processor in Java.

What is the code we can use to fix the URL problem in XSL? Thanks.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is something else you are not telling us. No XSLT processor will insert context information like that. This sounds more like something that a JSP tag library would do.
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's what happening. If you think you have a better idea, please shed some light on this.

Requirement is simple, how can I transform the following <link> tag in XML to a valid URL in resulting HTML by using XSL.

 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Either of the two options in your original post will work fine.
reply
    Bookmark Topic Watch Topic
  • New Topic