author | mkos |
Mon, 26 May 2014 14:59:14 +0200 | |
changeset 24599 | 039c0ea8c5c6 |
parent 24598 | 6203ccb62532 |
child 24600 | c84491c8dcc6 |
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.xml.internal.ws.spi.db.BindingContextFactory Fri May 23 16:25:43 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -com.sun.xml.internal.ws.db.glassfish.JAXBRIContextFactory -# com.sun.xml.internal.ws.db.toplink.JAXBContextFactory
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/config.rng Fri May 23 16:25:43 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -<?xml version="1.0"?> -<!-- - Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - This code is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 only, as - published by the Free Software Foundation. Oracle designates this - particular file as subject to the "Classpath" exception as provided - by Oracle in the LICENSE file that accompanied this code. - - This code is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - version 2 for more details (a copy is included in the LICENSE file that - accompanied this code). - - You should have received a copy of the GNU General Public License version - 2 along with this work; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - or visit www.oracle.com if you need additional information or have any - questions. ---> - -<grammar - xmlns="http://relaxng.org/ns/structure/1.0" - xmlns:r="http://relaxng.org/ns/structure/1.0" - xmlns:a="http://relaxng.org/ns/annotation/1.0" - xmlns:ref="urn:crossreference" - xmlns:c="http://www.xml.gr.jp/xmlns/relaxngcc" - c:runtime-type="com.sun.tools.internal.jxc.NGCCRuntimeEx" - datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" - c:package="com.sun.tools.internal.jxc.gen.config"> - - -<start c:class="Config" c:access="public"> - - <c:java-import> - import java.util.List; - import java.util.ArrayList; - import java.io.File; - </c:java-import> - -<c:java-body> - private File baseDir; - private Classes classes; - private List schema = new ArrayList(); - public Classes getClasses() { return this.classes;} - public File getBaseDir() { return baseDir;} - public List getSchema() { return this.schema;} -</c:java-body> - - <element name="config"> - <attribute name="baseDir"> - bd = <data type="string"/> - baseDir = $runtime.getBaseDir(bd); - </attribute> - <ref name="Classes" c:alias="classes"/> - <zeroOrMore> - <ref name="Schema" c:alias="_schema" />(baseDir); - this.schema.add (_schema); - </zeroOrMore> - </element> - </start> - - - <define name="Classes" c:access="public"> - <c:java-import> - import java.util.List; - import java.util.ArrayList; - </c:java-import> - <c:java-body> - private List includes = new ArrayList(); - public List getIncludes() { return $runtime.getIncludePatterns(this.includes);} - private List excludes = new ArrayList(); - public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);} - </c:java-body> - <element name="classes"> - - <element name="includes"> - <list> - <oneOrMore> - <data type="string" c:alias="include_content"/> - <c:java> this.includes.add(include_content); </c:java> - </oneOrMore> - </list> - - </element> - <optional> - <element name="excludes"> - <list> - <zeroOrMore> - <data type="string" c:alias="exclude_content"/> - <c:java> this.excludes.add(exclude_content); </c:java> - </zeroOrMore> - </list> - - </element> - </optional> - </element> - </define> - - - <define name="Schema" c:access="public" c:params="File baseDir"> - <c:java-import> - import java.io.File; - </c:java-import> - <c:java-body> - private File location; - private String namespace; - public String getNamespace() { return this.namespace;} - public File getLocation() { return this.location;} - </c:java-body> - <element name="schema"> - <optional> - <attribute name="namespace"> - namespace = <data type="string" /> - </attribute> - </optional> - - <optional> - <attribute name="location"> - loc = <data type="string" /> - location = new File(baseDir,loc); - </attribute> - </optional> - </element> - </define> -</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng Fri May 23 16:25:43 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,317 +0,0 @@ -<?xml version="1.0"?> -<!-- - Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - This code is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 only, as - published by the Free Software Foundation. Oracle designates this - particular file as subject to the "Classpath" exception as provided - by Oracle in the LICENSE file that accompanied this code. - - This code is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - version 2 for more details (a copy is included in the LICENSE file that - accompanied this code). - - You should have received a copy of the GNU General Public License version - 2 along with this work; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - or visit www.oracle.com if you need additional information or have any - questions. ---> - -<!-- -DTD binding information file which is supported by this version of XJC. - -- Changes from the EA1 is marked by "CHANGE:" -- "ref:key" and "ref:keyref" are used to specify cross-reference - information. -- "a:defaultValue" is used to specify the default behavior. - Note that default behaviors are hard-coded to the source code. - Values specified in this schema is not used in the actual processing. ---> -<grammar - xmlns="http://relaxng.org/ns/structure/1.0" - xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" - xmlns:a="http://relaxng.org/ns/annotation/1.0" - xmlns:ref="urn:crossreference" - datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> - - <start> - <element name="xml-java-binding-schema"> - <optional> - <attribute name="version"> - <value>1.0ea2</value> - </attribute> - </optional> - - <interleave> - <optional> - <element name="options"> - <optional> - <attribute name="package"/> - </optional> - </element> - </optional> - <optional> - <element name="xjc:serializable"> - <optional> - <attribute name="uid"> - <data type="long"/> - </attribute> - </optional> - </element> - </optional> - <optional> - <element name="xjc:superClass"> - <attribute name="name"/> - </element> - </optional> - <!-- light-weight runtime --> - <optional> - <element name="xjc:noMarshaller"> - <empty/> - </element> - </optional> - <optional> - <element name="xjc:noUnmarshaller"> - <empty/> - </element> - </optional> - <optional> - <element name="xjc:noValidator"> - <empty/> - </element> - </optional> - <optional> - <element name="xjc:noValidatingUnmarshaller"> - <empty/> - </element> - </optional> - <zeroOrMore> - <choice> - <ref name="toplevel.declaration"/> - <ref name="global.or.local.declaration"/> - </choice> - </zeroOrMore> - </interleave> - </element> - </start> - - - - - <!-- element-class declaration --> - <define name="toplevel.declaration" combine="choice"> - <element name="element"> - <attribute name="name"/> - <attribute name="type"> - <value>class</value> - </attribute> - <optional> - <attribute name="class"> - <ref name="java.classname.datatype"/> - </attribute> - </optional> - <optional> - <attribute name="root" a:defaultValue="false"> - <choice> - <value>true</value> - <value>false</value> - </choice> - </attribute> - </optional> - - <interleave> - <!-- attribute-property declaration --> - <zeroOrMore> - <element name="attribute"> - <attribute name="name"/> - <optional> - <attribute name="property"/> - </optional> - <optional> - <ref name="collection.att"/> - </optional> - <optional> - <attribute name="convert"> - <text ref:keyref="conversion"/> - </attribute> - </optional> - </element> - </zeroOrMore> - - <zeroOrMore> - <ref name="global.or.local.declaration"/> - </zeroOrMore> - - <!-- element-local declarations --> - <zeroOrMore> - <element name="constructor"> - <attribute name="properties"> - <list> - <oneOrMore> - <!-- point to a property defined in this element --> - <data type="token"/> - </oneOrMore> - </list> - </attribute> - </element> - </zeroOrMore> - - <optional> - <element name="content"> - <interleave> - <choice> - <!-- general content-property declaration --> - <ref name="collection.particle.decl"/> - - <!-- model-based content property declaration --> - <group> - <zeroOrMore> - <choice> - <element name="element-ref"> - <attribute name="name"/> - <optional> - <attribute name="property"/> - </optional> - <optional> - <ref name="collection.att"/> - </optional> - </element> - <element> - <choice> - <name>sequence</name> - <name>choice</name> - </choice> - <ref name="collection.particle.decl"/> - </element> - </choice> - </zeroOrMore> - <optional><!-- followed by an optional <rest> --> - <element name="rest"> - <ref name="collection.particle.decl"/> - </element> - </optional> - </group> - </choice> - </interleave> - </element> - </optional> - </interleave> - </element> - </define> - - <define name="collection.particle.decl"> - <attribute name="property"/> - <optional> - <ref name="collection.att"/> - </optional> - <optional> - <attribute name="supertype"/> - </optional> - </define> - - <define name="collection.att"> - <attribute name="collection"> - <!-- CHANGE: array is removed and set,vector are added --> - <choice> - <value>list</value> - <value>set</value> - <value>vector</value> - </choice> - </attribute> - </define> - - - - <!-- conversion declaration --> - <define name="global.or.local.declaration" combine="choice"> - <element name="conversion"> - <attribute name="name" ref:key="conversion"/> - <optional> - <!-- defaults to @name --> - <attribute name="type"/> - </optional> - <optional> - <attribute name="parse" a:defaultValue="new"/> - </optional> - <optional> - <attribute name="print" a:defaultValue="toString"/> - </optional> - <optional> - <attribute name="whitespace" a:defaultValue="collapse"> - <choice> - <value>preserve</value> - <value>replace</value><!-- CHANGE: it was normalize --> - <value>collapse</value> - </choice> - </attribute> - </optional> - </element> - </define> - - <!-- element-value declaration --> - <define name="toplevel.declaration" combine="choice"> - <element name="element"> - <attribute name="name"/> - <attribute name="type"> - <value>value</value> - </attribute> - <optional> - <attribute name="convert"> - <text ref:keyref="conversion"/> - </attribute> - </optional> - </element> - </define> - - <!-- interface declaration --> - <define name="toplevel.declaration" combine="choice"> - <element name="interface"> - <attribute name="name"> - <ref name="java.classname.datatype"/> - </attribute> - <attribute name="members"> - <list> - <oneOrMore> - <ref name="java.classname.datatype"/> - </oneOrMore> - </list> - </attribute> - <!-- CHANGE: TODO: @properties is not supported yet --> - </element> - </define> - - <!-- enumeration declaration --> - <define name="global.or.local.declaration" combine="choice"> - <element name="enumeration"> - <attribute name="name"> - <ref name="java.classname.datatype"/> - </attribute> - <attribute name="members"> - <list> - <oneOrMore> - <data type="token"/> - </oneOrMore> - </list> - </attribute> - </element> - </define> - - - - <!-- valid Java name --> - <define name="java.name.datatype"> - <!-- TODO: add pattern facet or implement a custom datatype --> - <data type="token"/> - </define> - - <define name="java.classname.datatype"> - <ref name="java.name.datatype"/> - </define> -</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng Fri May 23 16:25:43 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,913 +0,0 @@ -<?xml version="1.0"?> -<!-- - Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - This code is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 only, as - published by the Free Software Foundation. Oracle designates this - particular file as subject to the "Classpath" exception as provided - by Oracle in the LICENSE file that accompanied this code. - - This code is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - version 2 for more details (a copy is included in the LICENSE file that - accompanied this code). - - You should have received a copy of the GNU General Public License version - 2 along with this work; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - or visit www.oracle.com if you need additional information or have any - questions. ---> - -<!DOCTYPE grammar [ - - -<!ENTITY XJCURI "http://java.sun.com/xml/ns/jaxb/xjc"> -]> -<grammar - xmlns="http://relaxng.org/ns/structure/1.0" - xmlns:cc="http://www.xml.gr.jp/xmlns/relaxngcc" - xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:xjc="&XJCURI;" - xmlns:p="post-processor-to-build-schema-for-validation" - - ns="http://java.sun.com/xml/ns/jaxb" - - cc:runtime-type="com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.NGCCRuntimeEx" - cc:package="com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.parser" - datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> -<!-- cc:$runtime-type="com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx">--> - - <cc:java-import> - import com.sun.codemodel.internal.*; - import com.sun.tools.internal.xjc.generator.bean.field.*; - import com.sun.tools.internal.xjc.model.*; - import com.sun.xml.internal.bind.api.impl.NameConverter; - import com.sun.xml.internal.bind.v2.WellKnownNamespace; - import com.sun.xml.internal.bind.marshaller.SAX2DOMEx; - import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.*; - import com.sun.tools.internal.xjc.reader.Const; - import org.xml.sax.*; - import org.w3c.dom.Document; - import org.xml.sax.helpers.DefaultHandler; - import java.util.*; - import javax.xml.namespace.QName; - import javax.xml.parsers.ParserConfigurationException; - </cc:java-import> - - <start cc:class="Root"> - <choice> - <!-- root of the external binding file. --> - <ref name="declaration"/> - <!-- root of the internal binding --> - <ref name="annotation"/> - </choice> - </start> - - <!-- - in context of XML Schema annotation - --> - <define name="annotation" cc:access="public" cc:class="AnnotationState" - cc:return-type="BindInfo" cc:return-value="bi"> - - <cc:java-import> - import java.io.StringWriter; - import com.sun.xml.internal.bind.marshaller.DataWriter; - </cc:java-import> - <cc:java-body> - // customization declarations - public BindInfo bi; - - private StringWriter w; - - private SAX2DOMEx sax2dom; - </cc:java-body> - - <element name="xs:annotation"> - bi = new BindInfo($runtime.copyLocator()); - $runtime.currentBindInfo = bi; - - <p:ignore><ref name="anyAttributes"/></p:ignore> - <zeroOrMore> - <choice> - <element name="xs:appinfo"> - <p:ignore><ref name="anyAttributes"/></p:ignore> - <zeroOrMore> - <choice> - <group> - result = <ref name="declaration" /> - bi.addDecl(result); - </group> - <element> - <anyName><except> - <nsName ns="&XJCURI;"/> - <nsName /><!-- JAXB namespace URI --> - <nsName ns="http://www.w3.org/2001/XMLSchema" /> - </except></anyName> - - if($runtime.isExtensionURI($uri)) { - // parse this sub-tree as an extension - try { - sax2dom = new SAX2DOMEx(); - } catch( ParserConfigurationException e ) { - throw new Error(e); // impossible - } - $runtime.redirectSubtree(sax2dom,$uri,$localName,$qname); - } else { - // ignore this sub-tree - sax2dom = null; - $runtime.redirectSubtree(new DefaultHandler(),$uri,$localName,$qname); - } - <empty/> - <p:ignore><ref name="anyContents"/></p:ignore> - if(sax2dom!=null) { - bi.addDecl(new BIXPluginCustomization(((Document)sax2dom.getDOM()).getDocumentElement(),$runtime.copyLocator())); - } - </element> - <text/> - </choice> - </zeroOrMore> - </element> - <!-- ignore documentations --> - <element name="xs:documentation"> - <p:ignore><ref name="anyAttributes"/></p:ignore> - <zeroOrMore> - <choice> - <group> - msg = <text /> - bi.appendDocumentation($runtime.truncateDocComment(msg),true); - </group> - <group> - <element> - <anyName /> - w = new StringWriter(); - DataWriter xw = new DataWriter(w,"UTF-8"); - xw.setXmlDecl(false); - $runtime.redirectSubtree(xw,$uri,$localName,$qname); - <empty/> - <p:ignore><ref name="anyContents"/></p:ignore> - </element> - <![CDATA[ - bi.appendDocumentation("<pre>"+ - $runtime.escapeMarkup($runtime.truncateDocComment(w.toString()))+ - "</pre>", - false ); - w=null; - ]]> - </group> - </choice> - </zeroOrMore> - </element> - </choice> - </zeroOrMore> - </element> - </define> - - - - <!-- - - Individual customization declarations - - --> - - <define name="declaration" - cc:return-type="BIDeclaration" cc:return-value="result"> - - <cc:java-body> - private BIDeclaration result; - </cc:java-body> - <!-- result field will have the parsed object --> - <choice> - result = <ref name="globalBindings" /> - result = <ref name="schemaBindings" /> - result = <ref name="class"/> - result = <ref name="conversion"/> - result = <ref name="property"/> - result = <ref name="typesafeEnum"/> - result = <ref name="enumMember"/> - <!-- result = <ref name="idSymbolSpace"/--> - <!-- result = <ref name="dom"/--> - </choice> - </define> - - - <define name="globalBindings" - cc:return-type="BIGlobalBinding" cc:return-value="makeResult()"> - - <cc:java-body> - private Locator loc; - private Map globalConvs = new HashMap(); - private NameConverter nameConverter = NameConverter.standard; - private String enableJavaNamingConvention = "true"; - private String fixedAttrToConstantProperty = "false"; - private String needIsSetMethod = "false"; - private String simpleTypeSubstitution = "false"; - private boolean flattenClasses = false; - private Set enumBaseTypes = new HashSet(); - private int defaultEnumSizeCap = 256; - private boolean generateEnumMemberName = false; - private boolean choiceContentPropertyWithModelGroupBinding = false; - private boolean xSmartWildcardDefaultBinding = false; - private boolean xSimpleMode; - private boolean generateValueClass = true; - private boolean generateElementClass = false; - private boolean generateMixedExtensions = false; - - public BIGlobalBinding makeResult() { - if( enumBaseTypes.size()==0 ) - enumBaseTypes.add(new QName(WellKnownNamespace.XML_SCHEMA,"NCName")); // defaults to NCName - - return new BIGlobalBinding( - globalConvs,nameConverter, - choiceContentPropertyWithModelGroupBinding, - generateValueClass, - generateElementClass, - $runtime.parseBoolean(enableJavaNamingConvention), - $runtime.parseBoolean(fixedAttrToConstantProperty), - $runtime.parseBoolean(needIsSetMethod), - $runtime.parseBoolean(simpleTypeSubstitution), - generateEnumMemberName, - flattenClasses, - enumBaseTypes, - defaultEnumSizeCap, - ct, - serializable, - xSuperClass, - xSuperInterface, - xSimpleMode, - xSmartWildcardDefaultBinding, - loc); - } - </cc:java-body> - <element name="globalBindings"> - loc = $runtime.copyLocator(); - - <optional> - <attribute name="underscoreBinding"> - <choice> - <value>asWordSeparator</value><!-- default --> - <group> - <value>asCharInWord</value> - nameConverter = NameConverter.jaxrpcCompatible; - </group> - </choice> - </attribute> - </optional> - - <optional> - <attribute name="enableJavaNamingConventions"> - enableJavaNamingConvention = <data type="boolean"/> - </attribute> - </optional> - - <optional> - <attribute name="fixedAttributeAsConstantProperty"> - fixedAttrToConstantProperty = <data type="boolean"/> - </attribute> - </optional> - - <optional> - <attribute name="generateIsSetMethod"> - needIsSetMethod = <data type="boolean"/> - </attribute> - </optional> - - <optional> - <attribute name="mapSimpleTypeDef"> - simpleTypeSubstitution = <data type="boolean"/> - </attribute> - </optional> - - <optional> - <attribute name="localScoping"> - <choice> - <group> - <value>nested</value> - flattenClasses = false; - </group> - <group> - <value>toplevel</value> - flattenClasses = true; - </group> - </choice> - </attribute> - </optional> - - <optional> - <attribute name="collectionType"> - ct = <ref name="collectionType" /> - </attribute> - </optional> - - <optional> - <attribute name="typesafeEnumMemberName"> - <choice> - <value>generateError</value> <!-- default --> - <group> - <value>generateName</value> - generateEnumMemberName = true; - </group> - </choice> - </attribute> - </optional> - - <optional> - <attribute name="typesafeEnumBase"> - <list> - <oneOrMore> - value = <data type="QName"/> - QName qn = $runtime.parseQName(value); - enumBaseTypes.add( qn ); - </oneOrMore> - </list> - </attribute> - </optional> - - <optional> - <attribute name="typesafeEnumMaxMembers"> - <list> - <oneOrMore> - value = <data type="int"/> - defaultEnumSizeCap = Integer.parseInt(value); - </oneOrMore> - </list> - </attribute> - </optional> - - - <optional> - <attribute name="choiceContentProperty"> - value = <data type="boolean"/> - choiceContentPropertyWithModelGroupBinding = $runtime.parseBoolean(value); - </attribute> - </optional> - - <optional> - <attribute name="generateValueClass"> - value = <data type="boolean"/> - generateValueClass = $runtime.parseBoolean(value); - </attribute> - </optional> - - <optional> - <attribute name="generateElementClass"> - value = <data type="boolean"/> - generateElementClass = $runtime.parseBoolean(value); - </attribute> - </optional> - - <optional> - <attribute name="generateMixedExtensions"> - value = <data type="boolean"/> - generateMixedExtensions = $runtime.parseBoolean(value); - </attribute> - </optional> - - <!-- unimplemented attributes --> - <optional> - <attribute name="enableValidation"> - value = <data type="boolean"/> - if( $runtime.parseBoolean(value)==true ) - $runtime.reportUnsupportedFeature("enableValidation"); - </attribute> - </optional> - <optional> - <attribute name="enableFailFastCheck"> - value = <data type="boolean"/> - if( $runtime.parseBoolean(value)==true ) - $runtime.reportUnsupportedFeature("enableFailFastCheck"); - </attribute> - </optional> - - <!-- body --> - <zeroOrMore> - <choice> - <element name="javaType"> - <attribute name="xmlType"> - xmlType = <data type="QName"/> - </attribute> - conv = <ref name="conversionBody" /> - - globalConvs.put( $runtime.parseQName(xmlType), conv ); - </element> - <element name="serializable"> - <optional> - <attribute name="uid"> - serialuid = <data type="long"/> - </attribute> - </optional> - if(serialuid!=null) - serializable = new BISerializable(Long.parseLong(serialuid)); - else - serializable = new BISerializable(null); - </element> - - <!-- global vendor extensions --> - serializable = <ref name="serializable"/> - xSuperClass = <ref name="superClass"/> - xSuperInterface = <ref name="superInterface"/> - <ref name="typeSubstitution" /> - <element name="xjc:smartWildcardDefaultBinding"> - <!-- - changes the default binding of wildcards so that unknown elements will be - bound to DOM. This feature is not publicly available, and we may change it - later. - --> - xSmartWildcardDefaultBinding = true; - <empty /> - </element> - - <element name="xjc:simple"> - xSimpleMode = true; - <empty /> - </element> - - <!-- - light-weight runtime. we no longer support them, - but we don't issue an error when we see them. - --> - <element name="xjc:noMarshaller"> - <empty /> - </element> - <element name="xjc:noUnmarshaller"> - <empty /> - </element> - <element name="xjc:noValidator"> - <empty /> - </element> - <element name="xjc:noValidatingUnmarshaller"> - <empty /> - </element> - </choice> - </zeroOrMore> - </element> - </define> - - - <define name="schemaBindings" - cc:return-type="BISchemaBinding" cc:return-value="makeResult()"> - - <cc:java-body> - private Locator loc; - public BISchemaBinding makeResult() { - return new BISchemaBinding(packageName,javadoc,tt,et,at,mt,nt,loc); - } - </cc:java-body> - - <element name="schemaBindings"> - loc = $runtime.copyLocator(); - - <optional> - <element name="package"> - <optional> - packageName = <attribute name="name"/> - </optional> - <optional> - javadoc = <ref name="javadoc"/> - </optional> - </element> - </optional> - - <optional> - <element name="nameXmlTransform"> - <!-- use newer version of RELAXNGCC and wrap them by <interleave> --> - <zeroOrMore> - <choice> - <element name="typeName"> - tt = <ref name="nameXmlTransformRule"/> - </element> - <element name="elementName"> - et = <ref name="nameXmlTransformRule"/> - </element> - <element name="attributeName"> - at = <ref name="nameXmlTransformRule"/> - </element> - <element name="modelGroupName"> - mt = <ref name="nameXmlTransformRule"/> - </element> - <element name="anonymousTypeName"> - nt = <ref name="nameXmlTransformRule"/> - </element> - </choice> - </zeroOrMore> - </element> - </optional> - </element> - </define> - - <define name="nameXmlTransformRule" - cc:return-type="BISchemaBinding.NamingRule" - cc:return-value="new BISchemaBinding.NamingRule(prefix,suffix)"> - - <cc:java-body> - private String prefix=""; - private String suffix=""; - </cc:java-body> - - - <optional> - <attribute name="prefix"> - prefix = <data type="NCName"/> - </attribute> - </optional> - <optional> - <attribute name="suffix"> - suffix = <data type="NCName"/> - </attribute> - </optional> - </define> - - - - <define name="javadoc" cc:return-type="String" cc:return-value="javadoc"> - <element name="javadoc"> - javadoc = <text /> - javadoc = $runtime.truncateDocComment(javadoc); - </element> - </define> - - <define name="collectionType" cc:class="CollectionTypeState" - cc:return-type="FieldRenderer" cc:return-value="r"> - <cc:java-body> - private FieldRenderer r = null; - </cc:java-body> - type = <data type="token"/> - - if( type.equals("indexed") ) - r = FieldRenderer.ARRAY; - else - try { - r = new UntypedListFieldRenderer( $runtime.codeModel.ref(type) ); - } catch( ClassNotFoundException e ) { - throw new NoClassDefFoundError(e.getMessage()); - } - </define> - - - - <define name="class" cc:class="BIClassState" - cc:return-type="BIClass" cc:return-value="makeResult()"> - - <cc:java-body> - private Locator loc; - public BIClass makeResult() { - return new BIClass(loc,name,implClass,javadoc); - } - </cc:java-body> - - <element name="class"> - loc = $runtime.copyLocator(); - <optional> - javadoc = <ref name="javadoc"/> - </optional> - <optional> - <attribute name="name"> - name = <data type="identifier" datatypeLibrary="http://java.sun.com/xml/ns/relaxng/java-datatypes"/> - </attribute> - </optional> - <optional> - implClass = <attribute name="implClass"/> - </optional> - </element> - </define> - - <define name="property" - cc:return-type="BIProperty" cc:return-value="makeResult()"> - - <cc:java-body> - private Locator loc; - private Boolean isConst = null; - private Boolean isSet = null; - private Boolean genElemProp = null; - - public BIProperty makeResult() throws SAXException { - JType baseTypeRef = null; - if(baseType!=null) - baseTypeRef = $runtime.getType(baseType); - - return new BIProperty(loc,name,javadoc,baseTypeRef,conv,ct,isConst,isSet,genElemProp); - } - </cc:java-body> - - <element name="property"> - loc = $runtime.copyLocator(); - <optional> - name = <attribute name="name"/> - </optional> - <optional> - baseType = <attribute name="baseType"/> - </optional> - <optional> - <attribute name="collectionType"> - ct = <ref name="collectionType" /> - </attribute> - </optional> - <optional> - <attribute name="fixedAttributeAsConstantProperty"> - isConstStr = <data type="boolean"/> - isConst = $runtime.parseBoolean(isConstStr)?Boolean.TRUE:Boolean.FALSE; - </attribute> - </optional> - <optional> - <attribute name="generateIsSetMethod"> - isSetStr = <data type="boolean"/> - isSet = $runtime.parseBoolean(isSetStr)?Boolean.TRUE:Boolean.FALSE; - </attribute> - </optional> - <optional> - <attribute name="generateElementProperty"> - genElemPropStr = <data type="boolean"/> - genElemProp = $runtime.parseBoolean(genElemPropStr)?Boolean.TRUE:Boolean.FALSE; - </attribute> - </optional> - <optional> - <attribute name="generateFailFastSetterMethod"> - failFast = <data type="boolean"/> - </attribute> - if( $runtime.parseBoolean(failFast) ) { - $runtime.reportUnimplementedFeature("generateFailFastSetterMethod"); - } - </optional> - - - <interleave> - <optional> - javadoc = <ref name="javadoc"/> - </optional> - <optional> - <element name="baseType"> - conv = <ref name="conversion"/> - </element> - </optional> - </interleave> - </element> - </define> - - <define name="conversion" - cc:return-type="BIConversion" cc:return-value="r"> - <element name="javaType"> - r = <ref name="conversionBody"/> - </element> - </define> - - - <define name="conversionBody" - cc:return-type="BIConversion" cc:return-value="makeResult()"> - - <cc:java-import> - import com.sun.tools.internal.xjc.generator.util.WhitespaceNormalizer; - </cc:java-import> - <cc:java-body><![CDATA[ - public BIConversion makeResult() throws SAXException { - return new BIConversion.User( $runtime.copyLocator(), parse, print, $runtime.getType(type) ); - } - - // initialize with default values. - private String type = "java.lang.String"; // in case a schema has an error - private String parse = null; - private String print = null; - private boolean context = false; - ]]></cc:java-body> - - - <optional> - parse = <attribute name="parseMethod" /> - </optional> - <optional> - print = <attribute name="printMethod" /> - </optional> - <attribute name="name" cc:alias="type"/> - <optional> - <attribute name="hasNsContext"> - _context = <data type="boolean"/> - context = $runtime.parseBoolean(_context); - </attribute> - </optional> - </define> - - - <!-- type safe enum customization --> - <define name="typesafeEnum" - cc:return-type="BIEnum" cc:return-value="makeResult()"> - - <cc:java-import> - import java.util.HashMap; - </cc:java-import> - <cc:java-body> - private HashMap members = new HashMap(); - private boolean dontBind = false; - private Locator loc,loc2; - - private BIEnum makeResult() { - return new BIEnum(loc,dontBind,name,javadoc,members); - } - </cc:java-body> - - <element name="typesafeEnumClass"> - loc = $runtime.copyLocator(); - <choice> - <attribute name="map"> - <value>false</value> - dontBind = true; - </attribute> - <group> - <optional> - name = <attribute name="name"/> - </optional> - <optional> - javadoc = <ref name="javadoc" /> - </optional> - <zeroOrMore> - jname = null; - javadoc = null; - <element name="typesafeEnumMember"> - loc2 = $runtime.copyLocator(); - <optional> - jname = <attribute name="name"/> - </optional> - value = <attribute name="value"/> - <optional> - javadoc = <ref name="javadoc" /> - </optional> - members.put( value, new BIEnumMember(loc2,jname,javadoc) ); - </element> - </zeroOrMore> - </group> - </choice> - </element> - </define> - - - <!-- stand-alone type safe enum member customization --> - <!-- - Note that only the name attribute is allowed here, and the same element - under the typesafeEnumClass is handled differently. - --> - <define name="enumMember" - cc:return-type="BIEnumMember" cc:return-value="makeResult()"> - <cc:java-body> - private Locator loc; - private BIEnumMember makeResult() { - return new BIEnumMember(loc,name,javadoc); - } - </cc:java-body> - - <element name="typesafeEnumMember"> - loc = $runtime.copyLocator(); - name = <attribute name="name"/> - <optional> - javadoc = <ref name="javadoc" /> - </optional> - </element> - </define> - - - <!-- XJC-exntension: root class support --> - <define name="superClass" cc:return-type="JDefinedClass" cc:return-value="makeResult()"> - <cc:java-body> - private JDefinedClass makeResult() { - try { - JDefinedClass c = $runtime.codeModel._class(name); - c.hide(); - return c; - } catch( JClassAlreadyExistsException e ) { - return e.getExistingClass(); - } - } - </cc:java-body> - - <element name="xjc:superClass"> - name = <attribute name="name" /> - </element> - </define> - - <!-- XJC-exntension: root interface support --> - <define name="superInterface" cc:return-type="JDefinedClass" cc:return-value="makeResult()"> - <cc:java-body> - private JDefinedClass makeResult() { - try { - JDefinedClass c = $runtime.codeModel._class(name,ClassType.INTERFACE); - c.hide(); - return c; - } catch( JClassAlreadyExistsException e ) { - return e.getExistingClass(); - } - } - </cc:java-body> - - <element name="xjc:superInterface"> - name = <attribute name="name" /> - </element> - </define> - - <!-- XJC-exntension: serialization support --> - <define name="serializable" cc:return-type="BISerializable" cc:return-value="makeResult()"> - <cc:java-body> - private long uid = 1; - private BISerializable makeResult() { - return new BISerializable(uid); - } - </cc:java-body> - - <element name="xjc:serializable"> -// loc = $runtime.copyLocator(); - <optional> - <attribute name="uid"> - v = <data type="long"/> - uid = Long.parseLong(v); - </attribute> - </optional> - </element> - </define> - - - <!-- XJC extension: type substitution --> - <define name="typeSubstitution" cc:return-type="boolean" cc:return-value="true"> - <element name="xjc:typeSubstitution"> - <attribute name="type"><value>complex</value></attribute> - </element> - </define> - - - <!-- XJC extension: ID symbol space support --> - <!--define name="idSymbolSpace" cc:return-type="BIXIdSymbolSpace" cc:return-value="makeResult()"> - <cc:java-body> - private Locator loc; - private BIXIdSymbolSpace makeResult() { - return new BIXIdSymbolSpace(loc,name); - } - </cc:java-body> - - <element name="xjc:idSymbolSpace"> - loc = $runtime.copyLocator(); - name = <attribute name="name"/> - </element> - </define--> - - - <!-- XJC extension: DOM support --> - <!--define name="dom" cc:return-type="BIXDom" cc:return-value="makeResult()"> - <cc:java-import> - import com.sun.tools.internal.xjc.grammar.ext.*; - </cc:java-import> - <cc:java-body> - private String factoryName = "w3c"; - private Locator loc; - private BIXDom makeResult() { - try { - return new BIXDom(DOMItemFactory.getInstance(factoryName),loc); - } catch( DOMItemFactory.UndefinedNameException e ) { - throw new InternalError(); // impossible since we use validation to reject incorrect values - } - } - </cc:java-body> - - <element name="xjc:dom"> - loc = $runtime.copyLocator(); - <optional> - <attribute name="type"> - <choice> - factoryName = <value>dom4j</value> - factoryName = <value>w3c</value> - </choice> - </attribute> - </optional> - </element> - </define--> - - - - - - - <p:ignore> - <!-- these patterns are ignored when using RelaxNGCC --> - <define name="anyContents"> - <zeroOrMore> - <choice> - <text/> - <ref name="anyAttributes"/> - <element> - <anyName/> - <ref name="anyContents"/> - </element> - </choice> - </zeroOrMore> - </define> - - <define name="anyAttributes"> - <zeroOrMore> - <attribute> - <anyName/> - <text/> - </attribute> - </zeroOrMore> - </define> - </p:ignore> -</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng Fri May 23 16:25:43 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1579 +0,0 @@ -<?xml version="1.0"?> -<!-- - Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - This code is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 only, as - published by the Free Software Foundation. Oracle designates this - particular file as subject to the "Classpath" exception as provided - by Oracle in the LICENSE file that accompanied this code. - - This code is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - version 2 for more details (a copy is included in the LICENSE file that - accompanied this code). - - You should have received a copy of the GNU General Public License version - 2 along with this work; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - or visit www.oracle.com if you need additional information or have any - questions. ---> - -<grammar xmlns="http://relaxng.org/ns/structure/1.0" - datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" - ns="http://www.w3.org/2001/XMLSchema" - xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:doc="http://www.jenitennison.com/doc" - xmlns:txw="http://java.sun.com/txw"> - -<doc:p> - RELAX NG schema for XML Schema by <doc:link - href="mailto:mail@jenitennison.com">Jeni Tennison</doc:link>. Based on - <doc:link href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML - Schema Part I: Structures Recommendation</doc:link> and <doc:link - href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">XML Schema Part - II: Datatypes</doc:link>. -</doc:p> -<doc:changes date="2001-11-24"> - <doc:p> - Amended to comply with 10 August 2001 Tutorial. - </doc:p> - <doc:change>Removed key attributes.</doc:change> - <doc:change>Replaced not element with except elements.</doc:change> - <doc:change> - Replaced multiple consecutive optional attributes to use the - zeroOrMore/choice pattern. - </doc:change> - <doc:change> - Removed interleave elements inside list elements (which are no longer - permitted). - </doc:change> -</doc:changes> - -<define name="openAttrs" txw:mode="inherit"> - <doc:p> - This allows any number of attributes that are not in the XML Schema - namespace or are in no namespace. This is somewhat more complicated than - the XML Schema anyAttribute equivalent. - </doc:p> - <!-- KK don't care --> - <empty/> - <!--zeroOrMore> - <attribute> - <anyName> - <except> - <nsName /> - <nsName ns="" /> - <name>xml:lang</name> - </except> - </anyName> - <text /> - </attribute> - </zeroOrMore--> -</define> - -<define name="annotated" txw:mode="inherit"> - <doc:p> - This allows any number of attributes that are not in the XML Schema - namespace or are in no namespace, an optional id attribute of type ID, - and an optional annotation element. This is used as the basis for many - element content models. - </doc:p> - <ref name="openAttrs" /> - <optional> - <attribute name="id"> - <data type="ID" /> - </attribute> - </optional> - <optional> - <ref name="annotation" /> - </optional> -</define> - -<define name="schemaTop" txw:mode="inline"> - <doc:p> - This gives the content model of the top level of the schema. - </doc:p> - <choice> - <ref name="redefinable" /> - <ref name="topLevelElement" /> - <ref name="topLevelAttribute" /> - <!--ref name="notation" /--> - </choice> -</define> - -<define name="redefinable" txw:mode="inline"> - <doc:p> - This gives the components that can be redefined within the redefine - element. They also occur at the top level of the schema. - </doc:p> - <choice> - <ref name="simpleTypeHost" /> - <ref name="complexTypeHost" /> - <!--ref name="namedGroup" /> - <ref name="namedAttributeGroup" /--> - </choice> -</define> - -<define name="formChoice"> - <doc:p> - This gives the values for the various form attributes: - elementFormDefault and attributeFormDefault on the schema element, and - the form attributes on the element and attribute elements. - </doc:p> - <choice> - <value>qualified</value> - <value>unqualified</value> - </choice> -</define> - -<!-- KK: merge the two --> -<define name="reducedDerivationControl"> - <doc:p> - This gives the values that can be taken in the lists used to control - derivation by extension or restriction (this is 'reduced' derivation - because some derivation can involve substitution). This RELAX NG schema, - like the XML Schema Recommendation here, allows the keywords 'extension' and - 'restriction' to be repeated any number of times. - </doc:p> - <list> - <oneOrMore> - <choice> - <value>extension</value> - <value>restriction</value> - </choice> - </oneOrMore> - </list> -</define> - -<define name="derivationSet"> - <doc:p> - This specifies the possible values for attributes that control derivation. - </doc:p> - <choice> - <value>#all</value> - <ref name="reducedDerivationControl" /> - </choice> -</define> - -<start> - <doc:p> - This is the beginning point for the schema, and defines the schema - element. - </doc:p> - <element name="schema" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-schema"> - <ref name="openAttrs" /> - <zeroOrMore> - <choice> - <attribute name="version"> - <data type="token" /> - </attribute> - <attribute name="finalDefault"> - <ref name="derivationSet" /> - </attribute> - <attribute name="blockDefault"> - <ref name="blockSet" /> - </attribute> - <attribute name="attributeFormDefault"> - <ref name="formChoice" /> - </attribute> - <attribute name="elementFormDefault"> - <ref name="formChoice" /> - </attribute> - <attribute name="id"> - <data type="ID" /> - </attribute> - <attribute name="xml:lang"> - <data type="language" /> - </attribute> - <attribute name="targetNamespace"> - <data type="anyURI" /> - </attribute> - </choice> - </zeroOrMore> - <zeroOrMore> - <choice> - <!--ref name="include" /--> - <ref name="import" /> - <!--ref name="redefine" /--> - <ref name="annotation" /> - </choice> - </zeroOrMore> - <zeroOrMore> - <choice> - <ref name="schemaTop" /> - <ref name="annotation" /> - </choice> - </zeroOrMore> - </element> -</start> - -<define name="allNNI"> - <doc:p> - This gives the value type for the maxOccurs attribute, which may be a - non-negative number or the keyword 'unbounded'. - </doc:p> - <choice> - <data type="nonNegativeInteger" /> - <value type="token">unbounded</value> - </choice> -</define> - -<define name="occurs" txw:mode="inherit"> - <doc:p> - This specifies the occurs attributes, minOccurs and maxOccurs, as they - are normally used. - </doc:p> - <zeroOrMore> - <choice> - <attribute name="minOccurs"> - <data type="nonNegativeInteger" /> - </attribute> - <attribute name="maxOccurs"> - <ref name="allNNI" /> - </attribute> - </choice> - </zeroOrMore> -</define> - -<define name="typeDefParticle" txw:mode="inline"> - <doc:p> - This gives the possible content of complex types. - </doc:p> - <choice> - <!--ref name="groupRef" /--> - <ref name="all" /> - <ref name="choice" /> - <ref name="sequence" /> - </choice> -</define> - -<define name="nestedParticle" txw:mode="inline"> - <doc:p> - This gives the particles that can make up a model group. - </doc:p> - <choice> - <ref name="localElement" /> - <!--ref name="groupRef" /--> - <ref name="choice" /> - <ref name="sequence" /> - <ref name="any" /> - </choice> -</define> - -<define name="fixedOrDefault" txw:mode="inline"> - <doc:p> - This specifies the relationship between fixed and default attributes on - element and attribute elements - if one is present, then the other cannot - be. This is a constraint that cannot be specified using XML Schema. - </doc:p> - <choice> - <empty /> - <attribute name="fixed" /> - <attribute name="default" /> - </choice> -</define> - -<define name="attributeType" txw:mode="inherit"> - <doc:p> - This specifies the relationship between the type attribute and the - simpleType element child of attribute elements - if one is present, then - the other cannot be, although it is possible for neither to be allowed. - </doc:p> - <choice> - <empty /> - <attribute name="type"> - <data type="QName" /> - </attribute> - <ref name="simpleTypeHost" /> - </choice> -</define> - -<define name="localAttribute"> - <doc:p> - This describes attribute elements when used in a local context. They - have an optional use attribute, possibly a fixed or default attribute, - and then can either have a ref attribute (referring to a top-level - attribute) or a name attribute with an optional form attribute and - specifying an attribute type. - </doc:p> - <element name="attribute" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute"> - <ref name="annotated" /> - <optional> - <attribute name="use"> - <choice> - <value type="token">optional</value> - <value type="token">prohibited</value> - <value type="token">required</value> - </choice> - </attribute> - </optional> - <ref name="fixedOrDefault" /> - <choice> - <attribute name="ref"> - <data type="QName" /> - </attribute> - <group> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <optional> - <attribute name="form"> - <ref name="formChoice" /> - </attribute> - </optional> - <ref name="attributeType" /> - </group> - </choice> - </element> -</define> - -<define name="topLevelAttribute"> - <doc:p> - This describes attribute elements when used at the top level of the - schema. They must have a name, may have a fixed or default attribute, - and specify their type through a type attribute or child simpleType - element. The name attribute of each attribute element that appears at - the top level of the schema is unique. - </doc:p> - <element name="attribute" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute"> - <ref name="annotated" /> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <ref name="fixedOrDefault" /> - <ref name="attributeType" /> - </element> -</define> - -<define name="attrDecls" txw:mode="inherit"> - <doc:p> - This gives the model group for specifying the attributes in a complex - type, an extension or restriction. - </doc:p> - <zeroOrMore> - <choice> - <ref name="localAttribute" /> - <!--ref name="attributeGroupRef" /--> - </choice> - </zeroOrMore> - <optional> - <ref name="anyAttribute" /> - </optional> -</define> - -<define name="anyAttribute"> - <doc:p> - This specifies the anyAttribute wildcard. - </doc:p> - <element name="anyAttribute" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"> - <ref name="wildcard" /> - </element> -</define> - -<define name="complexTypeModel" txw:mode="inherit"> - <doc:p> - This specifies the content of a complexType element. As children, it can - have a simpleContent, a complexContent or a model group. Only if it has - one of the latter two, may it have a mixed attribute. This latter - constraint is something that cannot be specified in XML Schema. - </doc:p> - <choice> - <ref name="simpleContent" /> - <group> - <optional> - <attribute name="mixed"> - <data type="boolean" /> - </attribute> - </optional> - <choice> - <ref name="complexContent" /> - <group> - <optional> - <ref name="typeDefParticle" /> - </optional> - <ref name="attrDecls" /> - </group> - </choice> - </group> - </choice> -</define> - -<define name="complexTypeHost" txw:mode="inherit"> - <ref name="typeHost" /> - <ref name="complexType" /> -</define> - -<define name="typeHost" txw:mode="inherit"><empty/><empty/></define> - -<define name="complexType" txw:mode="inherit"> - <element name="complexType" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexType"> - <doc:p> - This specifies the basic content of a complexType element. - </doc:p> - <ref name="annotated" /> - <ref name="complexTypeModel" /> - <optional> - <attribute name="name"> - <data type="NCName" /> - </attribute> - </optional> - <zeroOrMore> - <choice> - <attribute name="abstract"> - <data type="boolean" /> - </attribute> - <attribute name="block"> - <ref name="derivationSet" /> - </attribute> - <attribute name="final"> - <ref name="derivationSet" /> - </attribute> - </choice> - </zeroOrMore> - </element> -</define> - -<define name="complexRestriction"> - <doc:p> - This describes a restriction element within a complexContent element - (i.e. one that restricts a complex type). It has a base attribute, may - contain a model group and may contain attribute declarations of various - sorts. - </doc:p> - <element name="restriction" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::restriction"> - <ref name="annotated" /> - <attribute name="base"> - <data type="QName" /> - </attribute> - <optional> - <ref name="typeDefParticle" /> - </optional> - <ref name="attrDecls" /> - </element> -</define> - -<define name="extensionType"> - <doc:p> - This specifies the basic model for an extension element: adding a - required base attribute to the model used for most components. - </doc:p> - <ref name="annotated" /> - <attribute name="base"> - <data type="QName" /> - </attribute> -</define> - -<define name="complexExtension"> - <doc:p> - This describes an extension element within a complexContent element - (i.e. one that restricts a complex type). It may contain a model group - and may contain attribute declarations of various sorts. - </doc:p> - <element name="extension" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::extension"> - <ref name="extensionType" /> - <optional> - <ref name="typeDefParticle" /> - </optional> - <ref name="attrDecls" /> - </element> -</define> - -<define name="complexContent"> - <doc:p> - This describes a complexContent element. It may have a mixed attribute, - and either a restriction or extension element as content. - </doc:p> - <element name="complexContent" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent"> - <ref name="annotated" /> - <optional> - <attribute name="mixed"> - <data type="boolean" /> - </attribute> - </optional> - <choice> - <ref name="complexRestriction" /> - <ref name="complexExtension" /> - </choice> - </element> -</define> - -<define name="simpleRestriction"> - <doc:p> - This describes a restriction element that appears within a simpleContent - or simpleType element (i.e. one that restricts a simple type). Its - content follows the simple restriction model that is detailed below, and - may include attribute declarations. - </doc:p> - <element name="restriction" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::restriction"> - <ref name="annotated" /> - <ref name="simpleRestrictionModel" /> - <ref name="attrDecls" /> - </element> -</define> - -<define name="simpleExtension"> - <doc:p> - This describes an extension element that appears within a simpleContent - element (i.e. one that extends a simple type). Like other extensions, it - has a base type, but it can only be used to add attributes. - </doc:p> - <element name="extension" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::extension"> - <ref name="extensionType" /> - <ref name="attrDecls" /> - </element> -</define> - -<define name="simpleContent"> - <doc:p> - This describes a simpleContent element, whose content can either hold a - restriction or extension element. - </doc:p> - <element name="simpleContent" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"> - <ref name="annotated" /> - <choice> - <ref name="simpleRestriction" /> - <ref name="simpleExtension" /> - </choice> - </element> -</define> - -<define name="blockSet"> - <doc:p> - This gives the possible values for block attributes on element elements, - which includes substitution amongst the list of possible values. This - RELAX NG schema, like the XML Schema Recommendation, allows each of the - keywords 'extension', 'restriction' and 'substitution' to occur more than - once within the list. - </doc:p> - <choice> - <value type="token">#all</value> - <list> - <oneOrMore> - <choice> - <value>extension</value> - <value>restriction</value> - <value>substitution</value> - </choice> - </oneOrMore> - </list> - </choice> -</define> - -<define name="element" txw:mode="inherit"> - <doc:p> - This describes the basic content model of an element element. It is - annotated, may have a fixed or default attribute, and may have nillable - and/or block attributes. Its type may be specified through a type - attribute, a local simple type or a local complex type - the choice - between these methods is something that cannot be indicated with XML - Schema. This content is optionally followed by some identify constraints. - </doc:p> - <ref name="annotated" /> - <ref name="fixedOrDefault" /> - <zeroOrMore> - <choice> - <attribute name="nillable"> - <data type="boolean" /> - </attribute> - <attribute name="block"> - <ref name="blockSet" /> - </attribute> - </choice> - </zeroOrMore> - <choice> - <empty /> - <attribute name="type"> - <data type="QName" /> - </attribute> - <ref name="simpleTypeHost" /> - <ref name="complexTypeHost" /> - </choice> - <!--zeroOrMore> - <ref name="identityConstraint" /> - </zeroOrMore--> -</define> - -<define name="topLevelElement"> - <doc:p> - This describes an element element that appears at the top level of the - schema. On top of the basic content for an element element, it has to - have a name, which is a unique identifier in the element symbol space. It - may have substitutionGroup, abstract and/or final attributes. - </doc:p> - <element name="element" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-element"> - <ref name="element" /> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <zeroOrMore> - <choice> - <attribute name="substitutionGroup"> - <data type="QName" /> - </attribute> - <attribute name="abstract"> - <data type="boolean" /> - </attribute> - <attribute name="final"> - <ref name="derivationSet" /> - </attribute> - </choice> - </zeroOrMore> - </element> -</define> - -<define name="localElement"> - <doc:p> - This describes an element element that appears locally, within a - complexType or group element. It may have minOccurs and/or maxOccurs - attributes. If it has a ref attribute, then that's all it can - have. Otherwise, it must have a name and specifies its type in the same - way as the basic element content model described above. It may in this - case also have a form element. These constraints on local elements - cannot be described within XML Schema. - </doc:p> - <element name="element" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-element"> - <ref name="occurs" /> - <choice> - <attribute name="ref"> - <data type="QName" /> - </attribute> - <group> - <ref name="element" /> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <optional> - <attribute name="form"> - <ref name="formChoice" /> - </attribute> - </optional> - </group> - </choice> - </element> -</define> - -<!--define name="namedGroup"> - <doc:p> - This describes an group element that appears at the top level of the - schema. It must have a name attribute, and must have one of an all, - choice or sequence element child. - </doc:p> - <element name="group" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-group"> - <ref name="annotated" /> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <choice> - <element name="all"> - <ref name="simpleExplicitGroup" /> <!- - RS - relaxed all content model - -> - </element> - <element name="choice"> - <ref name="simpleExplicitGroup" /> - </element> - <element name="sequence"> - <ref name="simpleExplicitGroup" /> - </element> - </choice> - </element> -</define--> - -<!--define name="groupRef"> - <doc:p> - This describes group element that occurs locally, referring to a - top-level named group. It may have occurrence attributes, and must have - a ref attribute. - </doc:p> - <element name="group" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-group"> - <ref name="annotated" /> - <ref name="occurs" /> - <attribute name="ref"> - <data type="QName" /> - </attribute> - </element> -</define--> - -<define name="explicitGroup" txw:mode="inherit"> - <doc:p> - This gives the content of a model group (not a group element) in the - normal run of things. It has occurrence attributes and any number of - particles within it. - </doc:p> - <ref name="annotated" /> - <ref name="occurs" /> - <zeroOrMore> - <ref name="nestedParticle" /> - </zeroOrMore> -</define> - -<define name="simpleExplicitGroup"> - <doc:p> - This gives the content of a model group (not a group element) within a - named group - it differs from the above in that it doesn't have any - occurrence attributes. - </doc:p> - <ref name="annotated" /> - <zeroOrMore> - <ref name="nestedParticle" /> - </zeroOrMore> -</define> - -<define name="all"> - <doc:p> - This describes an all element that appears outside a named group (i.e. as - the content of a complexType element). It has the standard model for an - all element, but adds minOccurs and maxOccurs attributes which can only - take certain values. - </doc:p> - <element name="all" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-all"> - <ref name="explicitGroup" /> - </element> -</define> - -<define name="choice"> - <doc:p> - This describes a choice element that appears outside a named group. - </doc:p> - <element name="choice" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-choice"> - <ref name="explicitGroup" /> - </element> -</define> - -<define name="sequence"> - <doc:p> - This describes a sequence element that appears outside a named group. - </doc:p> - <element name="sequence" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-sequence"> - <ref name="explicitGroup" /> - </element> -</define> - -<define name="wildcard" txw:mode="inherit"> - <doc:p> - This describes a wildcard element (i.e. any or anyAttribute). The - namespace attribute can take a list URIs interspersed with the keywords - '##targetNamespace' and/or '##local'. This RELAX NG schema, like the XML - Schema Recommendation, allows the keywords to be specified more than once - each within the list, if they're given. This model also specifies the - processContents attribute. - </doc:p> - <ref name="annotated" /> - <zeroOrMore> - <choice> - <attribute name="namespace"> - <choice> - <value type="token">##any</value> - <value type="token">##other</value> - <list> - <zeroOrMore> - <choice> - <data type="anyURI" /> - <value>##targetNamespace</value> - <value>##local</value> - </choice> - </zeroOrMore> - </list> - </choice> - </attribute> - <attribute name="processContents"> - <choice> - <value type="token">lax</value> - <value type="token">skip</value> - <value type="token">strict</value> - </choice> - </attribute> - </choice> - </zeroOrMore> -</define> - -<define name="any"> - <doc:p> - This describes an any element as a wildcard. - </doc:p> - <element name="any" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-any"> - <ref name="wildcard" /> - <ref name="occurs" /> - </element> -</define> - -<!--define name="namedAttributeGroup"> - <doc:p> - This describes an attributeGroup element as it appears at the top level - of the schema. It must have a name attribute, and then contains - attribute declarations. - </doc:p> - <element name="attributeGroup" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"> - <ref name="annotated" /> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <ref name="attrDecls" /> - </element> -</define--> - -<!--define name="attributeGroupRef"> - <doc:p> - This describes an attributeGroup element as it appears within a complex - type. It must have a ref attribute. - </doc:p> - <element name="attributeGroup" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"> - <ref name="annotated" /> - <attribute name="ref"> - <data type="QName" /> - </attribute> - </element> -</define--> - -<!--define name="include"> - <doc:p> - This describes an include element, which must have a schemaLocation - attribute. - </doc:p> - <element name="include" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-include"> - <ref name="annotated" /> - <attribute name="schemaLocation"> - <data type="anyURI" /> - </attribute> - </element> -</define--> - -<!--define name="redefine"> - <doc:p> - This describes a redefine element, which must have a schemaLocation - attribute and can then contain any mix of annotations and redefinable - components. - </doc:p> - <element name="redefine" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-redefine"> - <ref name="openAttrs" /> - <optional> - <attribute name="id"> - <data type="ID" /> - </attribute> - </optional> - <attribute name="schemaLocation"> - <data type="anyURI" /> - </attribute> - <zeroOrMore> - <choice> - <ref name="annotation" /> - <ref name="redefinable" /> - </choice> - </zeroOrMore> - </element> -</define--> - -<define name="import"> - <doc:p> - This describes an import element that's used when its parent schema - element specifies a targetNamespace. In these cases, the namespace - attribute on the import element is optional. - </doc:p> - <element name="import" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-import"> - <ref name="annotated" /> - <optional> - <attribute name="schemaLocation"> - <data type="anyURI" /> - </attribute> - </optional> - <optional> - <attribute name="namespace"> - <data type="anyURI" /> - </attribute> - </optional> - </element> -</define> - -<!--define name="selector"> - <doc:p> - This describes a selector element. The xpath attribute is a simplified - XPath - the regular expression given here is the one from the XML Schema - for XML Schema. - </doc:p> - <element name="selector" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-selector"> - <ref name="annotated" /> - <attribute name="xpath"> - <data type="token"> - <param name="pattern">(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*</param> - </data> - </attribute> - </element> -</define> - -<define name="field"> - <doc:p> - This describes a field element. The xpath attribute is a simplified - XPath - the regular expression given here is the one from the XML Schema - for XML Schema. - </doc:p> - <element name="field" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-field"> - <ref name="annotated" /> - <attribute name="xpath"> - <data type="token"> - <param name="pattern">(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*</param> - </data> - </attribute> - </element> -</define> - -<define name="keybase" txw:mode="inherit"> - <doc:p> - This gives the basic content for identity constraints - a name attribute - that uniquely identifies the identity constraint, a selector element and - one or more field elements. - </doc:p> - <ref name="annotated" /> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <ref name="selector" /> - <oneOrMore> - <ref name="field" /> - </oneOrMore> -</define> - -<define name="identityConstraint" txw:mode="inline"> - <doc:p> - This gives a model group for the three identity constraint elements, used - within the content of element elements. - </doc:p> - <choice> - <ref name="unique" /> - <ref name="key" /> - <ref name="keyref" /> - </choice> -</define> - -<define name="unique"> - <doc:p> - This describes a unique element. - </doc:p> - <element name="unique" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-unique"> - <ref name="keybase" /> - </element> -</define> - -<define name="key"> - <doc:p> - This describes a key element. - </doc:p> - <element name="key" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-key"> - <ref name="keybase" /> - </element> -</define> - -<define name="keyref"> - <doc:p> - This describes a keyref element. - </doc:p> - <element name="keyref" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-keyref"> - <ref name="keybase" /> - <attribute name="refer"> - <data type="QName" /> - </attribute> - </element> -</define--> - -<!--define name="notation"> - <doc:p> - This describes a notation element. The names of notation elements are - unique in the notation symbol space. The public attribute is required, - and the system attribute is optional. - </doc:p> - <element name="notation" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-notation"> - <ref name="annotated" /> - <attribute name="name"> - <data type="NCName" /> - </attribute> - <attribute name="public"> - <data type="token" /> - </attribute> - <optional> - <attribute name="system"> - <data type="anyURI" /> - </attribute> - </optional> - </element> -</define--> - -<define name="appinfoContent"> - <doc:p> - This is designed to describe the content of the appinfo elements in the - schema. At the moment this allows any mixed content without validation. - Note that this is fairly complex compared to the XML Schema equivalent, - which would be a single any element. - </doc:p> - <ref name="anyContent" /> -</define> - -<define name="anyContent"> - <empty/> <!-- KK don't care --> - <!--mixed> - <zeroOrMore> - <element> - <anyName /> - <zeroOrMore> - <attribute> - <anyName /> - </attribute> - </zeroOrMore> - <ref name="anyContent" /> - <empty /> - </element> - </zeroOrMore> - </mixed--> -</define> - -<define name="appinfo"> - <doc:p> - This describes an appinfo element. It has an optional source attribute - and can currently contain anything at all. - </doc:p> - <element name="appinfo" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-appinfo"> - <optional> - <attribute name="source"> - <data type="anyURI" /> - </attribute> - </optional> - <ref name="appinfoContent" /> - </element> -</define> - -<define name="documentationContent"> - <doc:p> - This is designed to describe the content of the documentation elements in - the schema. At the moment this allows any mixed content without - validation. Note that this is fairly complex compared to the XML Schema - equivalent, which would be a single any element. - </doc:p> - <ref name="anyContent" /> -</define> - -<define name="documentation"> - <doc:p> - This describes a documentation element. It has optional source - and xml:lang attributes and can currently contain anything at all. - </doc:p> - <element name="documentation" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-documentation"> - <zeroOrMore> - <choice> - <attribute name="source"> - <data type="anyURI" /> - </attribute> - <attribute name="xml:lang"> - <data type="language" /> - </attribute> - </choice> - </zeroOrMore> - <ref name="documentationContent" /> - </element> -</define> - -<define name="annotation"> - <doc:p> - This describes an annotation element. It can have any attributes, may - have an id attribute, and contains any number of documentation or appinfo - elements. - </doc:p> - <element name="annotation" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-annotation"> - <ref name="openAttrs" /> - <optional> - <attribute name="id"> - <data type="ID" /> - </attribute> - </optional> - <zeroOrMore> - <choice> - <ref name="documentation" /> - <ref name="appinfo" /> - </choice> - </zeroOrMore> - </element> -</define> - -<define name="simpleDerivation" txw:mode="inline"> - <doc:p> - This gives the various types of derivation of simple types. - </doc:p> - <choice> - <ref name="simpleRestriction" /> - <ref name="list" /> - <ref name="union" /> - </choice> -</define> - -<define name="simpleDerivationSet"> - <doc:p> - This specifies the values of the final attribute for simple types. This - RELAX NG schema for XML Schema, like the XML Schema Recommendation, allows - the keywords 'list', 'union' and 'restriction' to appear more than once - within the list. - </doc:p> - <choice> - <value type="token">#all</value> - <list> - <zeroOrMore> - <choice> - <value>list</value> - <value>union</value> - <value>restriction</value> - </choice> - </zeroOrMore> - </list> - </choice> -</define> - -<define name="simpleTypeHost" txw:mode="inherit"> - <ref name="typeHost" /> - <ref name="simpleType" /> -</define> - -<define name="simpleType" txw:mode="inherit"> - <doc:p> - This gives the basic content of a simple type. - </doc:p> - <element name="simpleType" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleType"> - <ref name="annotated" /> - <ref name="simpleDerivation" /> - <optional> - <attribute name="name"> - <data type="NCName" /> - </attribute> - </optional> - <optional> - <attribute name="final"> - <ref name="simpleDerivationSet" /> - </attribute> - </optional> - </element> -</define> - -<!--define name="rangeFacets" txw:mode="inherit"> - <doc:p> - This describes the relationship between the various range facets. Only - one of minExclusive and minInclusive can be present, and only one of - maxExclusive and maxInclusive can be present. This is a constraint that - can't easily be expressed using XML Schema. This RELAX NG schema - for XML Schema is a little more restrictive than the XML Schema - Recommendation in that it also forces there to be a maximum of one of - each of these types of facets. - </doc:p> - <interleave> - <optional> - <choice> - <ref name="minExclusive" /> - <ref name="minInclusive" /> - </choice> - </optional> - <optional> - <choice> - <ref name="maxExclusive" /> - <ref name="maxInclusive" /> - </choice> - </optional> - </interleave> -</define> - -<define name="digitFacets" txw:mode="inherit"> - <doc:p> - This specifies optional totalDigits and fractionDigits elements. This - RELAX NG schema for XML Schema is a little more restrictive than the XML - Schema Recommendation in that it also forces there to be a maximum of one - of each of these types of facets. - </doc:p> - <optional> - <ref name="totalDigits" /> - </optional> - <optional> - <ref name="fractionDigits" /> - </optional> -</define> - -<define name="lengthFacets" txw:mode="inherit"> - <doc:p> - This specifies optional length, minLength and maxLength elements. This - RELAX NG schema for XML Schema is a little more restrictive than the XML - Schema Recommendation in that it also forces there to be a maximum of one - of each of these types of facets, and says that if a length element is - given, then neither minLength nor maxLength should be present. - </doc:p> - <choice> - <ref name="length" /> - <interleave> - <optional> - <ref name="minLength" /> - </optional> - <optional> - <ref name="maxLength" /> - </optional> - </interleave> - </choice> -</define> - -<define name="commonFacets" txw:mode="inherit"> - <doc:p> - This specifies zero or more enumeration or pattern elements and an - optional whiteSpace element. This RELAX NG schema for XML Schema is a - little more restrictive than the XML Schema Recommendation in that it - also forces there to be a maximum of one whiteSpace element within the - facets. Note that the whiteSpace facet is constrained to have a value of - 'collapse'. - </doc:p> - <zeroOrMore> - <ref name="enumeration" /> - </zeroOrMore> - <optional> - <ref name="whiteSpaceCollapse" /> - </optional> - <zeroOrMore> - <ref name="pattern" /> - </zeroOrMore> -</define--> - -<define name="simpleRestrictionModel"> - <doc:p> - This specifies the types of facets that are valid in restrictions on the - built-in data types. This can only perform rudimentary checking, but - should be enough in most circumstances. Note that for xs:anySimpleType - and xs:string, the whiteSpace facet can take any value, for - xs:normalizedString it can be 'replace' or 'collapse', and for all other - built-in types it has to be 'collapse'. - </doc:p> - <choice> - <attribute name="base"> - <data type="QName" /> - </attribute> - <ref name="simpleTypeHost" /> - </choice> - <interleave> - <!--ref name="rangeFacets" /> - <ref name="digitFacets" /> - <ref name="lengthFacets" /> - <optional> - <ref name="whiteSpace" /> - </optional--> - <zeroOrMore> - <ref name="enumeration" /> - </zeroOrMore> - <!--zeroOrMore> - <ref name="pattern" /> - </zeroOrMore--> - </interleave> -</define> - -<define name="list"> - <doc:p> - This describes a list element. It can either specify a local simple type - or have a itemType attribute. This constraint cannot be expressed in XML - Schema. - </doc:p> - <element name="list" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-list"> - <ref name="annotated" /> - <choice> - <ref name="simpleTypeHost" /> - <attribute name="itemType"> - <data type="QName" /> - </attribute> - </choice> - </element> -</define> - -<define name="union"> - <doc:p> - This describes a union element. If the memberTypes attribute is missing - or empty, then it must contain one or more simpleType elements; if - it's present, then it can contain simpleType elements or list simple - types in the memberTypes attribute. This constraint cannot be expressed - in XML Schema. - </doc:p> - <element name="union" - doc:href="http://www.w3.org/TR/xmlschema-1/#element-union"> - <ref name="annotated" /> - <choice> - <group> - <attribute name="memberTypes"> - <list> - <oneOrMore> - <data type="QName" /> - </oneOrMore> - </list> - </attribute> - <zeroOrMore> - <ref name="simpleTypeHost" /> - </zeroOrMore> - </group> - <group> - <optional> - <attribute name="memberTypes"> - <empty /> - </attribute> - </optional> - <oneOrMore> - <ref name="simpleTypeHost" /> - </oneOrMore> - </group> - </choice> - </element> -</define> - -<define name="facet" txw:mode="inherit"> - <doc:p> - This is the basic content of a facet. It has an optional fixed attribute. - </doc:p> - <ref name="annotated" /> - <optional> - <attribute name="fixed"> - <data type="boolean" /> - </attribute> - </optional> -</define> - -<define name="noFixedFacet" txw:mode="inherit"> - <doc:p> - This is the content of a facet that cannot be fixed (enumeration or - pattern). It has a value attribute that can take any kind of value. - </doc:p> - <ref name="annotated" /> - <attribute name="value" /> -</define> - -<!--define name="rangeFacet"> - <doc:p> - This is the content of a range facet. The value must be one of the data - types shown (as these are the only types of data that accept ranges). I - haven't gone so far as to indicate the data type of the value - attribute of a range facet according to the base type as this would be - very complicated (although it would be possible in RELAX NG). - </doc:p> - <ref name="facet" /> - <attribute name="value"> - <choice> - <data type="decimal" /> - <data type="float" /> - <data type="double" /> - <data type="duration" /> - <data type="dateTime" /> - <data type="time" /> - <data type="date" /> - <data type="gYearMonth" /> - <data type="gYear" /> - <data type="gMonthDay" /> - <data type="gMonth" /> - <data type="gDay" /> - </choice> - </attribute> -</define> - -<define name="minExclusive"> - <doc:p> - This describes a minExclusive element. - </doc:p> - <element name="minExclusive" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minExclusive"> - <ref name="rangeFacet" /> - </element> -</define> - -<define name="minInclusive"> - <doc:p> - This describes a minInclusive element. - </doc:p> - <element name="minInclusive" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minInclusive"> - <ref name="rangeFacet" /> - </element> -</define> - -<define name="maxExclusive"> - <doc:p> - This describes a maxExclusive element. - </doc:p> - <element name="maxExclusive" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxExclusive"> - <ref name="rangeFacet" /> - </element> -</define> - -<define name="maxInclusive"> - <doc:p> - This describes a maxInclusive element. - </doc:p> - <element name="maxInclusive" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxInclusive"> - <ref name="rangeFacet" /> - </element> -</define> - -<define name="numFacet"> - <doc:p> - This is the content of a numerical facet. - </doc:p> - <ref name="facet" /> - <attribute name="value"> - <data type="nonNegativeInteger" /> - </attribute> -</define> - -<define name="totalDigits"> - <doc:p> - This describes a totalDigits element. The value attribute must take a - positive integer. - </doc:p> - <element name="totalDigits" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-totalDigits"> - <ref name="facet" /> - <attribute name="value"> - <data type="positiveInteger" /> - </attribute> - </element> -</define> - -<define name="fractionDigits"> - <doc:p> - This describes a fractionDigits element. - </doc:p> - <element name="fractionDigits" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-fractionDigits"> - <ref name="numFacet" /> - </element> -</define> - -<define name="length"> - <doc:p> - This describes a length element. - </doc:p> - <element name="length" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-length"> - <ref name="numFacet" /> - </element> -</define> - -<define name="minLength"> - <doc:p> - This describes a minLength element. - </doc:p> - <element name="minLength" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minLength"> - <ref name="numFacet" /> - </element> -</define> - -<define name="maxLength"> - <doc:p> - This describes a maxLength element. - </doc:p> - <element name="maxLength" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxLength"> - <ref name="numFacet" /> - </element> -</define--> - -<define name="enumeration"> - <doc:p> - This describes an enumeration element. - </doc:p> - <element name="enumeration" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-enumeration"> - <ref name="noFixedFacet" /> - </element> -</define> - -<!--define name="whiteSpace"> - <doc:p> - This describes a whiteSpace element that can take any of the permitted - values. - </doc:p> - <element name="whiteSpace" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace"> - <ref name="facet" /> - <attribute name="value"> - <choice> - <value type="token">preserve</value> - <value type="token">replace</value> - <value type="token">collapse</value> - </choice> - </attribute> - </element> -</define> - -<define name="whiteSpaceReplaceOrCollapse"> - <doc:p> - This describes a whiteSpace element that can only take the values - 'replace' or 'collapse'. - </doc:p> - <element name="whiteSpace" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace"> - <ref name="facet" /> - <attribute name="value"> - <choice> - <value type="token">replace</value> - <value type="token">collapse</value> - </choice> - </attribute> - </element> -</define> - -<define name="whiteSpaceCollapse"> - <doc:p> - This describes a whiteSpace element that can only take the value - 'collapse'. - </doc:p> - <element name="whiteSpace" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace"> - <ref name="facet" /> - <attribute name="value"> - <value type="token">collapse</value> - </attribute> - </element> -</define> - -<define name="pattern"> - <doc:p> - This describes a pattern element. - </doc:p> - <element name="pattern" - doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-pattern"> - <ref name="noFixedFacet" /> - </element> -</define--> - -</grammar>
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.jj Fri May 23 16:25:43 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1963 +0,0 @@ -options { - STATIC = false; - UNICODE_INPUT = true; - JAVA_UNICODE_ESCAPE = true; -} - -PARSER_BEGIN(CompactSyntax) - -package com.sun.xml.internal.rngom.parse.compact; - -import java.io.Reader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; - -import com.sun.xml.internal.rngom.ast.builder.Annotations; -import com.sun.xml.internal.rngom.ast.builder.BuildException; -import com.sun.xml.internal.rngom.ast.builder.CommentList; -import com.sun.xml.internal.rngom.ast.builder.DataPatternBuilder; -import com.sun.xml.internal.rngom.ast.builder.Div; -import com.sun.xml.internal.rngom.ast.builder.ElementAnnotationBuilder; -import com.sun.xml.internal.rngom.ast.builder.Grammar; -import com.sun.xml.internal.rngom.ast.builder.GrammarSection; -import com.sun.xml.internal.rngom.ast.builder.Include; -import com.sun.xml.internal.rngom.ast.builder.IncludedGrammar; -import com.sun.xml.internal.rngom.ast.builder.NameClassBuilder; -import com.sun.xml.internal.rngom.ast.builder.SchemaBuilder; -import com.sun.xml.internal.rngom.ast.builder.Scope; -import com.sun.xml.internal.rngom.ast.om.Location; -import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation; -import com.sun.xml.internal.rngom.ast.om.ParsedNameClass; -import com.sun.xml.internal.rngom.ast.om.ParsedPattern; -import com.sun.xml.internal.rngom.parse.Context; -import com.sun.xml.internal.rngom.parse.IllegalSchemaException; -import com.sun.xml.internal.rngom.parse.Parseable; -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.helpers.LocatorImpl; - -import com.sun.xml.internal.rngom.util.Localizer; -import com.sun.xml.internal.rngom.xml.util.WellKnownNamespaces; - - -public class CompactSyntax implements Context { - private static final int IN_ELEMENT = 0; - private static final int IN_ATTRIBUTE = 1; - private static final int IN_ANY_NAME = 2; - private static final int IN_NS_NAME = 4; - - private String defaultNamespace; - private String compatibilityPrefix = null; - private SchemaBuilder sb; - private NameClassBuilder ncb; - private String sourceUri; - /** - * This is what we are parsing right now. - */ - private CompactParseable parseable; - private ErrorHandler eh; - private final Hashtable namespaceTable = new Hashtable(); - private final Hashtable datatypesTable = new Hashtable(); - private boolean hadError = false; - private static final Localizer localizer = new Localizer(new Localizer(Parseable.class),CompactSyntax.class); - private final Hashtable attributeNameTable = new Hashtable(); - private boolean annotationsIncludeElements = false; - - /** - * String that represents the inherited namespace. - * - * <p> - * HACK: we always allocate a new String instance so that - * we can distinguish inherited value from the explicitly - * given value. - */ - private /*final*/ String inheritedNs; // essentially final but JavaCC don't let us declare it as so. - - final class LocatedString { - private final String str; - private final Token tok; - - LocatedString(String str, Token tok) { - this.str = str; - this.tok = tok; - } - - String getString() { - return str; - } - - Location getLocation() { - return makeLocation(tok); - } - - Token getToken() { - return tok; - } - - } - - public CompactSyntax(CompactParseable parseable, Reader r, String sourceUri, SchemaBuilder sb, ErrorHandler eh, String inheritedNs) { - this(r); - this.sourceUri = sourceUri; - this.parseable = parseable; - this.sb = sb; - this.ncb = sb.getNameClassBuilder(); - this.eh = eh; - // this causes the root pattern to have non-null annotations - // which is useful because it gives a context to trang - this.topLevelComments = sb.makeCommentList(); - this.inheritedNs = defaultNamespace = new String(inheritedNs); - } - - ParsedPattern parse(Scope scope) throws IllegalSchemaException { - try { - ParsedPattern p = Input(scope); - if (!hadError) - return p; - } - catch (ParseException e) { - error("syntax_error", e.getMessage(), e.currentToken.next); - } - catch (EscapeSyntaxException e) { - reportEscapeSyntaxException(e); - } - throw new IllegalSchemaException(); - } - - ParsedPattern parseInclude(IncludedGrammar g) throws IllegalSchemaException { - try { - ParsedPattern p = IncludedGrammar(g); - if (!hadError) - return p; - } - catch (ParseException e) { - error("syntax_error", e.getMessage(), e.currentToken.next); - } - catch (EscapeSyntaxException e) { - reportEscapeSyntaxException(e); - } - throw new IllegalSchemaException(); - } - - private void checkNsName(int context, LocatedString ns) { - if ((context & IN_NS_NAME) != 0) - error("ns_name_except_contains_ns_name", ns.getToken()); - } - - private void checkAnyName(int context, Token t) { - if ((context & IN_NS_NAME) != 0) - error("ns_name_except_contains_any_name", t); - if ((context & IN_ANY_NAME) != 0) - error("any_name_except_contains_any_name", t); - } - - private void error(String key, Token tok) { - doError(localizer.message(key), tok); - } - - private void error(String key, String arg, Token tok) { - doError(localizer.message(key, arg), tok); - } - - private void error(String key, String arg1, String arg2, Token tok) { - doError(localizer.message(key, arg1, arg2), tok); - } - - private void doError(String message, Token tok) { - hadError = true; - if (eh != null) { - LocatorImpl loc = new LocatorImpl(); - loc.setLineNumber(tok.beginLine); - loc.setColumnNumber(tok.beginColumn); - loc.setSystemId(sourceUri); - try { - eh.error(new SAXParseException(message, loc)); - } - catch (SAXException se) { - throw new BuildException(se); - } - } - } - - private void reportEscapeSyntaxException(EscapeSyntaxException e) { - if (eh != null) { - LocatorImpl loc = new LocatorImpl(); - loc.setLineNumber(e.getLineNumber()); - loc.setColumnNumber(e.getColumnNumber()); - loc.setSystemId(sourceUri); - try { - eh.error(new SAXParseException(localizer.message(e.getKey()), loc)); - } - catch (SAXException se) { - throw new BuildException(se); - } - } - } - - private static String unquote(String s) { - if (s.length() >= 6 && s.charAt(0) == s.charAt(1)) { - s = s.replace('\u0000', '\n'); - return s.substring(3, s.length() - 3); - } - else - return s.substring(1, s.length() - 1); - } - - Location makeLocation(Token t) { - return sb.makeLocation(sourceUri, t.beginLine, t.beginColumn); - } - - private static ParsedPattern[] addPattern(ParsedPattern[] patterns, int i, ParsedPattern p) { - if (i >= patterns.length) { - ParsedPattern[] oldPatterns = patterns; - patterns = new ParsedPattern[oldPatterns.length*2]; - System.arraycopy(oldPatterns, 0, patterns, 0, oldPatterns.length); - } - patterns[i] = p; - return patterns; - } - - String getCompatibilityPrefix() { - if (compatibilityPrefix == null) { - compatibilityPrefix = "a"; - while (namespaceTable.get(compatibilityPrefix) != null) - compatibilityPrefix = compatibilityPrefix + "a"; - } - return compatibilityPrefix; - } - - public String resolveNamespacePrefix(String prefix) { - String result = (String)namespaceTable.get(prefix); - if (result.length() == 0) - return null; - return result; - } - - public Enumeration prefixes() { - return namespaceTable.keys(); - } - - public String getBaseUri() { - return sourceUri; - } - - public boolean isUnparsedEntity(String entityName) { - return false; - } - - public boolean isNotation(String notationName) { - return false; - } - - public Context copy() { - return this; - } - - private Context getContext() { - return this; - } - - private CommentList getComments() { - return getComments(getTopLevelComments()); - } - - private CommentList topLevelComments; - - private CommentList getTopLevelComments() { - CommentList tem = topLevelComments; - topLevelComments = null; - return tem; - } - - private void noteTopLevelComments() { - topLevelComments = getComments(topLevelComments); - } - - private void topLevelComments(GrammarSection section) { - section.topLevelComment(getComments(null)); - } - - private Token lastCommentSourceToken = null; - - private CommentList getComments(CommentList comments) { - Token nextToken = getToken(1); - if (lastCommentSourceToken != nextToken) { - if (lastCommentSourceToken == null) - lastCommentSourceToken = token; - do { - lastCommentSourceToken = lastCommentSourceToken.next; - Token t = lastCommentSourceToken.specialToken; - if (t != null) { - while (t.specialToken != null) - t = t.specialToken; - if (comments == null) - comments = sb.makeCommentList(); - for (; t != null; t = t.next) { - String s = mungeComment(t.image); - Location loc = makeLocation(t); - if (t.next != null - && t.next.kind == CompactSyntaxConstants.SINGLE_LINE_COMMENT_CONTINUE) { - StringBuffer buf = new StringBuffer(s); - do { - t = t.next; - buf.append('\n'); - buf.append(mungeComment(t.image)); - } while (t.next != null - && t.next.kind == CompactSyntaxConstants.SINGLE_LINE_COMMENT_CONTINUE); - s = buf.toString(); - } - comments.addComment(s, loc); - } - } - } while (lastCommentSourceToken != nextToken); - } - return comments; - } - - private ParsedPattern afterComments(ParsedPattern p) { - CommentList comments = getComments(null); - if (comments == null) - return p; - return sb.commentAfter(p, comments); - } - - private ParsedNameClass afterComments(ParsedNameClass nc) { - CommentList comments = getComments(null); - if (comments == null) - return nc; - return ncb.commentAfter(nc, comments); - } - - private static String mungeComment(String image) { - int i = image.indexOf('#') + 1; - while (i < image.length() && image.charAt(i) == '#') - i++; - if (i < image.length() && image.charAt(i) == ' ') - i++; - return image.substring(i); - } - - private Annotations getCommentsAsAnnotations() { - CommentList comments = getComments(); - if (comments == null) - return null; - return sb.makeAnnotations(comments, getContext()); - } - - private Annotations addCommentsToChildAnnotations(Annotations a) { - CommentList comments = getComments(); - if (comments == null) - return a; - if (a == null) - a = sb.makeAnnotations(null, getContext()); - a.addComment(comments); - return a; - } - - private Annotations addCommentsToLeadingAnnotations(Annotations a) { - CommentList comments = getComments(); - if (comments == null) - return a; - if (a == null) - return sb.makeAnnotations(comments, getContext()); - a.addLeadingComment(comments); - return a; - } - - private Annotations getTopLevelCommentsAsAnnotations() { - CommentList comments = getTopLevelComments(); - if (comments == null) - return null; - return sb.makeAnnotations(comments, getContext()); - } - - private void clearAttributeList() { - attributeNameTable.clear(); - } - - private void addAttribute(Annotations a, String ns, String localName, String prefix, String value, Token tok) { - String key = ns + "#" + localName; - if (attributeNameTable.get(key) != null) - error("duplicate_attribute", ns, localName, tok); - else { - attributeNameTable.put(key, key); - a.addAttribute(ns, localName, prefix, value, makeLocation(tok)); - } - } - - private void checkExcept(Token[] except) { - if (except[0] != null) - error("except_missing_parentheses", except[0]); - } - - private String lookupPrefix(String prefix, Token t) { - String ns = (String)namespaceTable.get(prefix); - if (ns == null) { - error("undeclared_prefix", prefix, t); - return "#error"; - } - return ns; - } - private String lookupDatatype(String prefix, Token t) { - String ns = (String)datatypesTable.get(prefix); - if (ns == null) { - error("undeclared_prefix", prefix, t); - return ""; // XXX - } - return ns; - } - private String resolve(String str) { - try { - return new URL(new URL(sourceUri), str).toString(); - } - catch (MalformedURLException e) { } - return str; - } -} - -PARSER_END(CompactSyntax) - -ParsedPattern Input(Scope scope) : -{ - ParsedPattern p; -} -{ - Preamble() - (LOOKAHEAD(TopLevelLookahead()) p = TopLevelGrammar(scope) - | p = Expr(true, scope, null, null) { p = afterComments(p); } <EOF>) - { return p; } -} - -void TopLevelLookahead() : -{} -{ - <PREFIXED_NAME> "[" - | Identifier() ("[" | "=" | "&=" | "|=") - | LookaheadGrammarKeyword() - | LookaheadBody() LookaheadAfterAnnotations() - | LookaheadDocumentation() (LookaheadBody())? LookaheadAfterAnnotations() -} - -void LookaheadAfterAnnotations() : -{} -{ - Identifier() ("=" | "&=" | "|=") - | LookaheadGrammarKeyword() -} - -void LookaheadGrammarKeyword() : -{} -{ - "start" | "div" | "include" -} - -void LookaheadDocumentation() : -{} -{ - ((<DOCUMENTATION> | <DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT>) (<DOCUMENTATION_CONTINUE>)*)+ -} - -void LookaheadBody() : -{} -{ - "[" - (<PREFIXED_NAME> | UnprefixedName() | "=" | <LITERAL> | "~" | LookaheadBody() )* - "]" -} - -ParsedPattern IncludedGrammar(IncludedGrammar g) : -{ - Annotations a; - ParsedPattern p; -} -{ - Preamble() - (LOOKAHEAD(TopLevelLookahead()) a = GrammarBody(g, g, getTopLevelCommentsAsAnnotations()) - | a = Annotations() "grammar" "{" a = GrammarBody(g, g, a) { topLevelComments(g); } "}") - { p = afterComments(g.endIncludedGrammar(sb.makeLocation(sourceUri, 1, 1), a)); } - <EOF> - { return p; } -} - -ParsedPattern TopLevelGrammar(Scope scope) : -{ - Annotations a = getTopLevelCommentsAsAnnotations(); - Grammar g; - ParsedPattern p; -} -{ - { g = sb.makeGrammar(scope); } - a = GrammarBody(g, g, a) - { p = afterComments(g.endGrammar(sb.makeLocation(sourceUri, 1, 1), a)); } - <EOF> - { return p; } -} - -void Preamble() : -{} -{ - (NamespaceDecl() | DatatypesDecl())* - { - namespaceTable.put("xml", WellKnownNamespaces.XML); - if (datatypesTable.get("xsd") == null) - datatypesTable.put("xsd", WellKnownNamespaces.XML_SCHEMA_DATATYPES); - } -} - -void NamespaceDecl() : -{ - LocatedString prefix = null; - boolean isDefault = false; - String namespaceName; -} -{ - { noteTopLevelComments(); } - (("namespace" prefix = UnprefixedName()) - | ("default" { isDefault = true; } - "namespace" (prefix = UnprefixedName())?)) - "=" - namespaceName = NamespaceName() - { - if (isDefault) - defaultNamespace = namespaceName; - if (prefix != null) { - if (prefix.getString().equals("xmlns")) - error("xmlns_prefix", prefix.getToken()); - else if (prefix.getString().equals("xml")) { - if (!namespaceName.equals(WellKnownNamespaces.XML)) - error("xml_prefix_bad_uri", prefix.getToken()); - } - else if (namespaceName.equals(WellKnownNamespaces.XML)) - error("xml_uri_bad_prefix", prefix.getToken()); - else { - if (namespaceName.equals(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_ANNOTATIONS)) - compatibilityPrefix = prefix.getString(); - namespaceTable.put(prefix.getString(), namespaceName); - } - } - } -} - -String NamespaceName() : -{ - String r; -} -{ - (r = Literal() | "inherit" { r = this.inheritedNs; }) - { return r; } -} - -void DatatypesDecl() : -{ - LocatedString prefix; - String uri; -} -{ - { noteTopLevelComments(); } - "datatypes" prefix = UnprefixedName() "=" uri = Literal() - { - datatypesTable.put(prefix.getString(), uri); - } -} - -ParsedPattern AnnotatedPrimaryExpr(boolean topLevel, Scope scope, Token[] except) : -{ - Annotations a; - ParsedPattern p; - ParsedElementAnnotation e; - Token t; -} -{ - a = Annotations() - p = PrimaryExpr(topLevel, scope, a, except) - ( t = <FANNOTATE> e = AnnotationElement(false) { - if (topLevel) - error("top_level_follow_annotation", t); - else - p = sb.annotateAfter(p, e); - })* - { return p; } -} - - -ParsedPattern PrimaryExpr(boolean topLevel, Scope scope, Annotations a, Token[] except) : -{ - ParsedPattern p; -} -{ - (p = ElementExpr(scope, a) - | p = AttributeExpr(scope, a) - | p = GrammarExpr(scope, a) - | p = ExternalRefExpr(scope, a) - | p = ListExpr(scope, a) - | p = MixedExpr(scope, a) - | p = ParenExpr(topLevel, scope, a) - | p = IdentifierExpr(scope, a) - | p = ParentExpr(scope, a) - | p = DataExpr(topLevel, scope, a, except) - | p = ValueExpr(topLevel, a) - | p = TextExpr(a) - | p = EmptyExpr(a) - | p = NotAllowedExpr(a)) - { return p; } -} - -ParsedPattern EmptyExpr(Annotations a) : -{ - Token t; -} -{ - t = "empty" - { return sb.makeEmpty(makeLocation(t), a); } -} - -ParsedPattern TextExpr(Annotations a) : -{ - Token t; -} -{ - t = "text" - { return sb.makeText(makeLocation(t), a); } -} - -ParsedPattern NotAllowedExpr(Annotations a) : -{ - Token t; -} -{ - t = "notAllowed" - { return sb.makeNotAllowed(makeLocation(t), a); } -} - -ParsedPattern Expr(boolean topLevel, Scope scope, Token t, Annotations a) : -{ - List patterns = new ArrayList(); - ParsedPattern p; - boolean[] hadOccur = new boolean[1]; - Token[] except = new Token[1]; -} -{ - p = UnaryExpr(topLevel, scope, hadOccur, except) - { patterns.add(p); } - ( - { checkExcept(except); } - (t = "|" p = UnaryExpr(topLevel, scope, null, except) - { patterns.add(p); checkExcept(except); } )+ - { p = sb.makeChoice(patterns, makeLocation(t), a); } - | (t = "&" p = UnaryExpr(topLevel, scope, null, except) - { patterns.add(p); checkExcept(except); } )+ - { p = sb.makeInterleave(patterns, makeLocation(t), a); } - | (t = "," p = UnaryExpr(topLevel, scope, null, except) - { patterns.add(p); checkExcept(except); } )+ - { p = sb.makeGroup(patterns, makeLocation(t), a); } - )? - { - if (patterns.size() == 1 && a != null) { - if (hadOccur[0]) - p = sb.annotate(p, a); - else - p = sb.makeGroup(patterns, makeLocation(t), a); - } - return p; - } -} - -ParsedPattern UnaryExpr(boolean topLevel, Scope scope, boolean[] hadOccur, Token[] except) : -{ - ParsedPattern p; - Token t; - ParsedElementAnnotation e; -} -{ - p = AnnotatedPrimaryExpr(topLevel, scope, except) - ( - { - if (hadOccur != null) hadOccur[0] = true; - p = afterComments(p); - } - (t = "+" { checkExcept(except); p = sb.makeOneOrMore(p, makeLocation(t), null); } - | t = "?" { checkExcept(except); p = sb.makeOptional(p, makeLocation(t), null); } - | t = "*" { checkExcept(except); p = sb.makeZeroOrMore(p, makeLocation(t), null); }) - ( t = <FANNOTATE> e = AnnotationElement(false) { - if (topLevel) - error("top_level_follow_annotation", t); - else - p = sb.annotateAfter(p, e); - } )* - )? - { return p; } -} - -ParsedPattern ElementExpr(Scope scope, Annotations a) : -{ - Token t; - ParsedNameClass nc; - ParsedPattern p; -} -{ - t = "element" - nc = NameClass(IN_ELEMENT, null) - "{" - p = Expr(false, scope, null, null) - { p = afterComments(p); } - "}" - { return sb.makeElement(nc, p, makeLocation(t), a); } -} - -ParsedPattern AttributeExpr(Scope scope, Annotations a) : -{ - Token t; - ParsedNameClass nc; - ParsedPattern p; -} -{ - t = "attribute" - nc = NameClass(IN_ATTRIBUTE, null) - "{" - p = Expr(false, scope, null, null) - { p = afterComments(p); } - "}" - { return sb.makeAttribute(nc, p, makeLocation(t), a); } -} - -ParsedNameClass NameClass(int context, Annotations[] pa) : -{ - Annotations a; - ParsedNameClass nc; -} -{ - a = Annotations() - (nc = PrimaryNameClass(context, a) nc = AnnotateAfter(nc) nc = NameClassAlternatives(context, nc, pa) - | nc = AnyNameExceptClass(context, a, pa) - | nc = NsNameExceptClass(context, a, pa)) - { return nc; } -} - -ParsedNameClass AnnotateAfter(ParsedNameClass nc) : -{ - ParsedElementAnnotation e; -} -{ - ( <FANNOTATE> e = AnnotationElement(false) { nc = ncb.annotateAfter(nc, e); })* - { return nc; } -} - -ParsedNameClass NameClassAlternatives(int context, ParsedNameClass nc, Annotations[] pa) : -{ - Token t; - ParsedNameClass[] nameClasses; - int nNameClasses; -} -{ - ( - { - nameClasses = new ParsedNameClass[2]; - nameClasses[0] = nc; - nNameClasses = 1; - } - (t = "|" nc = BasicNameClass(context) nc = AnnotateAfter(nc) - { - if (nNameClasses >= nameClasses.length) { - ParsedNameClass[] oldNameClasses = nameClasses; - nameClasses = new ParsedNameClass[oldNameClasses.length*2]; - System.arraycopy(oldNameClasses, 0, nameClasses, 0, oldNameClasses.length); - } - nameClasses[nNameClasses++] = nc; - })+ - { - Annotations a; - if (pa == null) - a = null; - else { - a = pa[0]; - pa[0] = null; - } - nc = ncb.makeChoice(Arrays.asList(nameClasses).subList(0,nNameClasses), makeLocation(t), a); - } - )? - { return nc; } -} - -ParsedNameClass BasicNameClass(int context) : -{ - Annotations a; - ParsedNameClass nc; -} -{ - a = Annotations() - (nc = PrimaryNameClass(context, a) - | nc = OpenNameClass(context, a)) - { return nc; } -} - -ParsedNameClass PrimaryNameClass(int context, Annotations a) : -{ - ParsedNameClass nc; -} -{ - (nc = UnprefixedNameClass(context, a) - | nc = PrefixedNameClass(a) - | nc = ParenNameClass(context, a)) - { return nc; } -} - -ParsedNameClass OpenNameClass(int context, Annotations a) : -{ - Token t; - LocatedString ns; -} -{ - ns = NsName() { checkNsName(context, ns); return ncb.makeNsName(ns.getString(), ns.getLocation(), a); } - | t = "*" { checkAnyName(context, t); return ncb.makeAnyName(makeLocation(t), a); } -} - - -ParsedNameClass UnprefixedNameClass(int context, Annotations a) : -{ - LocatedString name; -} -{ - name = UnprefixedName() - { - String ns; - if ((context & (IN_ATTRIBUTE|IN_ELEMENT)) == IN_ATTRIBUTE) - ns = ""; - else - ns = defaultNamespace; - return ncb.makeName(ns, name.getString(), null, name.getLocation(), a); - } -} - -ParsedNameClass PrefixedNameClass(Annotations a) : -{ - Token t; -} -{ - t = <PREFIXED_NAME> - { - String qn = t.image; - int colon = qn.indexOf(':'); - String prefix = qn.substring(0, colon); - return ncb.makeName(lookupPrefix(prefix, t), qn.substring(colon + 1), prefix, makeLocation(t), a); - } -} - -ParsedNameClass NsNameExceptClass(int context, Annotations a, Annotations[] pa) : -{ - LocatedString ns; - ParsedNameClass nc; -} -{ - ns = NsName() - { checkNsName(context, ns); } - (nc = ExceptNameClass(context | IN_NS_NAME) - { nc = ncb.makeNsName(ns.getString(), nc, ns.getLocation(), a); } - nc = AnnotateAfter(nc) - | { nc = ncb.makeNsName(ns.getString(), ns.getLocation(), a); } - nc = AnnotateAfter(nc) - nc = NameClassAlternatives(context, nc, pa)) - { return nc; } -} - -LocatedString NsName() : -{ - Token t; -} -{ - t = <PREFIX_STAR> - { - String qn = t.image; - String prefix = qn.substring(0, qn.length() - 2); - return new LocatedString(lookupPrefix(prefix, t), t); - } -} - -ParsedNameClass AnyNameExceptClass(int context, Annotations a, Annotations[] pa) : -{ - Token t; - ParsedNameClass nc; -} -{ - t = "*" - { checkAnyName(context, t); } - (nc = ExceptNameClass(context | IN_ANY_NAME) - { nc = ncb.makeAnyName(nc, makeLocation(t), a); } - nc = AnnotateAfter(nc) - | { nc = ncb.makeAnyName(makeLocation(t), a); } - nc = AnnotateAfter(nc) - nc = NameClassAlternatives(context, nc, pa)) - { return nc; } -} - -ParsedNameClass ParenNameClass(int context, Annotations a) : -{ - Token t; - ParsedNameClass nc; - Annotations[] pa = new Annotations[]{ a }; -} -{ - t = "(" nc = NameClass(context, pa) { nc = afterComments(nc); } ")" - { - if (pa[0] != null) - nc = ncb.makeChoice(Collections.singletonList(nc), makeLocation(t), pa[0]); - return nc; - } -} - -ParsedNameClass ExceptNameClass(int context) : -{ - ParsedNameClass nc; -} -{ - "-" nc = BasicNameClass(context) - { return nc; } -} - -ParsedPattern ListExpr(Scope scope, Annotations a) : -{ - Token t; - ParsedPattern p; -} -{ - t = "list" - "{" - p = Expr(false, scope, null, null) - { p = afterComments(p); } - "}" - { return sb.makeList(p, makeLocation(t), a); } -} - -ParsedPattern MixedExpr(Scope scope, Annotations a) : -{ - Token t; - ParsedPattern p; -} -{ - t = "mixed" - "{" - p = Expr(false, scope, null, null) - { p = afterComments(p); } - "}" - { return sb.makeMixed(p, makeLocation(t), a); } -} - -ParsedPattern GrammarExpr(Scope scope, Annotations a) : -{ - Token t; - Grammar g; -} -{ - t = "grammar" { g = sb.makeGrammar(scope); } - "{" a = GrammarBody(g, g, a) { topLevelComments(g); } "}" - { return g.endGrammar(makeLocation(t), a); } -} - -ParsedPattern ParenExpr(boolean topLevel, Scope scope, Annotations a) : -{ - Token t; - ParsedPattern p; -} -{ - t = "(" p = Expr(topLevel, scope, t, a) { p = afterComments(p); } ")" - { return p; } -} - -Annotations GrammarBody(GrammarSection section, Scope scope, Annotations a) : -{ - ParsedElementAnnotation e; -} -{ - (LOOKAHEAD(2) e = AnnotationElementNotKeyword() - { if (a == null) a = sb.makeAnnotations(null, getContext()); a.addElement(e); })* - (GrammarComponent(section, scope))* - { return a; } -} - -void GrammarComponent(GrammarSection section, Scope scope) : -{ - ParsedElementAnnotation e; - Annotations a; -} -{ - (a = Annotations() - (Definition(section, scope, a) - | Include(section, scope, a) - | Div(section, scope, a))) - (LOOKAHEAD(2) e = AnnotationElementNotKeyword() { section.topLevelAnnotation(e); })* -} - -void Definition(GrammarSection section, Scope scope, Annotations a) : -{} -{ - (Define(section, scope, a) | Start(section, scope, a)) -} - -void Start(GrammarSection section, Scope scope, Annotations a) : -{ - Token t; - GrammarSection.Combine combine; - ParsedPattern p; -} -{ - t = "start" combine = AssignOp() p = Expr(false, scope, null, null) - { section.define(GrammarSection.START, combine, p, makeLocation(t), a); } -} - -void Define(GrammarSection section, Scope scope, Annotations a) : -{ - LocatedString name; - GrammarSection.Combine combine; - ParsedPattern p; -} -{ - name = Identifier() combine = AssignOp() p = Expr(false, scope, null, null) - { section.define(name.getString(), combine, p, name.getLocation(), a); } -} - -GrammarSection.Combine AssignOp() : -{} -{ - "=" { return null; } - | "|=" { return GrammarSection.COMBINE_CHOICE; } - | "&=" { return GrammarSection.COMBINE_INTERLEAVE; } -} - -void Include(GrammarSection section, Scope scope, Annotations a) : -{ - Token t; - String href; - String ns; - Include include = section.makeInclude(); -} -{ - t = "include" href = Literal() - ns = Inherit() - ("{" a = IncludeBody(include, scope, a) { topLevelComments(include); } "}")? - { - try { - include.endInclude(parseable, resolve(href), ns, makeLocation(t), a); - } - catch (IllegalSchemaException e) { } - } -} - -Annotations IncludeBody(GrammarSection section, Scope scope, Annotations a) : -{ - ParsedElementAnnotation e; -} -{ - (LOOKAHEAD(2) e = AnnotationElementNotKeyword() - { if (a == null) a = sb.makeAnnotations(null, getContext()); a.addElement(e); })* - (IncludeComponent(section, scope))* - { return a; } -} - - -void IncludeComponent(GrammarSection section, Scope scope) : -{ - ParsedElementAnnotation e; - Annotations a; -} -{ - (a = Annotations() (Definition(section, scope, a) - | IncludeDiv(section, scope, a))) - (LOOKAHEAD(2) e = AnnotationElementNotKeyword() { section.topLevelAnnotation(e); })* -} - -void Div(GrammarSection section, Scope scope, Annotations a) : -{ - Token t; - Div div = section.makeDiv(); -} -{ - t = "div" "{" a = GrammarBody(div, scope, a) { topLevelComments(div); } "}" - { div.endDiv(makeLocation(t), a); } -} - -void IncludeDiv(GrammarSection section, Scope scope, Annotations a) : -{ - Token t; - Div div = section.makeDiv(); -} -{ - t = "div" "{" a = IncludeBody(div, scope, a) { topLevelComments(div); } "}" - { div.endDiv(makeLocation(t), a); } -} - -ParsedPattern ExternalRefExpr(Scope scope, Annotations a) : -{ - Token t; - String href; - String ns; -} -{ - t = "external" href = Literal() - ns = Inherit() - { - try { - return sb.makeExternalRef(parseable, resolve(href), ns, scope, makeLocation(t), a); - } - catch (IllegalSchemaException e) { - return sb.makeErrorPattern(); - } - } -} - -String Inherit() : -{ - String ns = null; -} -{ - ("inherit" "=" ns = Prefix())? - { - if (ns == null) - ns = defaultNamespace; - return ns; - } -} - -ParsedPattern ParentExpr(Scope scope, Annotations a) : -{ - LocatedString name; -} -{ - "parent" { a = addCommentsToChildAnnotations(a); } name = Identifier() - { - if(scope==null) { - error("parent_ref_outside_grammar",name.getToken()); - return sb.makeErrorPattern(); - } else { - return scope.makeParentRef(name.getString(), name.getLocation(), a); - } - } -} - -ParsedPattern IdentifierExpr(Scope scope, Annotations a) : -{ - LocatedString name; -} -{ - name = Identifier() - { - if(scope==null) { - error("ref_outside_grammar",name.getToken()); - return sb.makeErrorPattern(); - } else { - return scope.makeRef(name.getString(), name.getLocation(), a); - } - } -} - -ParsedPattern ValueExpr(boolean topLevel, Annotations a) : -{ - LocatedString s; -} -{ - s = LocatedLiteral() - { - if (topLevel && annotationsIncludeElements) { - error("top_level_follow_annotation", s.getToken()); - a = null; - } - return sb.makeValue("", "token", s.getString(), getContext(), defaultNamespace, s.getLocation(), a); - } -} - -ParsedPattern DataExpr(boolean topLevel, Scope scope, Annotations a, Token[] except) : -{ - Token datatypeToken; - Location loc; - String datatype; - String datatypeUri = null; - String s = null; - ParsedPattern e = null; - DataPatternBuilder dpb; -} -{ - datatypeToken = DatatypeName() - { - datatype = datatypeToken.image; - loc = makeLocation(datatypeToken); - int colon = datatype.indexOf(':'); - if (colon < 0) - datatypeUri = ""; - else { - String prefix = datatype.substring(0, colon); - datatypeUri = lookupDatatype(prefix, datatypeToken); - datatype = datatype.substring(colon + 1); - } - } - ((s = Literal() - { - if (topLevel && annotationsIncludeElements) { - error("top_level_follow_annotation", datatypeToken); - a = null; - } - return sb.makeValue(datatypeUri, datatype, s, getContext(), defaultNamespace, loc, a); - } - ) - | ( { dpb = sb.makeDataPatternBuilder(datatypeUri, datatype, loc); } - ( (Params(dpb) (e = Except(scope, except))?) - | (e = Except(scope, except))?) - { return e == null ? dpb.makePattern(loc, a) : dpb.makePattern(e, loc, a); })) -} - -Token DatatypeName() : -{ - Token t; -} -{ - (t = "string" | t = "token" | t = <PREFIXED_NAME>) - { return t; } -} - -LocatedString Identifier() : -{ - LocatedString s; - Token t; -} -{ - (t = <IDENTIFIER> { s = new LocatedString(t.image, t); } - | t = <ESCAPED_IDENTIFIER> { s = new LocatedString(t.image.substring(1), t); }) - { return s; } -} - -String Prefix() : -{ - Token t; - String prefix; -} -{ - (t = <IDENTIFIER> { prefix = t.image; } - | t = <ESCAPED_IDENTIFIER> { prefix = t.image.substring(1); } - | t = Keyword() { prefix = t.image; }) - { return lookupPrefix(prefix, t); } -} - -LocatedString UnprefixedName() : -{ - LocatedString s; - Token t; -} -{ - (s = Identifier() - | t = Keyword() { s = new LocatedString(t.image, t); }) - { return s; } -} - -void Params(DataPatternBuilder dpb) : -{} -{ - "{" (Param(dpb))* "}" -} - -void Param(DataPatternBuilder dpb) : -{ - LocatedString name; - Annotations a; - String value; -} -{ - a = Annotations() name = UnprefixedName() "=" { a = addCommentsToLeadingAnnotations(a); } value = Literal() - { dpb.addParam(name.getString(), value, getContext(), defaultNamespace, name.getLocation(), a); } -} - -ParsedPattern Except(Scope scope, Token[] except) : -{ - Annotations a; - ParsedPattern p; - Token t; - Token[] innerExcept = new Token[1]; -} -{ - t = "-" a = Annotations() p = PrimaryExpr(false, scope, a, innerExcept) - { - checkExcept(innerExcept); - except[0] = t; - return p; - } -} - -ParsedElementAnnotation Documentation() : -{ - CommentList comments = getComments(); - ElementAnnotationBuilder eab; - Token t; -} -{ - (t = <DOCUMENTATION> | t = <DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT>) - { - eab = sb.makeElementAnnotationBuilder(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_ANNOTATIONS, - "documentation", - getCompatibilityPrefix(), - makeLocation(t), - comments, - getContext()); - eab.addText(mungeComment(t.image), makeLocation(t), null); - } - (t = <DOCUMENTATION_CONTINUE> { eab.addText("\n" + mungeComment(t.image), makeLocation(t), null); })* - { return eab.makeElementAnnotation(); } -} - -Annotations Annotations() : -{ - CommentList comments = getComments(); - Annotations a = null; - ParsedElementAnnotation e; -} -{ - ( { a = sb.makeAnnotations(comments, getContext()); } - (e = Documentation() { a.addElement(e); })+ - { - comments = getComments(); - if (comments != null) - a.addLeadingComment(comments); - } - )? - ("[" { if (a == null) a = sb.makeAnnotations(comments, getContext()); clearAttributeList(); annotationsIncludeElements = false; } - (LOOKAHEAD(2) PrefixedAnnotationAttribute(a, false) )* - ( e = AnnotationElement(false) { a.addElement(e); annotationsIncludeElements = true; } )* - { a.addComment(getComments()); } - "]")? - { - if (a == null && comments != null) - a = sb.makeAnnotations(comments, getContext()); - return a; - } -} - -void AnnotationAttribute(Annotations a) : -{} -{ - PrefixedAnnotationAttribute(a, true) | UnprefixedAnnotationAttribute(a) -} - -void PrefixedAnnotationAttribute(Annotations a, boolean nested) : -{ - Token t; - String value; -} -{ - t = <PREFIXED_NAME> "=" value = Literal() - { - String qn = t.image; - int colon = qn.indexOf(':'); - String prefix = qn.substring(0, colon); - String ns = lookupPrefix(prefix, t); - if (ns == this.inheritedNs) - error("inherited_annotation_namespace", t); - else if (ns.length() == 0 && !nested) - error("unqualified_annotation_attribute", t); - else if (ns.equals(WellKnownNamespaces.RELAX_NG) && !nested) - error("relax_ng_namespace", t); - /*else if (ns.length() == 0 - && qn.length() - colon - 1 == 5 - && qn.regionMatches(colon + 1, "xmlns", 0, 5)) - error("xmlns_annotation_attribute", t);*/ - else if (ns.equals(WellKnownNamespaces.XMLNS)) - error("xmlns_annotation_attribute_uri", t); - else { - if (ns.length() == 0) - prefix = null; - addAttribute(a, ns, qn.substring(colon + 1), prefix, value, t); - } - } -} - -void UnprefixedAnnotationAttribute(Annotations a) : -{ - LocatedString name; - String value; -} -{ - name = UnprefixedName() "=" value = Literal() - { - if (name.getString().equals("xmlns")) - error("xmlns_annotation_attribute", name.getToken()); - else - addAttribute(a, "", name.getString(), null, value, name.getToken()); - } -} - -ParsedElementAnnotation AnnotationElement(boolean nested) : -{ - ParsedElementAnnotation a; -} -{ - (a = PrefixedAnnotationElement(nested) - | a = UnprefixedAnnotationElement()) - { return a; } -} - -ParsedElementAnnotation AnnotationElementNotKeyword() : -{ - ParsedElementAnnotation a; -} -{ - (a = PrefixedAnnotationElement(false) - | a = IdentifierAnnotationElement()) - { return a; } -} - -ParsedElementAnnotation PrefixedAnnotationElement(boolean nested) : -{ - CommentList comments = getComments(); - Token t; - ElementAnnotationBuilder eab; -} -{ - t = <PREFIXED_NAME> - { - String qn = t.image; - int colon = qn.indexOf(':'); - String prefix = qn.substring(0, colon); - String ns = lookupPrefix(prefix, t); - if (ns == this.inheritedNs) { - error("inherited_annotation_namespace", t); - ns = ""; - } - else if (!nested && ns.equals(WellKnownNamespaces.RELAX_NG)) { - error("relax_ng_namespace", t); - ns = ""; - } - else { - if (ns.length() == 0) - prefix = null; - } - eab = sb.makeElementAnnotationBuilder(ns, qn.substring(colon + 1), prefix, - makeLocation(t), comments, getContext()); - } - AnnotationElementContent(eab) - { return eab.makeElementAnnotation(); } -} - -ParsedElementAnnotation UnprefixedAnnotationElement() : -{ - CommentList comments = getComments(); - LocatedString name; - ElementAnnotationBuilder eab; -} -{ - name = UnprefixedName() - { - eab = sb.makeElementAnnotationBuilder("", name.getString(), null, - name.getLocation(), comments, getContext()); - } - AnnotationElementContent(eab) - { return eab.makeElementAnnotation(); } -} - -ParsedElementAnnotation IdentifierAnnotationElement() : -{ - CommentList comments = getComments(); - LocatedString name; - ElementAnnotationBuilder eab; -} -{ - name = Identifier() - { - eab = sb.makeElementAnnotationBuilder("", name.getString(), null, - name.getLocation(), comments, getContext()); - } - AnnotationElementContent(eab) - { return eab.makeElementAnnotation(); } -} - -void AnnotationElementContent(ElementAnnotationBuilder eab) : -{ - ParsedElementAnnotation e; -} -{ - "[" { clearAttributeList(); } - (LOOKAHEAD(2) AnnotationAttribute(eab))* - ((AnnotationElementLiteral(eab) - ("~" AnnotationElementLiteral(eab))*) - | e = AnnotationElement(true) { eab.addElement(e); })* - { eab.addComment(getComments()); } - "]" -} - -void AnnotationElementLiteral(ElementAnnotationBuilder eab) : -{ - Token t; - CommentList comments = getComments(); -} -{ - t = <LITERAL> { eab.addText(unquote(t.image), makeLocation(t), comments); } -} - -String Literal() : -{ - Token t; - String s; - StringBuffer buf; -} -{ - t = <LITERAL> - { - s = unquote(t.image); - } - ( - { buf = new StringBuffer(s); } - ("~" t = <LITERAL> { buf.append(unquote(t.image)); })+ - { s = buf.toString(); } - )? - { return s; } -} - -LocatedString LocatedLiteral() : -{ - Token t; - Token t2; - String s; - StringBuffer buf; -} -{ - t = <LITERAL> - { - s = unquote(t.image); - } - ( - { buf = new StringBuffer(s); } - ("~" t2 = <LITERAL> { buf.append(unquote(t2.image)); })+ - { s = buf.toString(); } - )? - { return new LocatedString(s, t); } -} - -Token Keyword() : -{ - Token t; -} -{ - (t = "element" - | t = "attribute" - | t = "namespace" - | t = "list" - | t = "mixed" - | t = "grammar" - | t = "empty" - | t = "text" - | t = "parent" - | t = "external" - | t = "notAllowed" - | t = "start" - | t = "include" - | t = "default" - | t = "inherit" - | t = "string" - | t = "token" - | t = "datatypes" - | t = "div") - { return t; } -} - -<*> -SKIP: { - < #NEWLINE : [ "\u0000", "\n" ] > - | < #NOT_NEWLINE : ~[ "\u0000", "\n" ] > - | < WS: ([ "\u0000", " ", "\n", "\t" ])+ > : DEFAULT -} - -TOKEN : -{ - < DOCUMENTATION: "##" (<NOT_NEWLINE>)* > : AFTER_DOCUMENTATION -} - -<AFTER_DOCUMENTATION> -TOKEN : -{ - < DOCUMENTATION_CONTINUE: <NEWLINE> ([" ", "\t"])* <DOCUMENTATION> > -} - -SPECIAL_TOKEN: -{ - < SINGLE_LINE_COMMENT: "#" (<NOT_NEWLINE>)* > : AFTER_SINGLE_LINE_COMMENT -} - -<AFTER_SINGLE_LINE_COMMENT> -TOKEN : -{ - < DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: <NEWLINE> ([" ", "\t"])* <DOCUMENTATION> > : AFTER_DOCUMENTATION -} - -<AFTER_SINGLE_LINE_COMMENT> -SPECIAL_TOKEN : -{ - < SINGLE_LINE_COMMENT_CONTINUE: <NEWLINE> ([" ", "\t"])* <SINGLE_LINE_COMMENT> > -} - -TOKEN : -{ - < #BASE_CHAR : [ - "\u0041" - "\u005a", - "\u0061" - "\u007a", - "\u00c0" - "\u00d6", - "\u00d8" - "\u00f6", - "\u00f8" - "\u00ff", - "\u0100" - "\u0131", - "\u0134" - "\u013e", - "\u0141" - "\u0148", - "\u014a" - "\u017e", - "\u0180" - "\u01c3", - "\u01cd" - "\u01f0", - "\u01f4" - "\u01f5", - "\u01fa" - "\u0217", - "\u0250" - "\u02a8", - "\u02bb" - "\u02c1", - "\u0386", - "\u0388" - "\u038a", - "\u038c", - "\u038e" - "\u03a1", - "\u03a3" - "\u03ce", - "\u03d0" - "\u03d6", - "\u03da", - "\u03dc", - "\u03de", - "\u03e0", - "\u03e2" - "\u03f3", - "\u0401" - "\u040c", - "\u040e" - "\u044f", - "\u0451" - "\u045c", - "\u045e" - "\u0481", - "\u0490" - "\u04c4", - "\u04c7" - "\u04c8", - "\u04cb" - "\u04cc", - "\u04d0" - "\u04eb", - "\u04ee" - "\u04f5", - "\u04f8" - "\u04f9", - "\u0531" - "\u0556", - "\u0559", - "\u0561" - "\u0586", - "\u05d0" - "\u05ea", - "\u05f0" - "\u05f2", - "\u0621" - "\u063a", - "\u0641" - "\u064a", - "\u0671" - "\u06b7", - "\u06ba" - "\u06be", - "\u06c0" - "\u06ce", - "\u06d0" - "\u06d3", - "\u06d5", - "\u06e5" - "\u06e6", - "\u0905" - "\u0939", - "\u093d", - "\u0958" - "\u0961", - "\u0985" - "\u098c", - "\u098f" - "\u0990", - "\u0993" - "\u09a8", - "\u09aa" - "\u09b0", - "\u09b2", - "\u09b6" - "\u09b9", - "\u09dc" - "\u09dd", - "\u09df" - "\u09e1", - "\u09f0" - "\u09f1", - "\u0a05" - "\u0a0a", - "\u0a0f" - "\u0a10", - "\u0a13" - "\u0a28", - "\u0a2a" - "\u0a30", - "\u0a32" - "\u0a33", - "\u0a35" - "\u0a36", - "\u0a38" - "\u0a39", - "\u0a59" - "\u0a5c", - "\u0a5e", - "\u0a72" - "\u0a74", - "\u0a85" - "\u0a8b", - "\u0a8d", - "\u0a8f" - "\u0a91", - "\u0a93" - "\u0aa8", - "\u0aaa" - "\u0ab0", - "\u0ab2" - "\u0ab3", - "\u0ab5" - "\u0ab9", - "\u0abd", - "\u0ae0", - "\u0b05" - "\u0b0c", - "\u0b0f" - "\u0b10", - "\u0b13" - "\u0b28", - "\u0b2a" - "\u0b30", - "\u0b32" - "\u0b33", - "\u0b36" - "\u0b39", - "\u0b3d", - "\u0b5c" - "\u0b5d", - "\u0b5f" - "\u0b61", - "\u0b85" - "\u0b8a", - "\u0b8e" - "\u0b90", - "\u0b92" - "\u0b95", - "\u0b99" - "\u0b9a", - "\u0b9c", - "\u0b9e" - "\u0b9f", - "\u0ba3" - "\u0ba4", - "\u0ba8" - "\u0baa", - "\u0bae" - "\u0bb5", - "\u0bb7" - "\u0bb9", - "\u0c05" - "\u0c0c", - "\u0c0e" - "\u0c10", - "\u0c12" - "\u0c28", - "\u0c2a" - "\u0c33", - "\u0c35" - "\u0c39", - "\u0c60" - "\u0c61", - "\u0c85" - "\u0c8c", - "\u0c8e" - "\u0c90", - "\u0c92" - "\u0ca8", - "\u0caa" - "\u0cb3", - "\u0cb5" - "\u0cb9", - "\u0cde", - "\u0ce0" - "\u0ce1", - "\u0d05" - "\u0d0c", - "\u0d0e" - "\u0d10", - "\u0d12" - "\u0d28", - "\u0d2a" - "\u0d39", - "\u0d60" - "\u0d61", - "\u0e01" - "\u0e2e", - "\u0e30", - "\u0e32" - "\u0e33", - "\u0e40" - "\u0e45", - "\u0e81" - "\u0e82", - "\u0e84", - "\u0e87" - "\u0e88", - "\u0e8a", - "\u0e8d", - "\u0e94" - "\u0e97", - "\u0e99" - "\u0e9f", - "\u0ea1" - "\u0ea3", - "\u0ea5", - "\u0ea7", - "\u0eaa" - "\u0eab", - "\u0ead" - "\u0eae", - "\u0eb0", - "\u0eb2" - "\u0eb3", - "\u0ebd", - "\u0ec0" - "\u0ec4", - "\u0f40" - "\u0f47", - "\u0f49" - "\u0f69", - "\u10a0" - "\u10c5", - "\u10d0" - "\u10f6", - "\u1100", - "\u1102" - "\u1103", - "\u1105" - "\u1107", - "\u1109", - "\u110b" - "\u110c", - "\u110e" - "\u1112", - "\u113c", - "\u113e", - "\u1140", - "\u114c", - "\u114e", - "\u1150", - "\u1154" - "\u1155", - "\u1159", - "\u115f" - "\u1161", - "\u1163", - "\u1165", - "\u1167", - "\u1169", - "\u116d" - "\u116e", - "\u1172" - "\u1173", - "\u1175", - "\u119e", - "\u11a8", - "\u11ab", - "\u11ae" - "\u11af", - "\u11b7" - "\u11b8", - "\u11ba", - "\u11bc" - "\u11c2", - "\u11eb", - "\u11f0", - "\u11f9", - "\u1e00" - "\u1e9b", - "\u1ea0" - "\u1ef9", - "\u1f00" - "\u1f15", - "\u1f18" - "\u1f1d", - "\u1f20" - "\u1f45", - "\u1f48" - "\u1f4d", - "\u1f50" - "\u1f57", - "\u1f59", - "\u1f5b", - "\u1f5d", - "\u1f5f" - "\u1f7d", - "\u1f80" - "\u1fb4", - "\u1fb6" - "\u1fbc", - "\u1fbe", - "\u1fc2" - "\u1fc4", - "\u1fc6" - "\u1fcc", - "\u1fd0" - "\u1fd3", - "\u1fd6" - "\u1fdb", - "\u1fe0" - "\u1fec", - "\u1ff2" - "\u1ff4", - "\u1ff6" - "\u1ffc", - "\u2126", - "\u212a" - "\u212b", - "\u212e", - "\u2180" - "\u2182", - "\u3041" - "\u3094", - "\u30a1" - "\u30fa", - "\u3105" - "\u312c", - "\uac00" - "\ud7a3" - ] > - | < #IDEOGRAPHIC : [ - "\u4e00" - "\u9fa5", - "\u3007", - "\u3021" - "\u3029" - ] > - | < #LETTER : (<BASE_CHAR> | <IDEOGRAPHIC>) > - | < #COMBINING_CHAR : [ - "\u0300" - "\u0345", - "\u0360" - "\u0361", - "\u0483" - "\u0486", - "\u0591" - "\u05a1", - "\u05a3" - "\u05b9", - "\u05bb" - "\u05bd", - "\u05bf", - "\u05c1" - "\u05c2", - "\u05c4", - "\u064b" - "\u0652", - "\u0670", - "\u06d6" - "\u06dc", - "\u06dd" - "\u06df", - "\u06e0" - "\u06e4", - "\u06e7" - "\u06e8", - "\u06ea" - "\u06ed", - "\u0901" - "\u0903", - "\u093c", - "\u093e" - "\u094c", - "\u094d", - "\u0951" - "\u0954", - "\u0962" - "\u0963", - "\u0981" - "\u0983", - "\u09bc", - "\u09be", - "\u09bf", - "\u09c0" - "\u09c4", - "\u09c7" - "\u09c8", - "\u09cb" - "\u09cd", - "\u09d7", - "\u09e2" - "\u09e3", - "\u0a02", - "\u0a3c", - "\u0a3e", - "\u0a3f", - "\u0a40" - "\u0a42", - "\u0a47" - "\u0a48", - "\u0a4b" - "\u0a4d", - "\u0a70" - "\u0a71", - "\u0a81" - "\u0a83", - "\u0abc", - "\u0abe" - "\u0ac5", - "\u0ac7" - "\u0ac9", - "\u0acb" - "\u0acd", - "\u0b01" - "\u0b03", - "\u0b3c", - "\u0b3e" - "\u0b43", - "\u0b47" - "\u0b48", - "\u0b4b" - "\u0b4d", - "\u0b56" - "\u0b57", - "\u0b82" - "\u0b83", - "\u0bbe" - "\u0bc2", - "\u0bc6" - "\u0bc8", - "\u0bca" - "\u0bcd", - "\u0bd7", - "\u0c01" - "\u0c03", - "\u0c3e" - "\u0c44", - "\u0c46" - "\u0c48", - "\u0c4a" - "\u0c4d", - "\u0c55" - "\u0c56", - "\u0c82" - "\u0c83", - "\u0cbe" - "\u0cc4", - "\u0cc6" - "\u0cc8", - "\u0cca" - "\u0ccd", - "\u0cd5" - "\u0cd6", - "\u0d02" - "\u0d03", - "\u0d3e" - "\u0d43", - "\u0d46" - "\u0d48", - "\u0d4a" - "\u0d4d", - "\u0d57", - "\u0e31", - "\u0e34" - "\u0e3a", - "\u0e47" - "\u0e4e", - "\u0eb1", - "\u0eb4" - "\u0eb9", - "\u0ebb" - "\u0ebc", - "\u0ec8" - "\u0ecd", - "\u0f18" - "\u0f19", - "\u0f35", - "\u0f37", - "\u0f39", - "\u0f3e", - "\u0f3f", - "\u0f71" - "\u0f84", - "\u0f86" - "\u0f8b", - "\u0f90" - "\u0f95", - "\u0f97", - "\u0f99" - "\u0fad", - "\u0fb1" - "\u0fb7", - "\u0fb9", - "\u20d0" - "\u20dc", - "\u20e1", - "\u302a" - "\u302f", - "\u3099", - "\u309a" - ] > - | < #DIGIT : [ - "\u0030" - "\u0039", - "\u0660" - "\u0669", - "\u06f0" - "\u06f9", - "\u0966" - "\u096f", - "\u09e6" - "\u09ef", - "\u0a66" - "\u0a6f", - "\u0ae6" - "\u0aef", - "\u0b66" - "\u0b6f", - "\u0be7" - "\u0bef", - "\u0c66" - "\u0c6f", - "\u0ce6" - "\u0cef", - "\u0d66" - "\u0d6f", - "\u0e50" - "\u0e59", - "\u0ed0" - "\u0ed9", - "\u0f20" - "\u0f29" - ] > - | < #EXTENDER : [ - "\u00b7", - "\u02d0", - "\u02d1", - "\u0387", - "\u0640", - "\u0e46", - "\u0ec6", - "\u3005", - "\u3031" - "\u3035", - "\u309d" - "\u309e", - "\u30fc" - "\u30fe" - ] > - | < #NMSTART : (<LETTER> | "_") > - | < #NMCHAR : (<LETTER> | <COMBINING_CHAR> | <EXTENDER> | <DIGIT> | "." | "-" | "_") > - | < #NCNAME: <NMSTART> (<NMCHAR>)* > -} - -TOKEN : -{ - < IDENTIFIER: <NCNAME> > - | < ESCAPED_IDENTIFIER: "\\" <NCNAME> > - | < PREFIX_STAR: <NCNAME> ":*" > - | < PREFIXED_NAME: <NCNAME> ":" <NCNAME> > - | < LITERAL : ("\"" (~["\u0000", "\""])* "\"") - | ("'" (~["\u0000", "'"])* "'") - | ("\"\"\"" (~["\""] - | ("\"" ~["\""]) - | ("\"\"" ~["\""]))* "\"\"\"") - | ("'''" (~["'"] - | ("'" ~["'"]) - | ("''" ~["'"]))* "'''") > - | < FANNOTATE : ">>" > -} - -/* This avoids lexical errors from JavaCC. */ -<*> -TOKEN : -{ - < ILLEGAL_CHAR : [ "\u0000" - "\u0008", "\u000b" - "\uffff" ] > -}
--- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/pacakge-info.java Fri May 23 16:25:43 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * {@link SEIStub} and its supporting code. - */ -package com.sun.xml.internal.ws.client.sei;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/package-info.java Mon May 26 14:59:14 2014 +0200 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * {@link SEIStub} and its supporting code. + */ +package com.sun.xml.internal.ws.client.sei;