教程集 www.jiaochengji.com
教程集 >  脚本编程  >  javascript  >  正文 XML的显示--CSS

XML的显示--CSS

发布时间:2023-10-31   编辑:jiaochengji.com
教程集为您提供XML的显示--CSS等资源,欢迎您收藏本站,我们将为您提供最新的XML的显示--CSS资源

通过CSS样式表,设置XML文档中每个标记的显示方式。
booklist.css
 

/**//* CSS Document */
booklist{...}{
display: block;
margin: 2px;
padding: 2px;
width: 300px;
border: 1px solid #000000;
font: 12px georgia;
}
book{...}{
display: block;
margin: 2px;
padding: 2px;
border: 1px solid #000000;
}
name{...}{
display: block;
font-style: italic;
font-weight: bold;
}
price{...}{
display: block;
font-family: georgia;
}
description{...}{
display: block;
font-size: 11px;
}
publisher{...}{
display: block;
font-size: 11px;
}
booklist.xml
引用CSS样式表


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE booklist [
<!ENTITY publisher "ABC company">
]>
<?xml-stylesheet type="text/css" href="booklist.css"?>
<booklist>
<book>
<name>Ajax</name>
<price>$5.95</price>
<description>Foundations of Ajax.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>Ajax Patterns</name>
<price>$7.95</price>
<description>Introduction of Ajax Patterns.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>Ajax Web App</name>
<price>$8.95</price>
<description>Edition 2.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>Core CSS</name>
<price>$4.50</price>
<description>A book for CSS.</description>
<publisher>&publisher;</publisher>
</book>
<book>
<name>JSF and Ajax</name>
<price>$6.95</price>
<description>Apress.</description>
<publisher>&publisher;</publisher>
</book>
</booklist>运行结果:

 

您可能感兴趣的文章:

[关闭]
~ ~