html显示xml xsl,XML入门教程:使用XSL显示XML

通过使用XSL,您可以向XML文档添加显示信息。

使用XSL显示XML

XSL是首选的XML样式表语言。

XSL远比CSS更加完善。使用XSL的方法之一是在浏览器显示XML文件之前,先把它转换为HTML,正如以下的这些例子演示的那样:

查看XML文件:

以下为引用的内容:

-

-

-

Belgian Waffles

$5.95

two of our famous Belgian Waffles with plenty of real maple syrup

650

-

Strawberry Belgian Waffles

$7.95

light Belgian waffles covered with strawberries and whipped cream

900

-

Berry-Berry Belgian Waffles

$8.95

light Belgian waffles covered with an assortment of fresh berries and whipped cream

900

-

French Toast

$4.50

thick slices made from our homemade sourdough bread

600

-

Homestyle Breakfast

$6.95

two eggs, bacon or sausage, toast, and our ever-popular hash browns

950

XSL样式表:

以下为引用的内容:

-

-

-

-

-

-

-

-

-

(

calories per serving)

查看结果。

下面是此XML文件的一个片断。 第二行,<?xml-stylesheet type="text/xsl" href="simple.xsl"?>,把这个XML文件链接到XSL文件:

以下为引用的内容:

Belgian Waffles

$5.95

two of our famous Belgian Waffles

650

如果你需要学习更多有关XSL的知识,请访问我们的《XSL教程》。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值