以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  [求助]这是什么?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=13258)


--  作者:宇翔
--  发布时间:1/4/2005 8:10:00 PM

--  [求助]这是什么?
£¼Persons£¾

£ £ £ £ £¼Person£¾

£ £  ¡¡¡¡¡¡¡¡£¼Name£¾С¶«£¼/Name£¾

£ £ £ £ £ £ £¼Nick£¾gwd£¼/Nick£¾

£ £ £ £ £ £ £¼Mobile£¾139XXXXXXXX£¼/Mobile£¾

£ £ £ £ £ £ £¼Tel£¾XXXXXXXX£¼/Tel£¾

£ £ £ £ £ £ £¼Email£¾gwd@chinaren.com£¼/Email£¾

£ £ £ £ £ £ £¼QQ£¾7066015£¼/QQ£¾

£ £ £ £ £ £ £¼Company£¾XXX£¼/Company£¾

£ £ £ £ £¼Person£¾

£ £ £¼/Person£¾


--  作者:宇翔
--  发布时间:1/4/2005 8:11:00 PM

--  
<Persons>
<Person>
     <Name>小东</Name>
<Nick>gwd</Nick>
<Mobile>139XXXXXXXX</Mobile>
<Tel>XXXXXXXX</Tel>
<Email>gwd@chinaren.com</Email>
<QQ>7066015</QQ>
<Company>XXX</Company>
<Person>
</Person>
--  作者:宇翔
--  发布时间:1/4/2005 8:11:00 PM

--  
这是显示的结果!狂郁闷!
--  作者:Qr
--  发布时间:1/5/2005 12:26:00 PM

--  
XML是一种数据描述语言,用IE打开就是这个效果,除非你使用CSS或XSL或XSLT等。
--  作者:anchen0617
--  发布时间:1/5/2005 6:04:00 PM

--  
对,如果保存成  .xml文件形式,打开就是那样的显示,如如果用CSS或XSL等经过转化就可以看到效果

--  作者:anchen0617
--  发布时间:1/5/2005 6:08:00 PM

--  
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!--  Edited with XML Spy v4.2
  -->
- <breakfast_menu>
- <food>
  <name>Belgian Waffles</name>
  <price>$5.95</price>
  <description>two of our famous Belgian Waffles with plenty of real maple syrup</description>
  <calories>650</calories>
  </food>
- <food>
  <name>Strawberry Belgian Waffles</name>
  <price>$7.95</price>
  <description>light Belgian waffles covered with strawberries and whipped cream</description>
  <calories>900</calories>
  </food>
- <food>
  <name>Berry-Berry Belgian Waffles</name>
  <price>$8.95</price>
  <description>light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
  <calories>900</calories>
  </food>
- <food>
  <name>French Toast</name>
  <price>$4.50</price>
  <description>thick slices made from our homemade sourdough bread</description>
  <calories>600</calories>
  </food>
- <food>
  <name>Homestyle Breakfast</name>
  <price>$6.95</price>
  <description>two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
  <calories>950</calories>
  </food>
  </breakfast_menu>

这是XML文件,
再看下面的XSL文件,

  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <!--  Edited with XML Spy v4.2
  -->
- <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
- <body style="font-family:Arial,helvetica,sans-serif;font-size:12pt; background-color:#EEEEEE">
- <xsl:for-each select="breakfast_menu/food">
- <div style="background-color:teal;color:white;padding:4px">
- <span style="font-weight:bold;color:white">
  <xsl:value-of select="name" />
  </span>
  -
  <xsl:value-of select="price" />
  </div>
- <div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
  <xsl:value-of select="description" />
- <span style="font-style:italic">
  (
  <xsl:value-of select="calories" />
  calories per serving)
  </span>
  </div>
  </xsl:for-each>
  </body>
  </html>
把上面的两个文件,分别保存为。XML 和SML文件,运行一下看看就明白了。


--  作者:WindLife
--  发布时间:1/5/2005 6:24:00 PM

--  
这个一定要安装CSS或者XSL才能看见吗?
--  作者:wrsha
--  发布时间:1/5/2005 9:05:00 PM

--  
安装好编辑器,就不需要再另外安装了吧
--  作者:Qr
--  发布时间:1/6/2005 1:12:00 PM

--  
以下是引用WindLife在2005-1-5 18:24:30的发言:
这个一定要安装CSS或者XSL才能看见吗?


IE5以上就支持的,还用安装什么?XSL暂不说,你对HTML了解多少,怎么连CSS都...
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms