`
fishermen
  • 浏览: 374135 次
社区版块
存档分类
最新评论

dom4jz之基础:XSL,XSLT,XPATH,XHTML,XML命名空间(网上搜集整理)

阅读更多

整理到一块,方便自己与大家查阅

XHTML 介绍

XHTML is a stricter and cleaner version of HTML
XHTML是更严密代码更整洁的HTML版本 .
What Is XHTML?
什么是XHTML?
XHTML stands for EXtensible HyperText Markup Language
XHTML是具有延伸性的超文本标记语言
XHTML is aimed to replace HTML
出现XHTML目的就是要替代HTML
XHTML is almost identical to HTML 4.01
XHTML和HTML4.01几乎相同
XHTML is a stricter and cleaner version of HTML
XHTML是更严密代码更整洁的HTML版本
XHTML is HTML defined as an XML application
XHTML的定义形同将HTML视为XML(从代码的结构上)
XHTML is a W3C Recommendation
XHTML是W3C的推荐标准
What You Should Already Know
学前应具备知识

Before you continue you should have a basic understanding of the following:
学习XHTML前应具备的知识
HTML and the basics of building web pages
HTML以及制作WEB页面的基础

If you want to study HTML first, please read our HTML tutorial.
如想要先学习下HTML,可以阅读我们的HTML教程
XHTML is a W3C Recommendation
XHTML是W3C的推荐标准

XHTML 1.0 became a W3C Recommendation January 26, 2000.
2000年1月26日XHTML1.0成为W3C的推荐标准之一

A W3C Recommendation means that the specification is stable, that it has been reviewed by the W3C membership, and that the specification is now a Web standard.
成为W3C的推荐标准意味着其规格已经稳定,W3C成员组也已经认可,已正式成为WEB标准

W3C defines XHTML as the latest version of HTML. XHTML will gradually replace HTML.
W3C表态XHTML作为最新版本的HTML会逐渐取代HTML
All New Browsers Support XHTML
新的浏览器都支持XHTML

XHTML is compatible with HTML 4.01.
XHTML与HTML4.01是相互兼容的

All new browsers have support for XHTML.
所有较新的浏览器都支持XHTML
W3pop使用的是XHTML

 

A click on this symbol:  validates the XHTML part of this page.
点击该标记: 检验此页面是否符合XHTML标准

A click on this symbol:  validates the CSS part of this page.
点击该标记: 检验此页的CSS部分
About This Tutorial
有关此教程

The next chapters of this tutorial will explain:
下个章节将介绍以下内容:
Why you should use XHTML
使用XHTML的原因
The syntax of XHTML
XHTML语法
How to converted to XHTML
如何转换为XHTML
XHTML validation
XHTML校验
XHTML modularization
XHTML模块

XSL-FO 介绍
w3pop.com / 

 
XSL-FO 文档

XSL-FO is about formatting XML data for output.
XSL-FO将用于输出的XML数据格式化
What You Should Already Know
你应该已经知道的知识

Before you study XSL-FO you should have a basic understanding of XML and XML Namespaces.
在学习XSL-FO之前你应该对XML和XML名称空间有基本的了解

If you want to study these subjects first, please read our XML Tutorial.
如果你想先学习这些,请阅读我们的.XML 教程.
What is XSL-FO?
什么是XSL-FO?
XSL-FO is a language for formatting XML data
XSL-FO是用语格式化XML数据的语言
XSL-FO stands for Extensible Stylesheet Language Formatting Objects
XSL-FO全称为Extensible Stylesheet Language Formatting Objects (格式化对象的可扩展样式表语言)
XSL-FO is a W3C Recommendation
XSL-FO是W3C参考标准
XSL-FO is now formally named XSL
XSL-FO现在通常叫做XSL
XSL-FO is About Formatting
XSL-FO用于格式化

XSL-FO is an XML-based markup language describing the formatting of XML data for output to screen, paper or other media.
XSL是一种以XML为基础的标记语言,它对输出到屏幕、纸张或其它媒体上的XML数据的格式化作了具体的描述。
XSL-FO is Formally Named XSL
XSL-FO现在通常叫做XSL

Why this confusion? Is XSL-FO and XSL the same thing?
XSL-FO和 XSL是相同的东西吗?为什么会这样的混淆?

Yes it is, but we will give you an explanation:
的确是这样,可以给出这样的解释:

Styling is both about transforming and formatting information. When the World Wide Web Consortium (W3C) made their first XSL Working Draft, it contained the language syntax for both transforming and formatting XML documents.
样式化包括信息的转换和格式化。当万维网联盟(W3C)做出第一份XSL工作草案时,它囊括了XML文档的转换和格式化的语法。

Later, the XSL Working Group at W3C split the original draft into separate Recommendations:
后来,W3C的XSL工作组把原草案分成了以下几块参考标准:
XSLT, a language for transforming XML documents
XSLT,用于转换XML文档的语言
XSL or XSL-FO, a language for formatting XML documents
XSL 或 XSL-FO,用于格式化XML文档的一种语言
XPath, a language for navigating through elements and attributes in XML documents
XPath,用于在XML文档中对元素和属性进行操作的语言

The rest of this tutorial is about formatting XML documents: XSL-FO, also called XSL.
指南剩下部分是关于格式化XML文档的:XSL-FO,也称作XSL

You can read more about XSLT in our XSLT Tutorial.
在我们的XSLT 教程中你可以了解更多关于XSLT

You can read more about XPath in our XPath Tutorial.
在我们的XPath 教程中你可以了解更多关于 XPath.
XSL-FO is a Web Standard
XSL-FO是网络标准

XSL-FO became a W3C Recommendation 15. October 2001. Formally named XSL.
2001年10月15日,XSL-FO已经成为了W3C的参考标准。它通常被称作XSL。

To read more about the XSL activities at W3C please read our W3C Tutorial.
在我们的W3C 教程.你可以读到更多关于XSL的特性

 

XSLT 介绍
大中小
 

XSLT is a language for transforming XML documents into XHTML documents or to other XML documents.
XSLT是一种把XML文件转换成XHTML文档或者其他的XML文档的语言。

XPath is a language for navigating in XML documents.
XPath是一种由于操作XML文档的语言。
What You Should Already Know
学前基础

Before you continue you should have a basic understanding of the following:
如果你想继续下面的学习,你必须得掌握下面的一些基本常识。
HTML / XHTML
XML / XML 命名空间
XPath

If you want to study these subjects first, find the tutorials on our Home page.
如果你想要先学习这些课题,那请在知识库找到这些教程.
What is XSLT?
什么是XSLT?
XSLT stands for XSL Transformations
XSLT代表XSL转换(XSL Transformations)
XSLT is the most important part of XSL
XSLT是XSL最重要的部分
XSLT transforms an XML document into another XML document
XSLT可以把XML文档转换成另一个XML文档
XSLT uses XPath to navigate in XML documents
XSLT通过XPath操作XML文档
XSLT is a W3C Recommendation
XSLT是一种W3C参考标准
XSLT = XSL Transformations
XSLT=XSL转换(XSL Transformations)

XSLT is the most important part of XSL.
XSLT是XSL的最重要的一部分。

XSLT is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML and XHTML. Normally XSLT does this by transforming each XML element into an (X)HTML element.
XSLT用于把XML文件转换成另一份XML文件,或者转换成另一种被浏览器所识别的诸如HTML和XHTML类型的文件。通常情况下,XSLT是通过把每个XML元素转换成(X)HTML文件来完成的。

With XSLT you can add/remove elements and attributes to or from the output file. You can also rearrange and sort elements, perform tests and make decisions about which elements to hide and display, and a lot more.
通过XSML,你可以从已输出的文件里添加/移除元素和属性。你也可以把元素重新排列和分类,执行测试语句,决定是隐藏还是显示元素,或者实现其它更多的功能。

A common way to describe the transformation process is to say that XSLT transforms an XML source-tree into an XML result-tree.
对于描述转换过程,可以形象的描述为:XSLT把XML源树转(XML source-tree)换成XML结果树(XML result-tree)。
XSLT Uses XPath
XSLT对于XPath的使用

XSLT uses XPath to find information in an XML document. XPath is used to navigate through elements and attributes in XML documents.
XSLT通过对XPath的使用来找寻XML文档中的信息。XPath用于操作XML文件中的元素和属性。

If you want to study XPath first, please read our XPath Tutorial.
如果你想先学习XPath,请先阅读我们的XPath教程.
How Does it Work?
如何使它运行?

In the transformation process, XSLT uses XPath to define parts of the source document that should match one or more predefined templates. When a match is found, XSLT will transform the matching part of the source document into the result document.
在转换过程中,XSLT通过XPath来定义部分应该和一个或更多预定的模板相匹配的源文件。当一个匹配找到后,XSLT将会把相匹配的部分源文件转换成结果文档。
XSLT is a Web Standard
XSLT是一个网络标准

XSLT became a W3C Recommendation 16. November 1999.
XSLT在1999年11月16日成为W3C参考标准。

XPath介绍
w3pop.com 
 
XPath Nodes(节点)

XPath is a language for finding information in an XML document. XPath is used to navigate through elements and attributes in an XML document.
XPath是用于在XML文件上寻找信息的一种语言。XPath用于操纵XML文件上的元素和属性。
What You Should Already Know
写在前面

Before you continue you should have a basic understanding of the following:
首先你要了解以下几个概念:
HTML / XHTML
XML / XML Namespaces
XML / XML命名空间

If you want to study these subjects first, find the tutorials on our Home page.
你可以从我们的首页获取相关的教程
What is XPath?
什么是可扩展路径(XPath)?
XPath is a syntax for defining parts of an XML document
XPath 是XML中的一种语法
XPath uses path expressions to navigate in XML documents
XPath 是XML文档中的路径索引
XPath contains a library of standard functions
XPath 包含一个标准函数库
XPath is a major element in XSLT
XPath 是一个XSLT的主要元素
XPath is a W3C Standard
XPath 是W3C标准
XPath Path Expressions
XPath 路径表达式

XPath uses path expressions to select nodes or node-sets in an XML document. These path expressions look very much like the expressions you see when you work with a traditional computer file system.
XPath路径表达式用于从XML文档中选取节点或节点设置。这些语句类似于传统操作系统的语句。
XPath Standard Functions
XPath 标准函数

XPath includes over 100 built-in functions. There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more.
XPath包含100多种内置函数。包括:字符值,数字值,日期和时间方法,节点操作,排序操作,布尔值等。
XPath is Used in XSLT
XPath用于XSLT

XPath is a major element in the XSLT standard. Without XPath knowledge you will not be able to create XSLT documents.
XPath是XSLT标准的一个重要元素。在创建XSLT文档前你必须先了解XPath。

You can read more about XSLT in our XSLT tutorial.
你可以从我们的XSLT教程中了解更多。

XQuery and XPointer are both built on XPath expressions. XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators.
XQuery 和 XPointer都是基于XPath表达式构建的。它们有着相同的数据模式并支持相同的函数和操作。

You can read more about XQuery in our XQuery tutorial.
你可以从我们的XQuery教程中了解更多。
XPath is a W3C Standard
XPath 是W3C标准

XPath became a W3C Recommendation 16. November 1999.
XPath 在1999年11月16日成为W3C标准。

XPath was designed to be used by XSLT, XPointer and other XML parsing software.

You can read more about the XPath standard in our W3C tutorial.
你可以从我们的W3C教程中了解更多。

作者tag:java CSDN 推荐tag:jbuilder eclipse ultraedit editors borland 
 [原创]XML命名空间

XML 命名空间提供了一种避免元素命名冲突的方法。

先给出一个XML文档示例:

<!---->

                               xmlns=http://www.Monson-Haefel.com/jwsbook/PO"

                               xmlns:addr=http://www.Monson-haefel.com/jwsbook/ADDR">

Amazon.com

888

            amazon.com

            185 Mercer Drive

 

 

             XI'AN

             710127

 

          

           888

 

 

命名冲突

  因为XML文档中使用的元素不是固定的,那么两个不同的XML文档使用同一个名字来描述不同类型的元素的情况就可能发生。而这种情况又往往会导致命名冲突。如上述例子中的

 

命名空间属性

命名空间属性一般放置在元素的开始标记处,其使用语法如下所示:

       xmlns:namespace-prefix="namespace"

上例中purchaseOrder 元素属性中声明了两个命名空间,黑体所示。

    W3C 命名规范声明命名空间本身就是一个统一资源标示符(URI),当我们在元素的开始标记处使用命名空

间时,该元素所有的子元素都将通过一个前缀与同一个命名空间相互关联。

注意:用来标识命名空间的网络地址并不被XML解析器调用,XML解析器不需要从这个网络地址中查找信息,该网络地

址的作用仅仅是给命名空间一个唯一的名字,因此这个网络地址也可以是虚拟的,然而又很多公司经常把这个网络地址

值象一个真实的Web页面,这个地址包含了关于当前命名空间更详细的信息。

默认命名空间

  定义一个默认的XML命名空间使得我们在子元素的开始标记中不需要使用前缀。他的语法如下所示:

    

      

如前面例子中xmlns=http://www.Monson-Haefel.com/jwsbook/PO"就声明了一个默认的命名空间。xmlns属性使

元素和不同的命名空间关联在一起。

限定名称

  对于XML而言,与元素名组合在一起的前缀称为限定名称(QName)。因此像addr:address这样的限定名称可以不引用

http://www.MonsonHaefel.com/jwsbook/ADDR。

  QName包括两个部分,即XML命名空间和位置名称。如上例中的street元素的限定名称由命名空间http://www.Monson-haefel.com/jwsbook/ADDRww.Monson-haefel.com/jwsbook/ADDR

和位置名称street组成。

 

 

 

结点携带了不同的信息,但结点名称却相同,造成命名冲突。因此需要加前缀"addr"以示区分。

 

 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics