Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1530348
  • 博文数量: 3500
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 43870
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-03 20:31
文章分类

全部博文(3500)

文章存档

2008年(3500)

我的朋友

分类:

2008-05-04 20:00:05

一起学习
In HTML, default styling is built into the browsers because the tagset of HTML is predefined and hardwired into browsers. IN XML, where you can define your own tagset, browsers cannot know what names you are going to use and what they will mean, so you need a stylesheet if you want to display the formatted text. Browsers which read XML will accept and use a CSS stylesheet at a minimum, but you can also use the more powerful XSLT stylesheet language to transform your XML into HTML -- which browsers, of course, already know how to display (and that HTML can still use a CSS stylesheet). As with any system where files can be viewed at random by arbitrary users, the author cannot know what resources (such as fonts) are on the user's system, so the same care is needed as with HTML using fonts. To invoke a stylesheet from an XML file, include one of the stylesheet declarations: The Cascading Stylesheet Specification (CSS) provides a simple syntax for assigning styles to elements, and has been implemented in most browsers. The Extensible Stylesheet Language (XSL) has been created for use specifically with XML. Dave Pawson maintains a comprehensive FAQ at XSL uses XML syntax (an XSL stylesheet is an XML file) and has widespread support from several major vendors (see the questions on browsers and other software) although current browser support is limited. XSL comes in two flavours: XSL itself, which is a pure formatting language, and which needs a text formatter like FOP or PassiveTeX to create printable output (both can produce PDF). Currently I am not aware of any Web browsers which support XSL rendering; XSLT (T for Transformation), which is a language to specify transformations of XML into HTML either inside the browser or at the server before transmission. It can also specify transformations from one vocabulary of XML to another, and from XML to plaintext. Currently only MS Internet Explorer 5.5 handles XSLT inside the browser (and even that needs some post-installation surgery to remove the obsolete WD-xsl and replace it with the current XSL-Transform processor). But there is a growing use of server-side processors like Cocoon, which let you store your information in XML but serve it auto-converted to HTML, thus allowing the output to be used by any browser. XSLT is also widely used to transform XML into non-SGML formats for input to other systems (for example to transform XML into LaTeX for typesetting. 下载本文示例代码


How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?How do I control appearance?
阅读(80) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~