开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