180.B人事管理系统的设计与实现 翻译.doc

上传人:laozhun 文档编号:2324538 上传时间:2023-02-11 格式:DOC 页数:12 大小:49.50KB
返回 下载 相关 举报
180.B人事管理系统的设计与实现 翻译.doc_第1页
第1页 / 共12页
180.B人事管理系统的设计与实现 翻译.doc_第2页
第2页 / 共12页
180.B人事管理系统的设计与实现 翻译.doc_第3页
第3页 / 共12页
180.B人事管理系统的设计与实现 翻译.doc_第4页
第4页 / 共12页
180.B人事管理系统的设计与实现 翻译.doc_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《180.B人事管理系统的设计与实现 翻译.doc》由会员分享,可在线阅读,更多相关《180.B人事管理系统的设计与实现 翻译.doc(12页珍藏版)》请在三一办公上搜索。

1、学校代码: 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 share XML data while

2、 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 relational data to inte

3、roperate. 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 make legacy systems

4、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 well to using XML. T

5、here 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 professionals.There are situ

6、ations 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.Additionally, if you do no

7、t 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 XML data and perfor

8、m 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 scenario when you are

9、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 some things that

10、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 available through the

11、 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 directly from withi

12、n 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 to transform XML d

13、ocuments 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 chapter.During t

14、he 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 document is left unalter

15、ed 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, and XSLT stylesh

16、eets 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 mentioned previou

17、sly, 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 requires you to crea

18、te 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 be implementing

19、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 option in the databas

20、e, 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 samples for this book

21、, 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. Note that if yo

22、u 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, installs the assembly o

23、n 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 scripts to insta

24、ll 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 through Visual St

25、udio 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 functions that support

26、 .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 2000, the W3C qu

27、ickly 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 speaking, attributes pl

28、ayed 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 favor of the mor

29、e 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.The HTML body con

30、tains 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 source XML documen

31、t. 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 actually /Individual-C

32、ustomer-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, in this instance,

33、 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 back-end use.Consid

34、er 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 their ordering syst

35、ems 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 XML orders can arr

36、ive 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 and choosing a s

37、eemingly 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 fields.XSLT, on the o

38、ther 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 two XML orders in

39、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, XQuery, and Extens

40、ible 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, and HTTP provid

41、es 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 methods using SOAP. U

42、sing 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 Internet Information S

43、ervices (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 endpoints and how

44、 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 yet on why, but it

45、s 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: I decided to re

46、tain 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 alternative methods of exp

47、osing 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-6译文:专业 SQL Server2008 XMLSQL Server 2008年的本土XML操纵和查询的设施是特别有用的,在下列情形之一:你想利用SQL服务器控制XML数据的能力。你想利用SQL服务器的备份功能进行备份,恢复,或复制你的XML数据。你要确定你的

48、服务器端的XML数据是有效和规范的。你希望你的XML用关系型数据来实现。你想利用SQL服务器的XPath功能。你想要优化您查询XML数据使用索引和SQL查询优化。XML是一份特别好的选择作为交流的松散耦合系统的格式或者当试图让遗留系统与现代服务器。它也是一个优秀的选择时,可广泛应用于各种存储数据,试图利用数据放在一个改过格式,如文档管理和演示应用程序。建模小于数据在一个特设时尚也只用来使用XML。有许多标准的应用已定义为XML的几乎每一个行业,所以XML经常是一个不错的选择当标准的通信格式和数据共享高优先权。无论什么时候使用XML的主题在SQL Server专业人士中。有些情况XML不是最好的工具来工作,包括:你的数据结构密集,最重要的是你顺序数据,你不会想查询数据基于结构,你的数据是最能代表使用实体参数,另外,如果你不打算查询或者控制你的XML数据,但是SQL服务器只是想存储和检索它,你应该用varchar或你的数据类型代替SQL服务器的xml数据类型。这是最常见的情况时,你只需使用SQL服务器一个存储库外到目前为止,我已经覆盖了不少地讨原始的SQL Server 2008 XML的功能。然而,有些东西不是由本地办理SQL。xml数据类型的SQL服务器增强。利用扩展样式表语言转换XSLT的功能。XSLT是W3C推荐使用的一种语

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号