XML与CSS类选择符的使用
Class.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="class.css"?>
<bookdetail>
<book class="A">
<author>曹雪芹</author>
<title>红楼梦</title>
<price>60.00</price>
</book>
<book class="A">
<author>罗贯中</author>
<title>三国演义</title>
<price>40.00</price>
</book>
<book class="M">
<author>琼瑶</author>
<title>一帘幽梦</title>
<price>20.00</price>
</book>
</bookdetail>
Class.css
@charset "utf-8";
/* CSS Document */
bookdetail
{
display:block
}
book.a
{
color:blue;
}
book
{
display:block
}
price
{
font-style:italic
}
相关文档:
<Records>
<Record>
<id>1 </id>
<name>李四 </name>
</Record>
<Record>
<id>2 </id>
<name>张三 </name>
</Record>
<Record>
<id>3 </id>
<name>王五 </name>
</Record& ......
在前端开发中,我们经常遇到这样的情况:服务器传到前端的图片需要缩小以显示(如下),在将其缩放之后,IE中图片效果不容乐观。
<img class="thumb" src=http://www.webyi.com/wschool/wdesign/CSS/20090905/"pic.jpg" alt="This image is really 500x500 big" width="50" height="50" />
IE7支持自定义双三次&ldq ......
用的是一种很笨的方法,但可以帮助初学者了解访问XML节点的过程。
已知有一个XML文件(bookstore.xml)如下:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
&n ......
Flash中的XML对象也有方法可以将XML数据向服务器发送。即send和sendAndLoad。send方法向某个 URL 传递 XML 对象,返回的信息都被发送到另外一个浏览器窗口;sendAndLoad 方法向某个 URL 发送一个 XML 对象。返回的信息都放在一个XML对象中。
在某种程度上, XML的send方法和sendAndLoad方法类似于loadVars对象的send方法和 ......
Product.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="product.css" ?>
<productata>
<product prodid="p001" category="toy">
<productname>Mini Bus</productname>
<description>This is a toy for childern aged 4 and above&l ......