aspose file tools*
The moose likes Tomcat and the fly likes Problem with .xlm and .css Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem with .xlm and .css" Watch "Problem with .xlm and .css" New topic
Author

Problem with .xlm and .css

nan sh
Ranch Hand

Joined: Jan 05, 2001
Posts: 167
I experienced problem as tomcat open .xml file with .css.
I used tomcat only, without apatch, when url typed into the browser, it only showed .xml
context with.css format.
Anyone know what is wrong?
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Support for xml document viewing in browsers is not the same between browsers. What one are you using? and what does the code look like that produces the XML response? Or are you browsing to an XML file directly?
nan sh
Ranch Hand

Joined: Jan 05, 2001
Posts: 167
Sorry Mike,
What I want to said is that if I open XML as file with browser, the context and style all correct, but if I access through tomcat with URL typed in browser, only context display correctly without style.
And I did both with same computer and same broswer.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

In your XML document, what does the style link look like?
nan sh
Ranch Hand

Joined: Jan 05, 2001
Posts: 167
home.ccs as the following;
page
{
background-color: #ffff00;
width: 100%;
}
title
{
display: block;
margin-bottom: 30pt;
margin-left: 0;
font-size: 50pt;
}
para
{
color: #FF0000;
font-size: 20pt;
}
----------------------------
And, home.xml as the following
<?xml version="1.0"?>
<?xml-stylesheet href="home.css" type="text/css"?>
<page>
<title>XML Home Page</title>
<para>Welcome to one of the few Home Pages written in XML, A technology will let programmers lost job, revenge ...</para>
</page>
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

There are a couple articles I found regarding this topic:

Here is one that uses xsl style information, the preferred method for XML transformations.
http://www.devx.com/upload/free/features/javapro/2000/08aug00/ww0008/ww0008-1.asp

Another one here shows how to do what you are trying, with the css style sheet. It looks to me like you've done everything the same as they have
http://www.w3schools.com/xml/xml_display.asp

Perhaps you are using a browser that just doesn't understand what to do with an xml document?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with .xlm and .css