EJB3的XML Schema第一讲

在XML Schema 中的注释规定了XML Schema 机制不方便表达的语法和语义的要求。
XML 元素的内容通常都是大小写敏感的(也就是说,除非另有说明)。意思是,例如,必须使用<transaction-type>Container</transaction-type>而不是<transaction-type>container</transaction-type>
所有有效的ejb-jar 部署描述必须遵循下面的XML Schema 定义,或本规范以前版本的DTD 定义。

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://java.sun.com/xml/ns/javaee"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="3.0">
<xsd:annotation>
<xsd:documentation>
@(#)ejb-jar_3_0.xsds1.51 02/23/06
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
Copyright 2003-2006 Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, California 95054
U.S.A
All rights reserved.
Sun Microsystems, Inc. has intellectual property right srelating to technology
described in this document. In particular, and without limitation, these intellectual
property rights may include one or more of the U.S. patents listed at
http://www.sun.com/patents and one or more additional patents or pending patent
applications in the U.S. and other countries.
This document and the technology which it describes are distributed under
licenses restricting their use, copying, distribution, and decompilation. No part of this
document may be reproduced in any form by any means without prior written
authorization of Sun and its licensors, if any. Third-party software, including font
technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems,
the Sun logo, Solaris, Java, J2EE, JavaServer Pages, Enterprise JavaBeans and the
Java Coffee Cup logo are trademarks or registered trademarks of Sun Microsystems,
Inc. in the U.S. and other countries. Federal Acquisitions: Commercial Software -
Government Users Subject to Standard License Terms and Conditions.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
<![CDATA[
部署描述必须在EJB jar 文件中命名为"META-INF/ejb-jar.xml"。所有的EJB部署描述必须通过使用Java EE 命名空间http://java.sun.com/xml/ns/javaee 来声明ejb-jar schema,并且应当按如下所示声明schema 的版本:
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
version="3.0">
...
</ejb-jar>
实例文档可以使用xsi:schemaLocation 属性为具有如下位置的Java EE 命名空间声明schema 的印刷版本: http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
下面的约定应用于所有的Java EE 部署描述元素,除非有其他说明。在元素中指定同一个JAR 文件中文件的路径名(也就是,那些不以“/”开头的路径名)认为是相对于JAR 文件命名空间。绝对文件名(也就是以“/”开头)指的是JAR 文件命名空间的根路径中的名字。通常,相对名字是最好的方式。例外情况是,为了与Servlet API 一致,在.war 文件中使用绝对名字是最好的。
</xsd:documentation>
</xsd:annotation>
<xsd:include schemaLocation="javaee_5.xsd"/>
<!-- **************************************************** -->
<xsd:element name="ejb-jar" type="javaee:ejb-jarType">
<xsd:annotation>
<xsd:documentation>
这是ejb-jar 部署描述的根.

你可能感兴趣的:(java,xml,javaee,ejb,sun)