XSLT and XPath Quick Reference

合集下载

xpath,xslt,json基本语法学习

xpath,xslt,json基本语法学习

1、实体引用 在 XML 中,一些字符拥有特殊的意义。

如果你把字符 "<" 放在 XML 元素中,会发生错误,这是因为解析器会把它当作新元素的 开始。

这样会产生 XML 错误: <message>if salary < 1000 then</message> 为了避免这个错误,请用实体引用来代替 "<" 字符: <message>if salary &lt; 1000 then</message> 在 XML 中,有 5 个预定义的实体引用: &lt; &gt; &amp; &apos; &quot; < > & ' " 小于 大于 和号 单引号 引号注释:在 XML 中,只有字符 "<" 和 "&" 确实是非法的。

大于号是合法的,但是用实体引 用来代替它是一个好习惯。

2、xml 注意事项 注释:如果属性值本身包含双引号,那么有必要使用单引号包围它,就像这个例子: <gangster name='George "Shotgun" Ziegler'> 或者可以使用实体引用: <gangster name="George &quot;Shotgun&quot; Ziegler"> XML 元素 vs. 属性 请看这些例子: <person sex="female"> <firstname>Anna</firstname> <lastname>Smith</lastname> </person> <person> <sex>female</sex> <firstname>Anna</firstname> <lastname>Smith</lastname> </person> 在第一个例子中,sex 是一个属性。

XPATH参考手册

XPATH参考手册

XPath 教程Next Page XPath 是一门在 XML 文档中查找信息的语言。

XPath 可用来在 XML 文档中对元素和属性进行遍 历。

XPath 是 W3C XSLT 标准的主要元素,并且 XQuery 和 XPointer 同时被构建于 XPath 表达 之上。

因此,对 XPath 的理解是很多高级 XML 应用的基础。

开始学习 XPath !XPath 参考手册在 W3School,我们提供完整的 XPath 2.0、XQuery 1.0 和 XSLT 2.0 的内置函数参考手册。

XPath 函数内容目录XPath 简介 本章讲解 XPath 的概念。

XPath 节点 本章详细介绍 XPath 中不同类型的节点,以及节点之间的关系。

XPath 语法 本章讲解 XPath 的语法。

XPath 轴 本章讲解 XPath axes(轴)。

XPath 运算符 本章列出了可以用于 XPath 表达式的运算符。

XPath 实例 本章使用 "books.xml" 文档来演示一些 XPath 实例。

XPath 摘要 本文内容包括在本教程所学知识的一个总结,以及我们向你推荐的下一步应该学习的内容。

XPath 参考手册XPath 函数XPath 2.0、XQuery 1.0 和 XSLT 2.0 的内置函数。

XPath 简介 Previous Page Next Page XPath 是一门在 XML 文档中查找信息的语言。

XPath 用于在 XML 文档中通过元素和属性进行导 航。

在学习之前应该具备的知识:在您继续学习之前,应该对下面的知识有基本的了解: HTML / XHTML  XML / XML 命名空间如果您希望首先学习这些项目,请在我们的 首页 访问这些教程。

什么是 XPath? XPath 使用路径表达式在 XML 文档中进行导航  XPath 包含一个标准函数库  XPath 是 XSLT 中的主要元素  XPath 是一个 W3C 标准XPath 路径表达式XPath 使用路径表达式来选取 XML 文档中的节点或者节点集。

XPath

XPath

返回
位置路径的构成
位置步之间利用反斜杠(/)串接成位置路径。 位置路径中的每一步都相对其前一步 如果位置路径以反斜杠打头,则该路径的第一 步将相对与根结点;否则该路径的第一步将相 对上下文结点。
位置步 // .. . 描述 上下文结点的所有后代结点,包括上下文结点本身 上下文结点的父结点 上下文结点本身
如下 XML 文档:
<?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore>
XSLT用XPath表达式来匹配和选择输入XML文档 的特定部分以便执行相应操作并生成输出文档 XPointer用XPath表达式来定位外部XML文档的某 个特定部分 W3C XML Schema用XPath表达式来定义唯一性限 制
XML文档的树型结构(1)
一个XML文档以看成由结点(nodes)构成的树。 XPath是在文档树中选择结点或结点集的语言。 XPath区分了如下类型的结点
返回
位置路径与基本位置步(2)
位置步 / 元素名 @属性名 comment() text() processing-instruction() processing-instruction(目标) * node() @* 位置路径1|位置路径2|… 描述 文档的根结点 上下文结点的所有具有给定元素名的子元素 上下文结点的所有具有给定属性名的属性 上下文结点的所有注释子结点 上下文结点的所有文本子结点 上下文结点的所有处理指令子结点 上下文结点的所有具有指定目标的处理指令 子结点 上下文结点的所有子元素,可以带前缀 上下文结点的所有子结点 上下文结点的所有属性,*前可以带前缀 多值匹配

