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 Applying CSS to XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Applying CSS to XML " Watch "Applying CSS to XML " New topic
Author

Applying CSS to XML

Karne Reddy
Ranch Hand

Joined: May 28, 2006
Posts: 35
Hi Friends ,
This is my first post in xml.

Iam having a problem while i am trying to apply a css file to XML file.
I am not getting the expected results.

Details:

My xml file employees.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)-->
<employees xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.employees.com/a employees.xsd" xmlns="http://www.employees.com/a">
<?xml-stylesheet type=�text/css� href="emp.css�?>

<employee position="manager">
<name>
<first>John</first>
<last>Dent</last>
</name>
<age>34</age>
</employee>
.........
</employees>


Here is my css file emp.css

employee{
display: block;
font-weight : bold;
}
name {
display: block;
font-weight : bold;
font-size:18pt
}
age{
display: none;
}


When when i am accessing the employees.xml file in browser(Mozilla &
IE) I am not getting the expected result.

Can anybody help me out?


--------
SCJP,SCWCD


asdfa
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applying CSS to XML