XML样式

今天写了一个简单的XML,丢到浏览器中时有这样的提示

This XML file does not appear to have any style information associated with it. The document tree is shown below.

这是“XML样式”的问题。

可以有两种方式定义XML的样式:CSS和XSLT。

CSS的例子如下:

test.xml

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="test.css"?> 
<test>
<name>OldWang</name>
<sex>male</sex>
<birthday>8.22</birthday>
<skill>AI</skill>
</test>

test.css

resume{ display: block;}
name{ display: block; font-size:120%;}
sex{ display:block; text-indent:2em}
birthday{ display:block; text-indent:2em}
skill{ display:block; text-indent:2em}

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念