Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with .xlm and .css

 
nan sh
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your XML document, what does the style link look like?
 
nan sh
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic