mee
mee

Reputation: 851

XML XSL is not working with Chrome,FireFox, Opera

I have XML file transformed to html using XSLT. It works well in Internet Explorer but when I tried the same in Chrome, Firefox, Opera, it displays the HTML code and not loading the page.

I google'd and found that xml-stylesheet type should be application/XML for chrome, Firefox. But it didn't work. below is my xml namespace,

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
           xmlns:lxslt="http://xml.apache.org/xslt" version="1.0">
    <xsl:output method="html" indent="yes" />

this is my xml code,

<?xml version="1.0" encoding="ISO-8859-1"?>

<UserTabs>
<ToolInfo>
  <Name name = "test"/>
</ToolInfo>

<BannerTabs>
    <Tab name="HOME" Url="http://www.test.com"/>
    <Tab name="HISTORY" Url="/com/servlet/test.servlet?func=history"/>
    <Tab name="ABOUT" Url="/com/servlet/test.servlet?func=about" absUrl="true"/>
    <Tab name="EXIT" Url="/com/servlet/test.servlet?func=logout"/>
</BannerTabs>


<MenuTabs>

</MenuTabs>


<Navigation>
    <Menu bgcolor="#E0E0E0" name="Change.Language">
        <Item href="/com/servlet/test.servlet?func=customize" icon="bluebutton.gif" name="CUSTOMIZE" target="main" textcolor="blue" value="">
        </Item>
    </Menu>


</Navigation>   

<languages>
    <lang name="English (en)" Url="en"/>
</languages>




<runtime>
</runtime>
</UserTabs>

Upvotes: 2

Views: 3198

Answers (1)

mee
mee

Reputation: 851

I have found the solution for my own question after searching and googling,

My XSL and XML namespace were correct but i need to add in the servlet also the response content type both in doGet and doPost. And I have added it, its working now. MIME types can be found in the below link,

Upvotes: 1

Related Questions