中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > Java > Java与XML
XML Schema May Not Always Be the Right Tool for the Job @ JDJ
作者:未知 时间:2005-08-10 19:02 出处:Java频道 责编:chinaitpower
              摘要:XML Schema May Not Always Be the Right Tool for the Job @ JDJ

Will many of the features in XML Schema be widely used? In particular, I agree that it is better to have an XML language for specifying document layout rather than the DTD language. On the other hand, I am not sure that the document layout should be strongly typed. The nightmare scenario is where a customer cannot place a large order because an XML document is invalid. Assume a company has an average order size of $50,000 dollars with a current order range of $3,000 to $220,000. It would be reasonable to set a criterion in the Purchase Order Schema for this company to set a total order rage of Zero to One Million. At some point in the future, after price increases and business changes, a large customer may place an order for $1,020,000. The Purchase Order document would be rejected as invalid.

Having been involved with Markup since the middle 1980s, I have seen it go through many changes and variations, from GML to SGML to XML. Many specific markup languages such as HTML have been developed. During this time, there has always been a balancing act of content definition vs. content presentation. Most but not all markup languages were defined for presentations purposes. HTML is one of the most widely deployed presentation languages.

Content-only languages are rarer and more specialized. For example, the XML-based languages defined by the RosettaNet effort and many other eCommerce activities are focused on content. In these cases, domain-specific knowledge tends to influence the definition of the markup. For example, a purchase order for the Electronics Parts industry would include information about packaging, environmental limits, and electrical specifications.

On the other hand, a purchase order for the Bulk Chemical industry might include information about purity levels, manufacturing process, and material safety.

It is natural to desire to place validation criteria along with the structure of the documents. For example, if there is a field called Date Required, you would want to make sure it is a valid date. This will ensure that only documents with valid dates are accepted. This leads to document definitions that are very well constrained. From a receiving viewpoint, this is great because it makes sure that all documents are well defined and well organized.

The picture from the sending side is more complex. The sending company may not have a specific date on which the order is required. They may want to say any time in June. There are infinite variations on this. So, do we want to reject entire orders because they cannot meet one specific criterion? It would seem to be better to treat all fields as text, process any orders that meet criteria, and put those that do not in a work queue.

Another concern is that there are limits to what can be validated on an XML document. While it is possible to set dates and such, it would not be reasonable to check for valid product codes, authorization to order, contractual ordering requirements, and so on. Therefore, some of the validation could end up in the XML and some in the back-end processing. A worst-case scenario here is that the validations are inconsistent.

In any complex system, structured data will exist on disk, on a screen or report, in memory as a business object, or in transmission as a business document. Business documents have been verbal, paper, EDI, and most recently, XML. When two cooperating organizations are communicating through business documents, they both need a flexible mechanism to communicate. It seems to me that putting validation in the Schema for an XML document does not allow for this flexibility.

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有