xpath 方法

xpath 方法

xpath 方法(原创版2篇)目录(篇1)1.XPath 简介2.XPath 的应用场景3.XPath 的基本语法4.XPath 函数5.XPath 的优势与局限性正文(篇1)一、XPath 简介XPath 是一种在 XML 文档中进行节点和属性查找的语言,它可以用来提取和操作 XML 数据。

XPath 本质上是一种路径表达式,用于表示 XML 文档中的节点和属性。

通过 XPath,我们可以在 XML 文档中快速准确地定位到所需的节点和属性,从而简化了 XML 数据的处理和操作。

二、XPath 的应用场景XPath 广泛应用于以下场景:1.数据提取:从 XML 文档中提取特定的节点和属性。

2.数据过滤:根据特定条件筛选 XML 文档中的节点和属性。

3.数据排序:对 XML 文档中的节点和属性进行排序。

4.数据修改:修改 XML 文档中的节点和属性。

三、XPath 的基本语法XPath 的基本语法包括以下几个部分:1.轴:表示节点之间的关系,包括根节点(root)、父节点(parent)、子节点(child)、同级节点(sibling)等。

2.节点类型:表示节点的类型,包括元素(element)、属性(attribute)、文本(text)、评论(comment)等。

3.运算符:用于连接路径表达式,包括斜杠(/)、双点(..)、单点(.)等。

4.函数:用于进行复杂的数据操作,如求和、求积等。

以下是一个简单的 XPath 表达式示例:```//root/element[attribute=value]/child```四、XPath 函数XPath 提供了丰富的函数来处理和操作 XML 数据,包括:1.节点操作函数:如 count、length、first、last 等。

2.属性操作函数:如 get-attribute、setAttribute 等。

3.字符串操作函数:如 substring、substring-after、substring-before 等。

XML考试试题及参考答案

XML考试试题及参考答案

试题一一、填空题(每空1分,共20分)1.XML是一种设计特定领域标记语言的________语言。

2.XML文档的声明中的编码方式常用的有_________和GB2312。

3.XML解析器是_______之间存在的软件组织。

4.XML的技术优势有_______,_______,________,语法自由,结构化集成数据。

5.XML 文档元素的特性是______,_______,________。

6.DTD的全程为_________,它分为________和_______两种。

7.DTD中%用于声明________。

8.ElementType元素的content属性的有效性包括_______,________,________,_________。

1 / 379.W3C XML schema的数据类型分为________,_________。

10.W3C XML schema的数据类型_______指定32位浮点数。

二、判断题(每小题1分,共10分)1. XSLT包含XSL和XPath的强大功能,从而可以把XML文档转换成任何一种其它格式的文档。

( )2. 在XML文档中引用一个CSS样式的语法为:<?xml-stylesheet type=”text/css” href=”css样式表文件路径”?>。

( )3. CSS最初是针对HTML而提出的样式表,现在同样可以很好地应用于描述XML文档显示。

( )2 / 374.有效XML文档不一定是格式正规的XML文档。

( )5.格式正规的XML文档一定是有效XML文档。

( )6. XSL样式表可以用来“装饰”XML文档和RTF文档。

( )7.列表类型是其值用空格隔开的原子值列表。

( )8.XML shema中的的复杂类型是有三种不同的类型。

( )9.simpleContent元素的内容标记必须在选项restriction和extension中任选一项。

XML文件的转换

XML文件的转换

XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法
XPath的比較運算子: XPath的比較運算子: 的比較運算子
範例如下: 範例如下:
XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法
XPat供一些簡寫語法,縮短XPath敘述 XPath將提供一些簡寫語法,縮短XPath敘述。 敘述。 將提供一些簡寫語法 下表為這些簡寫語法的說明: 下表為這些簡寫語法的說明:
XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法
節點測試: 節點測試:
XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法
XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法
篩選範圍如下: 篩選範圍如下:
XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法
XPath所謂的 XPath所謂的Axes(中樞)觀念,就是利用已經 所謂的Axes(中樞)觀念, 完成預設參照路徑的關鍵字建立XPath的參照路 完成預設參照路徑的關鍵字建立XPath的參照路 徑。
XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法
串連符號– 串連符號–『/』:若欲串連數個XPath語法,漸 若欲串連數個XPath語法 語法, 漸縮小篩選XML文件中資料的範圍 文件中資料的範圍, 漸縮小篩選XML文件中資料的範圍,則需運用 符號。常見的XPath語法將如下所示 語法將如下所示。 『/』符號。常見的XPath語法將如下所示。
XSLT與XPath的簡介 XPath語法 XSLT與XPath的簡介 - XPath語法

XSLT入门学习资料、XPath转换XML文件资料

8.2.2 XSLT简介XSLT提供一套规则,用于将一组元素描述的XML数据转换为另一组元素描述的文档,或者是将该数据转换为一种自定义的文本格式。

如员工的数据XML文件,通过XSLT转换,在公司的网站中会以HTML 的格式输出显示,而对于会计则只需要转换成自定义的文本格式员工数据就可以。

XSLT把XML文档转换为完全不同的输出。

这样可以把数据内容存储在XML文档中,然后通过各种媒体将其输出到各种介质中:无线电、打印、语音等格式。

当数据发生变化时,只需要修改源XML文档,不需要在多处重复相同的修改工作。

通常情况下,XSLT用于将XML文档转换为HTML,目的是可以在浏览器中进行显示。

最简单的XSLT应用情况首先涉及到两个文档:包含原始数据的XML文档和用来转换该文档的XSLT转换文档。

将XML原文档输入,处理器根据XSLT文档作为模板进行转换,最终输出需要的文档。

图8.1 使用XSL转换XML文档XSLT的一些可能的应用包括:∙以查看为目的添加元素。

如向XML格式的订单中添加公司标志或发送者的地址。

∙从现在内容创建新的内容。

如创建目录。

∙从XML文档中提取信息。

如向管理人员提供详细的信息,对普通员工提供有限的信息。

∙在不同的XML字典或模型之间进行转换。

如将公司专用的文档转换为符合业界标准的文档。

∙将XML文档转换为HTML,用以实现与现有浏览器之间的兼容。

有关XSLT的语法规则,将在本章后续部分详细介绍。

8.2.3 XPath简介XPath是XSLT的重要组成部分。

它是一种专门用来在XML文档中查找信息的语言。

XPath隶属XSLT,因此通常会将XSLT语法和XPath 语法混在一起阐述。

可以这样来解释:如果将XML文档看作一个数据库,XPath就是SQL查询语言;如果将XML文档看成DOS目录结构,XPath就是cd,dir等目录操作命令的集合。

在XSLT中, XPath表达式返回4种类型值:节点集合(node-set)、布尔值(Boolean)、数字和字符串。

(word完整版)xpath详解总结,很全面

经常在工作中会使用到XPath的相关知识,但每次总会在一些关键的地方不记得或不太清楚,所以免不了每次总要查一些零碎的知识,感觉即很烦又浪费时间,所以对XPath归纳及总结一下。

在这篇文章中你将能学习到:•XPath简介•XPath 路径表达式详解•XPath在DOM,XSLT及XQuery中的应用XPath简介XPath是W3C的一个标准。

它最主要的目的是为了在XML1.0或X ML1.1文档节点树中定位节点所设计。

目前有XPath1.0和XPath2. 0两个版本。

其中Xpath1.0是1999年成为W3C标准,而XPath 2.0标准的确立是在2007年。

W3C关于XPath的英文详细文档请见:/TR/xpath20/。

XPath是一种表达式语言,它的返回值可能是节点,节点集合,原子值,以及节点和原子值的混合等。

XPath2.0是XPath1.0的超集。

它是对XPath1.0的扩展,它可以支持更加丰富的数据类型,并且X Path2.0保持了对XPath1.0的相对很好的向后兼容性,几乎所有的XPath2.0的返回结果都可以和XPath1.0保持一样。

另外XPath2. 0也是XSLT2.0和XQuery1.0的用于查询定位节点的主表达式语言。

XQuery1.0是对XPath2.0的扩展。

关于在XSLT和XQuery中使用XPath表达式定位节点的知识在后面的实例中会有所介绍。

在学习XPath之前你应该对XML的节点,元素,属性,原子值(文本),处理指令,注释,根节点(文档节点),命名空间以及对节点间的关系如:父(Parent),子(Children),兄弟(Sibling),先辈(Ancestor),后代(Descendant)等概念有所了解。

这里不在说明。

XPath路径表达式在本小节下面的内容中你将可以学习到:•路径表达式语法•相对/绝对路径•表达式上下文•谓词(筛选表达式)及轴的概念•运算符及特殊字符•常用表达式实例•函数及说明这里给出一个实例Xml文件。

通过代码实例跟我学XML XSLT相关的应用技术——XPath的功能函数的应用技术及实例

1.1通过代码实例跟我学XML XSLT相关的应用技术——XPath的功能函数的应用技术及实例在XPath里有很多功能函数可以帮助我们精确寻找需要的节点。

1、count()功能作用:统计计数,返回符合条件的节点的个数。

举例:<p><xsl:value-of select="count(PERSON[name=tom])"/></p>说明:代码的用途是显示PERSON元素中姓名属性值为tom有几个。

2、number()功能作用:将属性的值中的文本转换为数值。

举例:<p>The number is: <xsl:value-of select="number(book/price)"/></p>说明:代码的用途是显示书的价格。

示例:年龄(age)小于30岁的人的简历(resume):resume[number(age)$lt$30] 或resume[age$lt$30]3、substring() 功能语法:substring(value, start, length)作用:截取字符串。

举例:<p><xsl:value-of select="substring(name, 1, 3)"/></p>说明:代码的用途是截取name元素的值,从第一个字母开始显示到第三个。

4、sum()功能作用:求和。

举例:<p>Total Price = <xsl:value-of select="sum(//price)"/></p>说明:代码的用途是计算所有价格的和。

5、end()含义:返回集合中最后一个元素。

示例:输出最后一份简历假定XML文件格式为:……<resume>…</resume>……<resume>…</resume>……相应XSL文件内容为:<xsl:for-each select="resume[end()]">……</xsl:for-each>或:<xsl:templates match="resume[end()]">……</xsl:templates>或:<xsl:apply-template select="resume[end()]">……</xsl:apply-template>6、index()含义:返回该元素在集合中的位置,返回值是一整数,其中第一个元素返回0。

SVG与CIM G矢量图形标准之间的转换方法说明书

The Conversion Method from SVG Graphics for Substation to CIM/G Graphics for IntelligentDispatchingHao RenChina Electric Power Research InstituteNanjing, China****************Xiaoqing MaNari Technology Development Limited CompanyNanjing, China**********************Abstract—Based on the research of SVG and CIM/G vector graphics standards, through the analysis and comparison of the graphics files of SVG for substation and CIM/G for intelligent dispatching, the difference and correspondence relationship of basic and power graphics elements are found out. Adopting modular design ideas and cross platform technology, using dom4j of Java xml parser to parse the element definition and each power graphics layer of SVG file for substation, hierarchical and classified metafile set of CIM/G format, graphics files of CIM/G format and graphics mapping point tables are generated, according to the mode of element type and state fusion, and graphics element mapping relationship. Proved by engineering practice, the method realizes the seamless connection from the monitoring graphics for substation to the intelligent dispatching system, and the automatic correspondence of the graphics signal points, which can shorten the time of substation graphics standardization operation greatly and reduce engineering pressure on manual point.Keywords†SVG;CIM/G;DOM4J;Vector Conversion;Seamless DockingI.I NTRODUCTIONIn order to support the operation requirements of the big run and the integration of dispatching and control, National Electric Power Dispatching Center points out the construction principles of substation system, of which refers to alarm direct transferring, remote browsing, data optimization and authentication security. It is pointed out that the substation system should have the function of remote browsing in the mode of big run obviously. Through the means of remote browsing to realize the substation panoramic information monitoring, dispatching monitor attendant or maintenance personnel needs to check the operation information of substation in detail, and can access to the motoring graphics and real-time graphics data at any time.Because of the heterogeneous graphics format supported by the dispatching and substation system, the D5000 system of intelligent dispatching platform uses CIM/G standard as the file format for graphics subsystem, but the mainstream domestic monitoring system of substation generally supports the graphics file of SVG format. So, the dispatching and substation can’t carry out graphics interaction and the function of conversion from SVG to CIM/G format needs to be achieved, which realize the unification of graphic format of the master and substation, and remove graphics heterogeneous barriers for the dispatching master browsing the monitoring graphics remotely.II.T ECHNICAL B ASISA.Substation Graphics Exchange Format Based on SVGSVG is a markup language for describing 2D graphics based on XML, the full name of which is scalable vector graphics. SVG graphics includes three parts of vector graphics, bitmap image and text. Graphics includes basic graphics and path. Although path can express all the graphics, six basic graphics of straight line, circle, ellipse, rectangle, polygon and dot are still defined in the SVG standard for painting convenience. In the aspect of image processing, two special effects of mask and filter are defined. In the aspect of text, the application features of arrangement by route, typography and embedded font are defined.The SVG graphics exchange format for substation expands the information of electrical model elements and private attribute information based on standard SVG element information. The purpose is to realize the graphics exchange between different systems, different factories and power enterprises. This standard includes system graphics, bay graphics, wiring graphics of the power plants and stations, power flow graphics and so on. Its graphics file includes file header, the definition of element and style, power equipment component layer, static text layer, measurement layer, connection layer and so on. The relation of SVG graphics and neighborhood data uses metadata to describe. Metadata is a kind of data of describing data, mainly to describe some properties of data information [1] [2].International Conference on Computer Science and Intelligent Communication (CSIC 2015)B.CIM/G Graphics Description Specification for PowerSystemThe graphics description specification for power system is a kind of plain text language based on the markup of XML standard and compatible with basic graphics format of SVG, the name of which is G language for short. G language as special graphics format for power system is a new graphics description language applied in power system, which develops from the SVG graphics exchange format of the public information platform based on CIM/XML, and aims to the problem that the public graphics exchange format based on SVG cannot express the concept of power system and model integration directly.The basic graphics element of G language inherits graphics description features and syntax rules of SVG, adopting multi-level reference mode of power equipment graphics object - > bay template - > power equipment element, and expressing and accessing power equipment information succinctly and effectively. The constituent elements of G language can be divided into basic graphics element and grid graphics element based on its type. The basic graphics element is used to draw graphics elements on the target canvas, which includes some standard shapes such as rectangle, circle, ellipse, straight line, broken line and polygon. The grid graphics element is used to express power equipment, divided into three categories including element, bay template and other mode [3].C.XML Parser DOM4JDOM4J is a XML parsing package for open source produced by , and is an easy-to-use and open source library for XML, XPath and XSLT. It is applied in java platform, adopting java framework and supporting DOM, SAX and JAXP fully. At the same time, DOM4J is a very good XML API for java, with some features of excellent performance, powerful function and easy to use.The main interfaces of DOM4J are defined in the package of org.dom4j. Among them, Node defines the polymorphic behavior for all XML nodes in Dom4j. Branch defines a communal behavior for the node that can contain child nodes like Element and Document of XML. CharacterData is a markup interface, used to identify the node based on character. The rest of the interface such as DocumentType defines the DOCTYPE statement, Entity defines XML Entity, Attribute defines the property of XML, and ProcessingInstruction defines preprocessing instruction of XML [4].III.S TRUCTURE A NALYSIS OF G RAPHICS F ILEA.File Structure of SVG FormatThe SVG format files for describing the substation monitoring graphics consist of two parts from the overall architecture. The first part is the definition of element and style, and the second part is the implementation of power graphics. The first part is contained within the <defs> element, just to define the elements referenced, not to draw and render any actual elements. The second part classifies the nodes of the various device types in the G group according to the power equipment type. Other elements not having specific equipment type are unified into Other_Layer. The <use> element can only realize the drawing and rendering of the power element. The file structure of SVG format is as shown in figure 1.Fig. 1.The file structure of SVG format.Among them, xxx_Layer includes Breaker_Layer, Disconnector_Layer, GroundDisconnector_Layer, Text_Layer, Bus_Layer, Load_Layer, Reactor_Layer, Transformer3_Layer, Transformer2_Layer, Generator_Layer, Link_Layer and Other_Layer.B.File Structure of G Language FormatG language format file adopts the three-level reference mode of power equipment graphics object - > bay template - > power equipment element. Element consists of basic graphics elements, such as line, rectangle, eclipse, circle, arc, elliptic arc, broken line, polygon, static text, pin and so on. Bay template consists of element and basic graphics element. Power equipment graphics object consists of bay, element and basic graphics element. The G language file structure of power equipment element, bay template and power equipment graphics object is as shown in figure 2. SymbolType represents the type of equipment element. Element represents equipment element. Bay represents bay. The entire monitoring graphics of power system are described through hierarchical reference.Fig. 2.The G language file structure of element, bay template and graphics.Element is comprised of line, rect, circle, pin, polygon, polyline, ellipsearc and text. Symbol is comprised of CBreaker, Disconnector, GroundDisconnector, CT, PT, Generator, Arrester, Ascoil, Capacitor, Reactor, Terminal, ACLineEnd, ACLine, Transformer3, Transformer2, Tex, DText and ConnectLine. Bay is comprised of dbo, sbo, dbus, dcb, three-quarters and two-part.IV.D ESIGN AND I MPLEMENTATION OF P ROGRAMThe input of program is SVG file, and the output are hierarchical and classified metafile set of G language, graphics files of G language and point tables for signal retransmission. The graphics transformation ideas are as below. Firstly, SVG file is parsed. Secondly, the node of defs/symbol is analyzed, and the hierarchical and classified metafile set of G language are generated according to the mode of element type and state fusion. Thirdly, the graphics files of G language are generatedaccording to the corresponding relationship of power graphics elements. At the same time, the point tables for signal retransmission are generated as the data source of graphics refreshing for remote browsing [5].The whole program is divided into three modules. The SVGParser module for parsing SVG file is responsible for parsing the element and graphics node of SVG. The GElementConverter module for generating G element file is responsible for generating the hierarchical and classified metafile set of G language. The GDisplayConverter module for generating G graphics file is responsible for generating the graphics file of G language and corresponding point table for signal retransmission. Among them, SVGParser is split into three sub modules. The sub module of Decompose is responsible for decomposing the complex attribution into some unit attributions and incorporating into the sub module of element and equipment graphics layer. The sub module of Element is responsible for parsing the node of element and generating basic graphics elements set of all elements. The sub module of Layer is responsible for parsing the node of graphics layer and generating equipment graphics elements set of all layers. The overall design framework is as shown in figure 3.Fig. 3. The overall design framwork diagram.V.E NGINEERING A PPLICATIONThe graphics conversion method proposed in this paper has been applied in some demonstration projects of remote browsing for ultra high voltage substations, such as 500kV jiupan substation in Chongqing, 500kV miaoxi substation in Zhejiang, 750kV qianxian substation in Xi’an, 500kV ciyun substation in Hebei, 500kV banqiao substation in Tianjin and so on. The SVG monitoring graphics in substation can generate CIM/G graphics file through vector graphics file conversion. Then, the CIM/G graphics file can be sent to the dispatching terminal by the transmission way of file content data block in DL476 protocol. At last, after the graphics files are reduced and displayed by the receiving module of the front of dispatching and graphics system, the graphics and data of the dispatching master browsing are the same as the graphics and data of substation. The method of graphics conversion is verified by the consistency, reaching the functional requirement of remote browsing.VI.C ONCLUSIONThe conversion method from SVG graphics for substation to CIM/G graphics for intelligent dispatching leaps over two vector graphics standards for power system. The communication bridge is erected from SVG for substation to CIM/G for the dispatching master, realizing seamless docking of two vector graphics. The graphics normalized working time of remote browsing for substation can be shortened greatly. The field engineers can be liberated from the jobs of tedious drawing, linking library and checking point. The efficiency of field consistent debugging can be improved greatly. The engineering pressure can be reduced greatly. The human, material and financial investment for the substation construction can be saved. Proved by engineering practice, the converted G language format graphics files meet the functional requirements for remote browsing completely, and under the requirements for the large maintenance system, remote operation and maintenance for substation equipment can be realized, thereby greatly improving the level of unattended substation.ACKNOWLEDGMENTThis work was financially supported by the Science and Technology Project of State Grid Corporation of China, the name of which is “The Research and Application of Key Technology for Equipment Monitoring Business Under the Mode of Large Operation” (Project No. DZ71-14-039).REFERENCES[1]HOU Yu, LI Suyou. SVG technology and its application based onXML[J]. Application Research of Computers, 2002(5): 136-138.[2]GUO Zhenhui, Qu Xiaohong, WANG Hao. Using SVG in substationgraphics[J]. Power System Technology, 2006 (30): 446-450.[3]Q/GDW 624-2011. Graphic description specification for electric powersystem[S].[4]LI Yongjun, JI Wenli, MA Guangsi. Using DOM4J to parse XMLdocument[J]. Computer Applications, 2001 (8): 103-105.[5]GAO Yanmin, JIANG Xiangang, WU Xiaolin. The design andimplementation of the conversion from the customized vector graphics to SVG format[J]. Electric Power Information Technology, 2005(4): 60-63.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Location Paths [XPath §2]Optional ‘/’, zero or more location steps, separated by ‘/’Location Steps [XPath §2.1]Axis specifier, node test, zero or more predicatesAxis Specifiers [XPath §2.2]ancestor::following-sibling::ancestor-or-self::namespace::attribute::parent::child::preceding::descendant::preceding-sibling:: descendant-or-self::self::following::Node Tests [XPath §2.3]name node()URI:name text()prefix:name comment()*processing-instruction() prefix:*processing-instruction(literal) Abbreviated Syntax for Location Paths (nothing)child::@attribute::///descendant-or-self::node()/.self::node()..parent::node()/Node tree rootPredicate [XPath §2.4][expr]Variable Reference [XPath §3.7]$qnameLiteral Result Elements [§7.1.1]Any element not in the xsl: namespace and not an extension elementXSLT/TR/xsltXPath/TR/xpathXSL-List/xsl/xsl-list/XPath OperatorsParentheses may be used for grouping.Node-sets [XPath §3.3]|[expr]///Booleans [XPath §3.4]<=, <, >=, >=, !=and orNumbers [XPath §3.5]-expr*, div, mod+, -XPath Core Function LibraryNode Set Functions [XPath §4.1]number last()number position()number count(node-set)node-set id(object)string local-name(node-set?)string namespace-uri(node-set?)string name(node-set?)String Functions [XPath §4.2]string string(object?)string concat(string, string, string*)boolean starts-with(string, string)boolean contains(string, string)string substring-before(string, string)string substring-after(string, string)string substring(string, number, number?)number string-length(string?)string normalize-space(string?)string translate(string, string, string)Boolean Functions [XPath §4.3]boolean boolean(object)boolean not(object)boolean true()boolean false()boolean lang(string)Number Functions [XPath §4.4]number number(object?)number sum(node-set)number floor(number)number ceiling(number)number round(number)XSLT and XPathQuick ReferenceXSLT Functions [§12, §15]node-set document(object, node-set?)node-set key(string, object)string format-number(number, string, string?)node-set current()string unparsed-entity-uri(string)string generate-id(node-set?)object system-property(string)boolean element-available(string)boolean function-available(string)Node Types [XPath §5]Root Processing InstructionElement CommentAttribute TextNamespaceObject Types [§11.1, XPath §1]boolean True or falsenumber Floating-point numberstring UCS charactersnode-set Set of nodes selected by a pathResult treefragmentXSLT only. Fragment of the result treeExpression Context [§4, XPath §1]Context node (a node)Context position (a number)Context size (a number)Variable bindings in scopeNamespace declarations in scopeFunction libraryBuilt-in Template Rules [§5.8]<xsl:template match="*|/"><xsl:apply-templates/></xsl:template><xsl:template match="*|/" mode="m"><xsl:apply-templates mode="m"/></xsl:template><xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template><xsl:templatematch="processing-instruction()|comment()"/>Built-in template rule for namespaces is to do nothingXSLT ElementsStylesheet Element [§2.2]<xsl:stylesheet version="1.0" id="id"extension-element-prefixes="tokens"exclude-result-prefixes="tokens"xmlns:xsl="/1999/XSL/Transform"> xsl:import*, top-level elements </xsl:stylesheet>xsl:transform is a synonym for xsl:stylesheet Combining Stylesheets [§2.6]<xsl:include href="uri-reference"/><xsl:import href="uri-reference"/>Whitespace Stripping [§3.4]<xsl:strip-space elements="tokens"/><xsl:preserve-space elements="tokens"/> Defining Template Rules [§5.3]<xsl:template match="pattern" name="qname"priority="number" mode="qname">xsl:param* followed by text, literal result elementsand/or XSL elements </xsl:template> Applying Template Rules [§5.4]<xsl:apply-templates select="node-set-exp"mode="qname"/><xsl:apply-templates select="node-set-exp"mode="qname">(xsl:sort | xsl:with-param)* </xsl:apply-templates> Overriding Template Rules [§5.6]<xsl:apply-imports/>Named Templates [§6]<xsl:call-template name="qname"/><xsl:call-template name="qname">xsl:with-param* </xsl:call-template> Namespace Alias [§7.1.1]<xsl:namespace-alias result-prefix="prefix|#default"stylesheet-prefix="prefix|#default"/> Creating Elements [§7.1.2]<xsl:element name="{qname}"namespace="{uri-reference}"use-attribute-sets="qnames">...</xsl:element>Creating Attributes [§7.1.3]<xsl:attribute name="{qname}"namespace="{uri-reference}">...</xsl:attribute>Named Attribute Sets [§7.1.4]<xsl:attribute-set name="qname"use-attribute-sets="qnames">xsl:attribute* </xsl:attribute-set>Creating Text [§7.2]<xsl:text disable-output-escaping="yes|no">#PCDATA </xsl:text>Processing Instructions [§7.3]<xsl:processing-instruction name="{ncname}">...</xsl:processing-instruction>Creating Comments [§7.4]<xsl:comment>...</xsl:comment>Copying [§7.5]<xsl:copy use-attribute-sets="qnames">...</xsl:copy>Generating Text [§7.6.1]<xsl:value-of select="string-expr"disable-output-escaping="yes|no"/>Attribute Value Templates [§7.6.2]<element attribute="{expr}"/>Numbering [§7.7]<xsl:number level="single|multiple|any"count="pattern" from="pattern"value="number-expr" format="{string}"lang="{nmtoken}"letter-value="{alphabetic|traditional}"grouping-separator="{char}"grouping-size="{number}"/>Repetition [§8]<xsl:for-each select="node-set-expr">xsl:sort*, ...</xsl:for-each>Conditional Processing [§9]<xsl:if test="boolean-expr">...</xsl:if><xsl:choose><xsl:when test="expr">...</xsl:when>+<xsl:otherwise>...</xsl:otherwise>?</xsl:choose>Sorting [§10]<xsl:sort select="string-expr" lang="{nmtoken}"data-type="{text|number|qname-but-not-ncname}" order="{ascending|descending}"case-order="{upper-first|lower-first}"/>Variables and Parameters [§11]<xsl:variable name="qname" select="expr"/><xsl:variable name="qname">...</xsl:variable><xsl:param name="qname" select="expr"/><xsl:param name="qname">...</xsl:param>Using Values [§11.3]<xsl:copy-of select="expr"/>Passing Parameters [§11.6]<xsl:with-param name="expr" select="expr"/><xsl:with-param name="expr">...</xsl:with-param>Keys [§12.2]<xsl:key name="qname" match="pattern"use="expr"/>Number Formatting [§12.3]<xsl:decimal-format name="qname"decimal-separator="char"grouping-separator="char" infinity="string"minus-sign="char" NaN="string"percent="char" per-mille="char"zero-digit="char" digit="char"pattern-separator="char"/>Messages [§13]<xsl:message terminate="yes|no">...</xsl:message>Fallback [§15]<xsl:fallback>...</xsl:fallback>Output [§16]<xsl:outputmethod="xml|html|text|qname-but-not-ncname"version="nmtoken" encoding="string"omit-xml-declaration="yes|no"doctype-public="string" doctype-system="string"standalone="yes|no" indent="yes|no"cdata-section-elements="qnames"media-type="string"/>Keyxsl:stylesheet Elementversion=Required attributeversion=Optional attribute{expr}Attribute value template. Text betweenany { and } is evaluated as anexpression. Attribute value mustevaluate to indicated attribute type.…Anything allowed in a template|Separates alternative values?Zero or one occurrences*Zero or more occurrences+One or more occurrences#PCDATA Character dataAttribute Value Types1.0Literal valueboolean-expr Expression returning boolean valuechar Single characterexpr Expressionid XML name used as identifierncname XML name not containing a colon (:)node-set-expr Expression returning a node setnumber-expr Expression returning a numberpattern XSLT patternprefix Namespace prefixqname Namespace-qualified XML namecomprising local part and optionalprefixqname-but-not-ncnameNamespace-qualified name comprisinglocal part and prefixtoken Meaning varies with context. See Rec.uri-reference Reference to Universal ResourceIdentifier。

相关文档
最新文档