XML样式

前端之家收集整理的这篇文章主要介绍了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}
原文链接:https://www.f2er.com/xml/293368.html

猜你在找的XML相关文章