• 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

XSL fails with xmlns

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am working on a webproxy portlet which fetches the contents of a web page and displays it in a portlet.
while doing so this portlet creates proxy of all the links. This is done with the help of an XSL.

Here is the XSL contents:


My problem is that if the page that is being accessed using this portlet contains html tag with xmlns then it does not get properly parsed
but if it just has <html> tag then it works properly.

Here is the example:
----------------------------------------
HTML Source:


Since the source has HTML with xmlns <HTML xmlns="http://www.w3.org/1999/xhtml">

The output to the portlet remains same as the original html (which is wrong).
If the source htlm doesn't have xmlns then following is the output for the portlet. (This is desired)



Please suggest me what needs to be changed in XSL to fix this problem.

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

lok bharatendu wrote:
Here is the XSL contents:


HTML source:




You should qualify the xsl template to use the namespace:


If you want the template to match against a HTML element which doesn't have a namespace then you could add a "|" (or) condition:



Try it yourself here



 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic