• 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

Problem with .xlm and .css

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic