版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、xxx工业大学本科毕业设计外文文献学校代码: xxx学 号:xxx 本科毕业设计外文文献翻译( 学生姓名:xxx学 院:信息工程学院系 别:计算机系专 业:软件工程班 级:软件06班指导教师:xxx 讲师本文源码索取,请联系qq:68661508二 一 年 六 月pro sql server2008 xmlsql server 2008s native xml manipulation and querying facilities are particularly usefulin the following situations: you want to manipulate or sha
2、re xml data while taking advantage of sql serverstransactional capabilities. you want to take advantage of sql servers administrative functionality to back up,recover, or replicate your xml data. you need to ensure that your server-side xml data is valid and well-formed. you want your xml and relati
3、onal data to interoperate. you want to take advantage of sql servers xquery and xpath capabilities. you want to optimize your queries of xml data using indexes and sql servers query optimizer.xml is a particularly good choice as a communication format for loosely coupled systemsor when trying to mak
4、e legacy systems communicate with modern servers. its also an excellentchoice when storing data for applications that lend themselves to using data in a marked-upformat, such as document management and presentation applications. modeling semistructured data in an ad hoc fashion also lends itself wel
5、l to using xml. there are many standard applications for xml already defined in almost every industry, so xml is often an excellent choice when standard communication formats and data sharing are high priorities.whether, and when, to use xml is the subject of much debate among sql server professiona
6、ls.there are situations where xml is not the best tool for the job, including the following: your data is highly structured and dense (non-sparse). order is unimportant to your data. you do not want to query data based on its structure. your data is best represented using entity references.additiona
7、lly, if you do not intend to query or manipulate your xml data on sql server, but just want to store and retrieve it, you should use the varchar or nvarchar data types instead of sql servers xml data type. this is most often the case when you simply use sql server as a storage repository for your xm
8、l data and perform all your xml querying and manipulation in the middle tier or in a client-side application. also store your xml data as varchar or nvarchar if you need to store it exactly, as a character-for-character copy, for auditing purposes or for regulatory compliance. this is a common scena
9、rio when you are storing data about digital financial transactions, and you need to maintain an audit trail of the transactions but do not need to manipulate or query the data in the xml.so far ive covered quite a lot of ground discussing native sql server 2008 xml function ality.however, there are
10、some things that arent covered by the native transact sql (t-sql) and xml data type enhancements in sql server. using extensible stylesheet language transformations(xslt) functionality is one area where you have to go outside of the built-in t-sql functionality and access the .net functionality avai
11、lable through the sqlclr (sql common language runtime).xslt is a w3c recommendation for a language for transforming xml documents into other xml documents. in this chapter, i will talk about the w3c xslt recommendation and the sqlclr functionality that will enable you to access xslt functionality di
12、rectly from within sqlserver.xslt gives you the ability to take an xml document as input, add or remove attributes,rearrange and sort elements, manipulate content, and make processing decisions based on the results of node tests and other logical constructs. one of the most common uses for xslt is t
13、o transform xml documents into xhtml for presentation on the client tier. another common use in the back end is to take xml data from different sources and convert it to a commonformat. ill discuss both of these uses for xslt and demonstrate performing xsl transformations directly from t-sql in this
14、 chapter.during the xsl transformation process, an input xml document and an xslt stylesheet are both fed into an xslt processor. the xslt processor uses the xslt stylesheet to manipulate the contents of the xml document fed into it to produce the xml result document. the original source xml documen
15、t is left unaltered by the process, with all transformations being outputto a new xml document.xslt uses xpath to locate, navigate, and perform node tests in the source document.xpath is also the foundation for xquery path expressions, which i talked about in chapter 5.xslt is a functional language,
16、 and xslt stylesheets are xml documents that are composed of templates. xslt stylesheet templates, in turn, are built from predefined xslt elements.i will talk about how to create your own xslt stylesheets in this chapter, but first i will address amore immediate issueaccessing xslt from t-sql.as i
17、mentioned previously, t-sql does not provide built-in support for xslt. the .net framework, however, offers an excellent xslt transformation facility via its system.xml.xsl namespace. fortunately, you can easily access this .net framework functionality through sqlservers sqlclr integration. this req
18、uires you to create and register a .net assembly and create t-sql functions and procedures to access the functionality exposed by the assembly. before i get into the details of sqlclr assembly creation and deployment, i need to do a little administrative work to ensure sqlclr is enabled. i will also
19、 be implementing some functionality that creates xml files in the file system.sqlclr assemblies need the external access level of security in order to access the file system.to allow this functionality, you need to make sure the database is set to trustworthy mode。after youve enabled the sqlclr opti
20、on in the database, set the database to trustworthy mode, andgranted external access assembly permissions to the principal, as described in this section, its time to compile and deploy the assembly. the source code for the assemblies used in the examples in this book is included in the download samp
21、les for this book, available from the apress web site at to compile and deploy a sqlclr sample, open the appropriate visual studio solution file in visual studio. once you have opened the solution, you will need to change the database connection string in the database properties page of the solution
22、. note that if you are using visual studio 2005,deploying to sql server 2008 requires you to download and install a patch from microsofts web site at .once youve changed the database connection string for the assembly, choose the deploy option on the build menu. this option compiles the code, instal
23、ls the assembly on the server, and creates the t-sql user-defined functions and stored procedures necessary to access the sqlclr functionality. once youve deployed the code to the server, you can access the procedures and functions through sql server managementstudio (ssms). alternatively, the t-sql
24、 scripts to install the precompiled assemblies, functions, and procedures are included with the sample downloads. this is useful if you want to install the sample sqlclr code without compiling and deploying it yourself through visual studio.in the example for this section, deploying the sample code
25、through visual studio or running the t-sql installation scripts in ssms will install the sqlclr assembly, procedures, and functions, including fn_xslttransform and p_xslttransformtofile.the assembly itself is written in c# and compiled with visual studio 2005. ill start by creatingsome private funct
26、ions that support .net xsl transformation。the sqlclr user-defined functions and stored procedures ill create in this section will relyheavily on these support functions.in 1999, the w3c approved the html 4.01 specification for web-based publishing (this recommendation is commonly known as html4). in
27、 2000, the w3c quickly followed up with the xhtml (extensible html) standard,which redefines html as an xml application. during this same time, vendors were just starting to get serious about implementing the 1996 w3c recommendation for css functionality in their browser products.historically speaki
28、ng, attributes played a key role in html formatting. all the way up to html4, there is a heavy reliance on attributes to specify colors, borders, spacing, position, and just about every other formatting option supported by html. with the adoption of xhtml, most of these attributes were deprecated in
29、 favor of the more powerful and flexible css model. in an attempt to follow modern user interface coding standards,ive used css and generated properly formed html in the examples of this chapter. all html results have been tested for standards conformance in both internet explorer 6 and firefox 2.0.
30、the html body contains the first xsl-applied transformation, which is an xsl:value-of element in the header. the select attribute can take a literal value or an xpath expression, which provides the value to insert into the result document. in this instance, i specified the country element from the s
31、ource xml document. recall that i specified the /individual-customer-summary xpath expression for this templates match attribute expression, so the path that i specify in this xsl:value-of element is relative to /individual-customer-summary. this means the full path to this specific element is actua
32、lly /individual-customer-summary/country.i also define the two-column html table that will display the formatted results.this next example will demonstrate performing what i call a “back-end” xsl transformation.while technically all xsl transformations performed on sql server occur in the back end,
33、in this instance, im referring to the target of the transformation. the most common type of xsl transformation is probably transforming xml documents to a presentation-layer format like html, but xslt is also useful for taking xml data in varying formats and transforming it to a common format for ba
34、ck-end use.consider a situation where you receive customer orders in xml format from different sources. these sources might be different web sites that sell your products, brick-and-mortar retailers, government agencies, or combinations of these. trying to convince all of your customers to change th
35、eir ordering systems to send you orders in a common format might be an uphill battle, but thats ok because you can transform the data you receive into your own standard format using xslt. for this example, ill assume that adventureworks accepts xml orders from customers. ill also assume that those x
36、ml orders can arrive in different xml formats,but the back-end processing requires a single common format.in the old days when ansi x12 electronic data interchange (edi) was the only way to transfer electronic orders, buyers and sellers essentially created their own custom data structures by picking
37、 and choosing a seemingly random set of records from a very large all-encompassingstandard. to deal with all the different source data structures, you either had to create multiple complex parsers by hand or buy expensive software that mapped edi transaction records to output files and database fiel
38、ds.xslt, on the other hand, allows you to quickly and easily create stylesheets that convert.xml source data from different sources into a common format. in the example for this section,im going to convert orders from two different customers into a common structure using xslt.ill begin by creating t
39、wo xml orders in listing 8-8, one from a customer called acme retailers and a second from xyz bike repair. these orders have different structures that ill eventually convert to the common format.ive covered a wide variety of sql serverbased xml tools so far, including the xml data type,xml schema, x
40、query, and extensible stylesheet language transformations (xslt). in addition to all this xml functionality, sql server also provides support for xml-based simple object.access protocol (soap) endpoints over hypertext transfer protocol (http). soap provides the ability to serialize objects using xml
41、, and http provides the communication protocol to send and receive soap-based objects. in a nutshell, this means that you can use a sql server instance directly as a web service server. sql server provides built-in support for exposing stored procedures and user-defined functions as web service meth
42、ods using soap. using http soap endpoints, you can access these exposed stored procedures and functions remotely with minimal effort.sql server 2005 introduced http soap endpoints, which proved to be a significant advance over the sql server 2000 model. sql server 2000 relied heavily on legacy inter
43、net information services (iis) and component object model (com)-based objects for providing web service support to sql server. sql server 2008 continues support for the simpler and more secure sql server 2005 soap endpoint model. in this chapter, i will discuss how to set up and configure http soap
44、endpoints and how to access them from your client applications.back in sql server 2005, microsoft introduced http soap endpoints to expose server-side stored procedures and user-defined functions as web methods. with sql server 2008, http soap endpoints have been deprecated.theres no official word y
45、et on why, but its a good guess that database administrator feedback concerning potential security issues played a big part in the decision. as of the time of this writing, theres no official word on the deprecation other than the following message youll receive when you create an http soap endpoint
46、: i decided to retain this chapter after finding out about the deprecation of this feature because some will need to provide ongoing support and migration for sql server 2005 applications that currently use http soap endpoints. as the error message suggests, however, you should plan to use alternati
47、ve methods of exposing your data and sql server functionality and plan to move away from http soap endpoints as soon as possible.author: michael colesfrom: pro sql server 2008 xml page1-610译文:专业 sql server2008 xmlsql server 2008年的本土xml操纵和查询的设施是特别有用的,在下列情形之一:你想利用sql服务器控制xml数据的能力。你想利用sql服务器的备份功能进行备份,恢
48、复,或复制你的xml数据。你要确定你的服务器端的xml数据是有效和规范的。你希望你的xml用关系型数据来实现。你想利用sql服务器的xpath功能。你想要优化您查询xml数据使用索引和sql查询优化。xml是一份特别好的选择作为交流的松散耦合系统的格式或者当试图让遗留系统与现代服务器。它也是一个优秀的选择时,可广泛应用于各种存储数据,试图利用数据放在一个改过格式,如文档管理和演示应用程序。建模小于数据在一个特设时尚也只用来使用xml。有许多标准的应用已定义为xml的几乎每一个行业,所以xml经常是一个不错的选择当标准的通信格式和数据共享高优先权。无论什么时候使用xml的主题在sql serve
49、r专业人士中。有些情况xml不是最好的工具来工作,包括:你的数据结构密集,最重要的是你顺序数据,你不会想查询数据基于结构,你的数据是最能代表使用实体参数,另外,如果你不打算查询或者控制你的xml数据,但是sql服务器只是想存储和检索它,你应该用varchar或你的数据类型代替sql服务器的xml数据类型。这是最常见的情况时,你只需使用sql服务器一个存储库外到目前为止,我已经覆盖了不少地讨原始的sql server 2008 xml的功能。然而,有些东西不是由本地办理sql。xml数据类型的sql服务器增强。利用扩展样式表语言转换xslt的功能。xslt是w3c推荐使用的一种语言转换xml文档
50、转换成另一个xml文件。在这一章中,我将讨论w3c推荐和xslt sqlclr功能,而且会让你进入xslt的功能直接从在sql服务器。xslt让你能拿一份xml文档作为输入,添加或删除属性,排列和分类元素、操纵含量,使处理决定测试的结果和其他的逻辑建构节点。最常见的一种,用xslt是xml文档转换成xhtml的表现给客户。另一种普遍使用在后台是xml数据,从不同的来源,将它转换成一个常见的格式。我还将讨论这些使用xslt和示范表演xsl的转变。在本章中,直接从t-sql转型过程中,输入xsl样式表和一个合适的xml文档输入一个xslt处理器都。xslt处理器使用xslt的样式的操控xml文档的
51、内容注入了它产生的xml文档。结果原xml文档的来源是左原封不动地,所有的转变过程中被输出去一个新的xml文档。xslt的使用xpath定位、导航、演出节点试验在源文件。xpath也是基础路径表达式,就是我用到谈论在第5章中讨论。xslt是功能性的语言,和xslt的样式表是xml文件组成模板。xslt的样式表的模板,反过来,建立从预定义的xslt元素。我要谈谈如何创建自己的xslt的样式表在本章中,但是首先我要使用xslt访问.net。当我之前提到的,t-sql并不提供支持xslt内置.net框架,然而,提供了极好的xslt转换装置system.xml.xsl通过它命名空间。幸运的是,你可以很
52、容易地找到这.net框架功能通过sql服务器的sqlclr一体化。这需要你创建和注册一个.net的用户。t-sql功能和程序访问功能暴露出来的装配。之前,我得到的细节sqlclr装配创造和部署,我需要做一个小管理工作以确保sqlclr被激活。我也会被执行某些功能,创造了xml文件系统中的文件。sqlclr组件需要外部访问的安全等级,为了获取文件系统。让这一功能,你需要确定数据库是值得信赖的模式。在你已经使sqlclr选项在数据库中,设置了数据库,值得信赖的方式,以及外部访问权限授予总成,如在这一大段的描述中,它的时间编制和部署总成。源代码为所采用的总成的例子,在这本书包括在下载样本对这本书,网址 sourcecode。编写和部署sqlclr样品,打开合适的视觉工作室的解决方案文件在视觉工作室。一旦你已经打开了存储器,你需要改变结果一样。数据库连接字符串中属性页的解决方案。2005年,部署在sql server 2008需要下载和安装补丁从微软的网站。一旦你已经改变了结果,数据库连接字符串集合,选择配
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年汽车电子产品项目投资申请报告代可行性研究报告
- 系绳物体的浮力问题-2023年中考物理复习讲练(原卷版)
- 知识产权保护承诺书
- 美丽的颐和园导游词(33篇)
- 物流运输车辆租赁合同(35篇)
- 粗砂垫层试验段的施工方案及试验段总结
- 23.1 平均数与加权平均数 同步练习
- 天津市南开区2024-2025学年七年级上学期11月期中道德与法治试题(含答案)
- 2024年建筑电工(建筑特殊工种)考试试题题库
- 黑龙江省大庆市肇源县联盟学校2024-2025学年七年级上学期11月期中生物试题(含答案)
- 2024年宏观经济发展情况分析报告
- 摄影入门课程-摄影基础与技巧全面解析
- 251直线与圆的位置关系(第1课时)(导学案)(原卷版)
- XX有限公司人员分流方案
- 大语言模型赋能自动化测试实践、挑战与展望-复旦大学(董震)
- 期中模拟检测(1-3单元)2024-2025学年度第一学期西师大版二年级数学
- 追觅科技在线测评逻辑题
- 2025年广东省高中学业水平考试春季高考数学试题(含答案解析)
- 2024年重庆市渝北区数据谷八中小升初数学试卷
- 凝中国心铸中华魂铸牢中华民族共同体意识-小学民族团结爱国主题班会课件
- 2024年AI大模型场景探索及产业应用调研报告-前瞻
评论
0/150
提交评论