displaying the xml content with html tags
I have some information stored in an xml file. I need to display the data开发者_如何学编程 in html format and also a few designs which include CSS. How can I do this?
Depends how much work you want to do. You could always parse the XML using Java to create the HTML output, or you could also use XSLT.
You can apply css directly to your xml file with xml-stylesheet processing instruction. For examle, xml:
<?xml version="1.0"?>
<?xml-stylesheet href="style.css" type="text/css"?>
<root>
<value>value 1</value>
<value>value 2</value>
</root>
and style.css:
root {
background-color: yellow;
}
value {
display: block;
font-size: x-large;
}
For more complex processing you can use XSLT.
精彩评论