File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes CSS with XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "CSS with XML" Watch "CSS with XML" New topic
Author

CSS with XML

aiooua
Greenhorn

Joined: Apr 08, 2001
Posts: 12
Can I use CSS to render my XML documents. How?
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Yes!
First you link your XML document to external CSS stylesheet:
<?xml-stylesheet type=�text/css� href=�myStylesheet.css� ?>
And then, if you have an element with "myElement" name, for example, you can link it with CSS rules as
myElement
{ background-color: white;
border-color: blue;
font-size: 80%
...
}
I read that it's also possible to use internal CSS:
<?xml-stylesheet type=�text/css� href=�#myStylesheet� ?>
<document>
<CSS id=�myStylesheet�>
myElement { some rules here
}
</CSS>
<myElement>blah-blah-blah</myElement>
</document>
but it did not work for me...

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CSS with XML