<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>commits@xmlbeans.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/"/>
<id>http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/</id>
<updated>2009-12-10T08:31:31Z</updated>
<entry>
<title>svn commit: r884309 - /xmlbeans/trunk/xkit/README.txt</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200911.mbox/%3c20091125223010.4210E23889ED@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091125223010-4210E23889ED@eris-apache-org%3e</id>
<updated>2009-11-25T22:30:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Wed Nov 25 22:30:09 2009
New Revision: 884309

URL: http://svn.apache.org/viewvc?rev=884309&amp;view=rev
Log:
Updated xkit/README version number.


Modified:
    xmlbeans/trunk/xkit/README.txt

Modified: xmlbeans/trunk/xkit/README.txt
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/xkit/README.txt?rev=884309&amp;r1=884308&amp;r2=884309&amp;view=diff
==============================================================================
--- xmlbeans/trunk/xkit/README.txt (original)
+++ xmlbeans/trunk/xkit/README.txt Wed Nov 25 22:30:09 2009
@@ -13,7 +13,7 @@
  *  limitations under the License.
  */
 
-XMLBeans Development Kit Version 2.4.0
+XMLBeans Development Kit Version 2.5.0
 
 
 Welcome to XMLBeans!



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884294 - in /xmlbeans/trunk: CHANGES.txt README.txt STATUS</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200911.mbox/%3c20091125220441.49B162388A1D@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091125220441-49B162388A1D@eris-apache-org%3e</id>
<updated>2009-11-25T22:04:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Wed Nov 25 22:04:40 2009
New Revision: 884294

URL: http://svn.apache.org/viewvc?rev=884294&amp;view=rev
Log:
Updated STATUS, CHANGES and README for 2.5.0 release.


Modified:
    xmlbeans/trunk/CHANGES.txt
    xmlbeans/trunk/README.txt
    xmlbeans/trunk/STATUS

Modified: xmlbeans/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/CHANGES.txt?rev=884294&amp;r1=884293&amp;r2=884294&amp;view=diff
==============================================================================
--- xmlbeans/trunk/CHANGES.txt (original)
+++ xmlbeans/trunk/CHANGES.txt Wed Nov 25 22:04:40 2009
@@ -1,3 +1,21 @@
+Changes in V2.5.0 since V2.4.0
+
+* Exit codes for InstanceValidator
+* Decimal precision handling fix in xsd2inst
+* Option to perform additional, stricter Schema validation checks: XMLBEANS-350
+* updated pattern for dayTimeDuration
+* Extended year min/max value limitations
+* Support for date and time types with hour 24.
+* NOTATION built-in type
+* DocType fix when root element is changed
+* "User types" feature - allows mapping of Schema simple types to custom user Java classes
+    http://wiki.apache.org/xmlbeans/UserTypes
+* Nested enumeration type compilation error fix: XMLBEANS-381
+* Deadlock fix in generated impl setter simple and array
+* Required attribute fix in streaming validator
+* Many other fixes and optimizations
+
+
 Changes in V2.4.0 since V2.3.0
 
 * Pluggable XPath/XQuery engine support

Modified: xmlbeans/trunk/README.txt
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/README.txt?rev=884294&amp;r1=884293&amp;r2=884294&amp;view=diff
==============================================================================
--- xmlbeans/trunk/README.txt (original)
+++ xmlbeans/trunk/README.txt Wed Nov 25 22:04:40 2009
@@ -49,9 +49,9 @@
 - tools.jar (O) from the JDK, dependency of jam-0.1.0-src
 - resolver.jar (O) [http://xml.apache.org/commons/components/resolver/]
   for apache-commons catalog files that are used in entity resolving
-- saxon9.0.0 (O) [http://sourceforge.net/projects/saxon/]
+- saxon9.0.0.4j (O) [http://sourceforge.net/projects/saxon/]
   for XPath/XQuery in XmlBeans
 (O) means that the library is optional
 
 For licensing information, see ./src/license/LICENSE.txt
-Updated: 06/16/08.
+Updated: 11/25/09.

Modified: xmlbeans/trunk/STATUS
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/STATUS?rev=884294&amp;r1=884293&amp;r2=884294&amp;view=diff
==============================================================================
--- xmlbeans/trunk/STATUS (original)
+++ xmlbeans/trunk/STATUS Wed Nov 25 22:04:40 2009
@@ -1,8 +1,16 @@
+Project Homepage:
+
+http://xmlbeans.apache.org/
+
+
 Active committers:
 
-Cezar Andrei            cezar.andrei@gmail.com
-Radu Preotiuc-Pietro    radu.preotiuc-pietro@oracle.com
-Jacob Danner            jacob.danner@gmail.com
+Cezar Andrei            cezar at apache dot org
+Radu Preotiuc-Pietro    radu.preotiuc-pietro at oracle dot com
+Jacob Danner            jacob dot danner at gmail.com
+Wing Yew Poon           wing.yew.poon at oracle dot com
+
 
 FAQ:
-http://wiki.apache.org/xmlbeans/XmlBeansV1Faq
+
+http://wiki.apache.org/xmlbeans/XmlBeansFaq



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882429 - in /xmlbeans/trunk: build.xml src/xmlpublic/org/apache/xmlbeans/XmlBeans.java</title>
<author><name>wypoon@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200911.mbox/%3c20091120071305.B3D7F2388989@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091120071305-B3D7F2388989@eris-apache-org%3e</id>
<updated>2009-11-20T07:13:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: wypoon
Date: Fri Nov 20 07:13:01 2009
New Revision: 882429

URL: http://svn.apache.org/viewvc?rev=882429&amp;view=rev
Log:
2.5.0 release

Modified:
    xmlbeans/trunk/build.xml
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlBeans.java

Modified: xmlbeans/trunk/build.xml
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/build.xml?rev=882429&amp;r1=882428&amp;r2=882429&amp;view=diff
==============================================================================
--- xmlbeans/trunk/build.xml (original)
+++ xmlbeans/trunk/build.xml Fri Nov 20 07:13:01 2009
@@ -19,7 +19,7 @@
     &lt;property name="javac.source" value="1.4"/&gt;
     &lt;property name="javac.target" value="1.4"/&gt;
 
-    &lt;property name="version.base" value="2.4.1"/&gt;
+    &lt;property name="version.base" value="2.5.0"/&gt;
 
     &lt;!-- manifest entries --&gt;
     &lt;property name="manifest.name" value="org/apache/xmlbeans/"/&gt;

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlBeans.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlBeans.java?rev=882429&amp;r1=882428&amp;r2=882429&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlBeans.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlBeans.java Fri Nov 20 07:13:01 2009
@@ -35,7 +35,7 @@
 public final class XmlBeans
 {
     private static String XMLBEANS_TITLE = "org.apache.xmlbeans";
-    private static String XMLBEANS_VERSION = "2.4.1";
+    private static String XMLBEANS_VERSION = "2.5.0";
     private static String XMLBEANS_VENDOR = "Apache Software Foundation";
 
     static



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882376 - in /xmlbeans/trunk: src/store/org/apache/xmlbeans/impl/store/Saver.java test/cases/xbean/misc/jira/xmlbeans_177a.xml test/cases/xbean/misc/jira/xmlbeans_177a.xsd test/src/misc/detailed/CharEscapeTest.java</title>
<author><name>wypoon@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200911.mbox/%3c20091120011349.1BE442388904@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091120011349-1BE442388904@eris-apache-org%3e</id>
<updated>2009-11-20T01:13:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: wypoon
Date: Fri Nov 20 01:13:48 2009
New Revision: 882376

URL: http://svn.apache.org/viewvc?rev=882376&amp;view=rev
Log:
Fix XMLBEANS-298. Add a test for verification.

Added:
    xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xml
    xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xsd
Modified:
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
    xmlbeans/trunk/test/src/misc/detailed/CharEscapeTest.java

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=882376&amp;r1=882375&amp;r2=882376&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Fri Nov 20 01:13:48
2009
@@ -1005,7 +1005,7 @@
             // TODO - must encode uri properly
 
             emit( uri );
-            entitizeAttrValue();
+            entitizeAttrValue(false);
 
             emit( '"' );
         }
@@ -1025,7 +1025,7 @@
             emitName( attrName, true );
             emit( '=', '\"' );
             emit( attrValue );
-            entitizeAttrValue();
+            entitizeAttrValue(true);
             emit( '"' );
         }
 
@@ -1432,7 +1432,7 @@
             }
         }
 
-        private void entitizeAttrValue ( )
+        private void entitizeAttrValue ( boolean replaceEscapedChar )
         {
             if (_lastEmitCch == 0)
                 return;
@@ -1449,6 +1449,11 @@
                     i = replace( i, "&amp;amp;" );
                 else if (ch == '"')
                     i = replace( i, "&amp;quot;" );
+                else if (isEscapedChar( ch ))
+                {
+                    if (replaceEscapedChar)
+                        i = replace( i, _replaceChar.getEscapedString( ch ) );
+                }
                 else
                     i++;
 

Added: xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xml
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xml?rev=882376&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xml (added)
+++ xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xml Fri Nov 20 01:13:48 2009
@@ -0,0 +1,7 @@
+&lt;jira:testListA xmlns:jira="http://jira/xmlbeans_177a"&gt;
+  &lt;test a="This is a greater than sign: &amp;gt;"/&gt;
+  &lt;test a="This is a less than sign: &amp;lt;"/&gt;
+  &lt;test a="This is a single quote: &amp;apos;"/&gt;
+  &lt;test a="This is a double quote: &amp;quot;"/&gt;
+  &lt;test a="W.L.Gore &amp;amp; Associates"/&gt;
+&lt;/jira:testListA&gt;

Added: xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xsd?rev=882376&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xsd (added)
+++ xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_177a.xsd Fri Nov 20 01:13:48 2009
@@ -0,0 +1,17 @@
+&lt;schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        targetNamespace="http://jira/xmlbeans_177a"&gt;
+
+  &lt;xs:element name="testListA"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element name="test" maxOccurs="unbounded"&gt;
+          &lt;xs:complexType&gt;
+            &lt;xs:attribute name="a" type="xs:string" use="required"/&gt;
+          &lt;/xs:complexType&gt;
+        &lt;/xs:element&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
+
+&lt;/schema&gt;

Modified: xmlbeans/trunk/test/src/misc/detailed/CharEscapeTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/misc/detailed/CharEscapeTest.java?rev=882376&amp;r1=882375&amp;r2=882376&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/src/misc/detailed/CharEscapeTest.java (original)
+++ xmlbeans/trunk/test/src/misc/detailed/CharEscapeTest.java Fri Nov 20 01:13:48 2009
@@ -23,18 +23,23 @@
 
 import org.apache.xmlbeans.*;
 import jira.xmlbeans177.*;
+import jira.xmlbeans177A.*;
 import common.Common;
 
 public class CharEscapeTest extends Common
 {
     static final String inputFile = 
         XBEAN_CASE_ROOT + P + "misc" + P + "jira" + P + "xmlbeans_177.xml";
+    static final String inputFile2 = 
+        XBEAN_CASE_ROOT + P + "misc" + P + "jira" + P + "xmlbeans_177a.xml";
     //static final String outputDir = OUTPUTROOT + P + "misc";
     //static final String outputFile1 = "xmlbeans_177_out1.xml";
     //static final String outputFile2 = "xmlbeans_177_out2.xml";
 
     static final String start = "&lt;jira:testList xmlns:jira=\"http://jira/xmlbeans_177\"&gt;";
     static final String end = "&lt;/jira:testList&gt;";
+    static final String start2 = "&lt;jira:testListA xmlns:jira=\"http://jira/xmlbeans_177a\"&gt;";
+    static final String end2 = "&lt;/jira:testListA&gt;";
 
     public CharEscapeTest(String name)
     {
@@ -192,7 +197,7 @@
         doc.save(of2, opts);
         */
     }
-    
+
     public void testEscape2() throws Exception
     {
         TestListDocument doc = TestListDocument.Factory.newInstance();
@@ -221,7 +226,51 @@
             end;
         assertEquals(exp, doc.xmlText(opts));
     }
-    
+
+    public void testEscapeAttribute() throws Exception
+    {
+        File f = new File(inputFile2);
+        TestListADocument doc = TestListADocument.Factory.parse(f);
+
+        // default behavior: without the character replacement map,
+        // only the minimal, required characters are escaped
+        String exp1 = start2 + "\n" +
+            "  &lt;test a=\"This is a greater than sign: &gt;\"/&gt;\n" +
+            "  &lt;test a=\"This is a less than sign: &amp;lt;\"/&gt;\n" +
+            "  &lt;test a=\"This is a single quote: '\"/&gt;\n" +
+            "  &lt;test a=\"This is a double quote: &amp;quot;\"/&gt;\n" +
+            "  &lt;test a=\"W.L.Gore &amp;amp; Associates\"/&gt;\n" +
+            end2;
+        assertEquals(exp1, doc.xmlText());
+
+        XmlOptionCharEscapeMap charEsc = new XmlOptionCharEscapeMap();
+        charEsc.addMapping('&gt;', XmlOptionCharEscapeMap.PREDEF_ENTITY);
+        XmlOptions opts = new XmlOptions();
+        opts.setSaveSubstituteCharacters(charEsc);
+
+        // escape '&gt;' as predefined entity as well
+        String exp2 = start2 + "\n" +
+            "  &lt;test a=\"This is a greater than sign: &amp;gt;\"/&gt;\n" +
+            "  &lt;test a=\"This is a less than sign: &amp;lt;\"/&gt;\n" +
+            "  &lt;test a=\"This is a single quote: '\"/&gt;\n" +
+            "  &lt;test a=\"This is a double quote: &amp;quot;\"/&gt;\n" +
+            "  &lt;test a=\"W.L.Gore &amp;amp; Associates\"/&gt;\n" +
+            end2;
+        assertEquals(exp2, doc.xmlText(opts));
+
+        // escape block of chars as hexadecimal
+        charEsc.addMappings('A', 'D', XmlOptionCharEscapeMap.HEXADECIMAL);
+        // opts holds a reference to charEsc, so opts is updated
+        String exp3 = start2 + "\n" +
+            "  &lt;test a=\"This is a greater than sign: &amp;gt;\"/&gt;\n" +
+            "  &lt;test a=\"This is a less than sign: &amp;lt;\"/&gt;\n" +
+            "  &lt;test a=\"This is a single quote: '\"/&gt;\n" +
+            "  &lt;test a=\"This is a double quote: &amp;quot;\"/&gt;\n" +
+            "  &lt;test a=\"W.L.Gore &amp;amp; &amp;#x41;ssociates\"/&gt;\n" +
+            end2;
+        assertEquals(exp3, doc.xmlText(opts));
+    }
+
     public static Test suite()
     {
         TestSuite suite = new TestSuite(CharEscapeTest.class);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882294 - in /xmlbeans/trunk: src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java test/src/misc/detailed/JiraRegression251_300Test.java</title>
<author><name>wypoon@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200911.mbox/%3c20091119205545.01FAD23889C9@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091119205545-01FAD23889C9@eris-apache-org%3e</id>
<updated>2009-11-19T20:55:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: wypoon
Date: Thu Nov 19 20:55:44 2009
New Revision: 882294

URL: http://svn.apache.org/viewvc?rev=882294&amp;view=rev
Log:
Fix for XMLBEANS-260. Add a test for verification.

Added:
    xmlbeans/trunk/test/src/misc/detailed/JiraRegression251_300Test.java
Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java?rev=882294&amp;r1=882293&amp;r2=882294&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java Thu Nov
19 20:55:44 2009
@@ -531,8 +531,12 @@
         { assertJavaizing(); _isCompiled = f; }
 
     public boolean isSkippedAnonymousType()
-        { return _outerSchemaTypeRef.get().getBaseType() == this ||
-                _outerSchemaTypeRef.get().getContentBasedOnType() == this; }
+    {
+        SchemaType outerType = getOuterType();
+        return ((outerType == null) ? false :
+                (outerType.getBaseType() == this ||
+                 outerType.getContentBasedOnType() == this));
+    }
 
     public String getShortJavaName()
         { return _shortJavaName; }

Added: xmlbeans/trunk/test/src/misc/detailed/JiraRegression251_300Test.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/misc/detailed/JiraRegression251_300Test.java?rev=882294&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/misc/detailed/JiraRegression251_300Test.java (added)
+++ xmlbeans/trunk/test/src/misc/detailed/JiraRegression251_300Test.java Thu Nov 19 20:55:44
2009
@@ -0,0 +1,41 @@
+/*
+ *   Copyright 2009 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package misc.detailed;
+
+import misc.common.JiraTestBase;
+import com.easypo.*;
+
+public class JiraRegression251_300Test extends JiraTestBase
+{
+    public JiraRegression251_300Test(String name)
+    {
+        super(name);
+    }
+
+    /*
+    * [XMLBEANS-260]: SchemaType#isSkippedAnonymousType() throws an NPE
+    * if _outerSchemaTypeRef is not set
+    */
+    public void test_jira_xmlbeans260()
+    {
+        // construct an instance of a non-anonymous type
+        XmlShipperBean xbean = XmlShipperBean.Factory.newInstance();
+        // the following call should not throw an NPE;
+        // it should return false instead
+        boolean isSkipped = xbean.schemaType().isSkippedAnonymousType();
+        assertFalse(isSkipped);
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r835629 - in /xmlbeans/trunk/src: common/org/apache/xmlbeans/impl/common/QNameHelper.java store/org/apache/xmlbeans/impl/store/Cur.java xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200911.mbox/%3c20091112231132.9770B23888FD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091112231132-9770B23888FD@eris-apache-org%3e</id>
<updated>2009-11-12T23:11:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Nov 12 23:11:31 2009
New Revision: 835629

URL: http://svn.apache.org/viewvc?rev=835629&amp;view=rev
Log:
Adding exitcode for InstanceValidator.


Modified:
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/QNameHelper.java
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/QNameHelper.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/QNameHelper.java?rev=835629&amp;r1=835628&amp;r2=835629&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/QNameHelper.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/QNameHelper.java Thu Nov 12
23:11:31 2009
@@ -122,13 +122,13 @@
                 try
                 {
                     utf8 = s.substring(i, i + 1).getBytes("UTF-8");
-                for (int j = 0; j &lt; utf8.length; j++)
-                {
-                    result.append('_');
-                    result.append(hexdigits[(utf8[j] &gt;&gt; 4) &amp; 0xF]);
-                    result.append(hexdigits[utf8[j] &amp; 0xF]);
+                    for (int j = 0; j &lt; utf8.length; j++)
+                    {
+                        result.append('_');
+                        result.append(hexdigits[(utf8[j] &gt;&gt; 4) &amp; 0xF]);
+                        result.append(hexdigits[utf8[j] &amp; 0xF]);
+                    }
                 }
-            }
                 catch(UnsupportedEncodingException uee)
                 {
                     // should never happen - UTF-8 i always supported

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java?rev=835629&amp;r1=835628&amp;r2=835629&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java Thu Nov 12 23:11:31 2009
@@ -1800,11 +1800,13 @@
         _locale.notifyChange();
 
         //
-
-        if (to == null)
-            _xobj.removeCharsHelper( _pos, cchMove, null, NO_POS, false, true );
-        else
-            _xobj.removeCharsHelper( _pos, cchMove, to._xobj, to._pos, false, true );
+        //if ( _xobj != null )
+        {
+            if (to == null)
+                _xobj.removeCharsHelper( _pos, cchMove, null, NO_POS, false, true );
+            else
+                _xobj.removeCharsHelper( _pos, cchMove, to._xobj, to._pos, false, true );
+        }
 
         // Need to update the position of this cursor even though it did not move anywhere.
 This
         // needs to happen because it may not be properly normalized anymore.  Note that
because

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java?rev=835629&amp;r1=835628&amp;r2=835629&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java Thu Nov
12 23:11:31 2009
@@ -48,6 +48,16 @@
 
     public static void main(String[] args)
     {
+        System.exit(extraMain(args));
+    }
+
+    /**
+     * Use this method to avoid calling {@link java.lang.System#exit(int)}
+     * @param args are command line options
+     * @return exitCode
+     */
+    public static int extraMain(String[] args)
+    {
         Set flags = new HashSet();
         flags.add("h");
         flags.add("help");
@@ -65,8 +75,7 @@
         if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") !=
null || args.length &lt; 1)
         {
             printUsage();
-            System.exit(0);
-            return;
+            return 0;
         }
 
         String[] badopts = cl.getBadOpts();
@@ -75,27 +84,24 @@
             for (int i = 0; i &lt; badopts.length; i++)
                 System.out.println("Unrecognized option: " + badopts[i]);
             printUsage();
-            System.exit(0);
-            return;
+            return 0;
         }
 
         if (cl.getOpt("license") != null)
         {
             CommandLine.printLicense();
-            System.exit(0);
-            return;
+            return 0;
         }
 
         if (cl.getOpt("version") != null)
         {
             CommandLine.printVersion();
-            System.exit(0);
-            return;
+            return 0;
         }
 
         if (cl.args().length == 0)
         {
-            return;
+            return 0;
         }
 
         boolean dl = (cl.getOpt("dl") != null);
@@ -143,6 +149,8 @@
         if (jarFiles != null &amp;&amp; jarFiles.length &gt; 0)
             sLoader = XmlBeans.typeLoaderForResource(XmlBeans.resourceLoaderForPath(jarFiles));
 
+        int returnCode = 0;
+
         try
         {
             if (schemas != null &amp;&amp; schemas.length &gt; 0)
@@ -157,12 +165,15 @@
             System.out.println("Schema invalid:" + (partial ? " couldn't recover from errors"
: ""));
             for (Iterator i = compErrors.iterator(); i.hasNext(); )
                 System.out.println(i.next());
-            return;
+
+            returnCode = 10;
+            return returnCode;
         }
 
         // recovered from errors, print out errors
         if (partial &amp;&amp; !compErrors.isEmpty())
         {
+            returnCode = 11;
             System.out.println("Schema invalid: partial schema type system recovered");
             for (Iterator i = compErrors.iterator(); i.hasNext(); )
                 System.out.println(i.next());
@@ -200,6 +211,7 @@
                 System.out.println(instanceFiles[i] + " valid.");
             else
             {
+                returnCode = 1;
                 System.out.println(instanceFiles[i] + " NOT valid.");
                 for (Iterator it = errors.iterator(); it.hasNext(); )
                 {
@@ -207,5 +219,7 @@
                 }
             }
         }
+
+        return returnCode;
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r834311 - in /xmlbeans/trunk/test: cases/xbean/scomp/contentType/builtInTypes/Legacy.xsd src/scomp/contentType/simple/detailed/BuiltInType.java</title>
<author><name>wypoon@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200911.mbox/%3c20091110023407.C2E2F2388998@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091110023407-C2E2F2388998@eris-apache-org%3e</id>
<updated>2009-11-10T02:34:07Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: wypoon
Date: Tue Nov 10 02:34:07 2009
New Revision: 834311

URL: http://svn.apache.org/viewvc?rev=834311&amp;view=rev
Log:
remove schema that fails new stricter compilation and unimplemented test case

Removed:
    xmlbeans/trunk/test/cases/xbean/scomp/contentType/builtInTypes/Legacy.xsd
Modified:
    xmlbeans/trunk/test/src/scomp/contentType/simple/detailed/BuiltInType.java

Modified: xmlbeans/trunk/test/src/scomp/contentType/simple/detailed/BuiltInType.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/scomp/contentType/simple/detailed/BuiltInType.java?rev=834311&amp;r1=834310&amp;r2=834311&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/src/scomp/contentType/simple/detailed/BuiltInType.java (original)
+++ xmlbeans/trunk/test/src/scomp/contentType/simple/detailed/BuiltInType.java Tue Nov 10
02:34:07 2009
@@ -366,8 +366,4 @@
         calendar.setTime(trialTime);
         return calendar;
     }
-
-    public void testLegacyTypes() throws Throwable {
-        fail("Implement test");
-    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r825680 - /xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200910.mbox/%3c20091015220724.32EB423888E4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091015220724-32EB423888E4@eris-apache-org%3e</id>
<updated>2009-10-15T22:07:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Oct 15 22:07:23 2009
New Revision: 825680

URL: http://svn.apache.org/viewvc?rev=825680&amp;view=rev
Log:
Fix for Jira XMLBEANS-410. Contributed by Mark D Henning.


Modified:
    xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java

Modified: xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java?rev=825680&amp;r1=825679&amp;r2=825680&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java (original)
+++ xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java Thu Oct
15 22:07:23 2009
@@ -554,11 +554,11 @@
 
         if (fractionDigits &gt; 0)
             if (totalDigits &gt;= 0)
-                result.setScale(Math.max(fractionDigits, totalDigits - digits));
+                result = result.setScale(Math.max(fractionDigits, totalDigits - digits));
             else
-                result.setScale(fractionDigits);
+                result = result.setScale(fractionDigits);
         else if (fractionDigits == 0)
-            result.setScale(0);
+            result = result.setScale(0);
 
         return result.toString();
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r820821 - /xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaComponent.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200910.mbox/%3c20091001221530.35A9A2388904@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091001221530-35A9A2388904@eris-apache-org%3e</id>
<updated>2009-10-01T22:15:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Oct  1 22:15:29 2009
New Revision: 820821

URL: http://svn.apache.org/viewvc?rev=820821&amp;view=rev
Log:
Optimized initialization of _schemaComponent in Ref.


Modified:
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaComponent.java

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaComponent.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaComponent.java?rev=820821&amp;r1=820820&amp;r2=820821&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaComponent.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaComponent.java Thu Oct  1 22:15:29
2009
@@ -93,7 +93,7 @@
         protected Ref(SchemaTypeSystem schemaTypeSystem, String handle)
             { assert(handle != null); _schemaTypeSystem = schemaTypeSystem; _handle = handle;
}
 
-        private SchemaComponent _schemaComponent;
+        private volatile SchemaComponent _schemaComponent;
         private SchemaTypeSystem _schemaTypeSystem;
         public String _handle;
 
@@ -102,12 +102,18 @@
         public final SchemaTypeSystem getTypeSystem()
             { return _schemaTypeSystem; }
 
-        public final synchronized SchemaComponent getComponent()
+        public final SchemaComponent getComponent()
         {
             if (_schemaComponent == null &amp;&amp; _handle != null)
             {
-                _schemaComponent = _schemaTypeSystem.resolveHandle(_handle);
-                _schemaTypeSystem = null;
+                synchronized (this)
+                {
+                    if (_schemaComponent == null &amp;&amp; _handle != null)
+                    {
+                        _schemaComponent = _schemaTypeSystem.resolveHandle(_handle);
+                        _schemaTypeSystem = null;
+                    }
+                }
             }
 
             return _schemaComponent;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r803718 - in /xmlbeans/site: build/site/ build/site/sourceAndBinaries/ src/documentation/content/xdocs/ src/documentation/content/xdocs/sourceAndBinaries/</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200908.mbox/%3c20090812213547.09BFC23888DD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090812213547-09BFC23888DD@eris-apache-org%3e</id>
<updated>2009-08-12T21:35:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Wed Aug 12 21:35:45 2009
New Revision: 803718

URL: http://svn.apache.org/viewvc?rev=803718&amp;view=rev
Log:
More source access, git anf grepcode.


Modified:
    xmlbeans/site/build/site/index.html
    xmlbeans/site/build/site/news.html
    xmlbeans/site/build/site/sourceAndBinaries/index.html
    xmlbeans/site/src/documentation/content/xdocs/index.xml
    xmlbeans/site/src/documentation/content/xdocs/news.xml
    xmlbeans/site/src/documentation/content/xdocs/sourceAndBinaries/index.xml

Modified: xmlbeans/site/build/site/index.html
URL: http://svn.apache.org/viewvc/xmlbeans/site/build/site/index.html?rev=803718&amp;r1=803717&amp;r2=803718&amp;view=diff
==============================================================================
--- xmlbeans/site/build/site/index.html (original)
+++ xmlbeans/site/build/site/index.html Wed Aug 12 21:35:45 2009
@@ -225,7 +225,19 @@
 &lt;/div&gt;
 
   
-&lt;a name="N10036"&gt;&lt;/a&gt;&lt;a name="New+Release%3A+Apache+XMLBeans+2.4.0+%28July+8%2C+2008%29"&gt;&lt;/a&gt;
+&lt;a name="N10036"&gt;&lt;/a&gt;&lt;a name="New+access+to+XMLBeans+sources+%28August+12%2C+2009%29"&gt;&lt;/a&gt;
+&lt;h2 class="h3"&gt;New access to XMLBeans sources (August 12, 2009)&lt;/h2&gt;
+&lt;div class="section"&gt;
+&lt;p&gt;Git read-only access to XMLBeans sources is now available. Please see the 
+      &lt;a href="http://git.apache.org/"&gt;Git at Apache&lt;/a&gt; page for details.
+      Git Clone URL:  &lt;a href="git://git.apache.org/xmlbeans.git"&gt;git://git.apache.org/xmlbeans.git&lt;/a&gt;
and
+      Http Clone URL: &lt;a href="http://git.apache.org/xmlbeans.git"&gt;http://git.apache.org/xmlbeans.git&lt;/a&gt;.&lt;/p&gt;
+&lt;p&gt;Now &lt;a href="http://grepcode.com/search/?query=xmlbeans"&gt;search and browse
XMLBeans source code&lt;/a&gt; 
+     is available thanks to &lt;a href="http://grepcode.com/"&gt;grepcode&lt;/a&gt;.&lt;/p&gt;
+&lt;/div&gt;
+
+  
+&lt;a name="N10057"&gt;&lt;/a&gt;&lt;a name="New+Release%3A+Apache+XMLBeans+2.4.0+%28July+8%2C+2008%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;New Release: Apache XMLBeans 2.4.0 (July 8, 2008)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -259,7 +271,7 @@
 
 
   
-&lt;a name="N1006A"&gt;&lt;/a&gt;
+&lt;a name="N1008B"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -269,10 +281,10 @@
 
 
   
-&lt;a name="N10075"&gt;&lt;/a&gt;&lt;a name="Getting+Started"&gt;&lt;/a&gt;
+&lt;a name="N10096"&gt;&lt;/a&gt;&lt;a name="Getting+Started"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Getting Started&lt;/h2&gt;
 &lt;div class="section"&gt;
-&lt;a name="N1007B"&gt;&lt;/a&gt;&lt;a name="Start+off+with+your+own+stuff."&gt;&lt;/a&gt;
+&lt;a name="N1009C"&gt;&lt;/a&gt;&lt;a name="Start+off+with+your+own+stuff."&gt;&lt;/a&gt;
 &lt;h3 class="h4"&gt;Start off with your own stuff.&lt;/h3&gt;
 &lt;p&gt;If you want to get right to it with your own XML schema and instance, follow these
basic steps:&lt;/p&gt;
 &lt;ol&gt;
@@ -309,11 +321,11 @@
 &lt;/li&gt;
 				
 &lt;/ol&gt;
-&lt;a name="N100A2"&gt;&lt;/a&gt;&lt;a name="Read+a+tutorial."&gt;&lt;/a&gt;
+&lt;a name="N100C3"&gt;&lt;/a&gt;&lt;a name="Read+a+tutorial."&gt;&lt;/a&gt;
 &lt;h3 class="h4"&gt;Read a tutorial.&lt;/h3&gt;
 &lt;p&gt;Read our &lt;a href="documentation/tutorial_getstarted.html"&gt;tutorial&lt;/a&gt;
to get a sense of XMLBeans
 					basics.&lt;/p&gt;
-&lt;a name="N100B0"&gt;&lt;/a&gt;&lt;a name="Read+documentation+and+other+information."&gt;&lt;/a&gt;
+&lt;a name="N100D1"&gt;&lt;/a&gt;&lt;a name="Read+documentation+and+other+information."&gt;&lt;/a&gt;
 &lt;h3 class="h4"&gt;Read documentation and other information.&lt;/h3&gt;
 &lt;p&gt;On our &lt;a href="documentation/index.html#XMLBeans+Version+1+User+Documentation"&gt;documentation&lt;/a&gt;
page, you'll find links to
 					several topics that describe XMLBeans features and how to use them. You'll also
@@ -322,7 +334,7 @@
 					with new answers as they're needed.&lt;/p&gt;
 &lt;p&gt;Don't forget the &lt;a target="_top" href="http://wiki.apache.org/xmlbeans/"&gt;XMLBeans
Wiki&lt;/a&gt;, which collects
 					lots of valuable information.&lt;/p&gt;
-&lt;a name="N100CC"&gt;&lt;/a&gt;&lt;a name="Check+out+the+samples."&gt;&lt;/a&gt;
+&lt;a name="N100ED"&gt;&lt;/a&gt;&lt;a name="Check+out+the+samples."&gt;&lt;/a&gt;
 &lt;h3 class="h4"&gt;Check out the samples.&lt;/h3&gt;
 &lt;p&gt;Many of the XMLBeans features are illustrated in our &lt;a href="samples/index.html#Getting+the+Samples"&gt;samples&lt;/a&gt;.&lt;/p&gt;
 &lt;/div&gt;

Modified: xmlbeans/site/build/site/news.html
URL: http://svn.apache.org/viewvc/xmlbeans/site/build/site/news.html?rev=803718&amp;r1=803717&amp;r2=803718&amp;view=diff
==============================================================================
--- xmlbeans/site/build/site/news.html (original)
+++ xmlbeans/site/build/site/news.html Wed Aug 12 21:35:45 2009
@@ -199,7 +199,19 @@
 &lt;h1&gt;XMLBeans News&lt;/h1&gt;
 
 
-&lt;a name="N1000C"&gt;&lt;/a&gt;&lt;a name="New+Release%3A+Apache+XMLBeans+2.4.0+%28July+8%2C+2008%29"&gt;&lt;/a&gt;
+&lt;a name="N1000C"&gt;&lt;/a&gt;&lt;a name="New+access+to+XMLBeans+sources+%28August+12%2C+2009%29"&gt;&lt;/a&gt;
+&lt;h2 class="h3"&gt;New access to XMLBeans sources (August 12, 2009)&lt;/h2&gt;
+&lt;div class="section"&gt;
+&lt;p&gt;Git read-only access to XMLBeans sources is now available. Please see the 
+      &lt;a href="http://git.apache.org/"&gt;Git at Apache&lt;/a&gt; page for details.
+      Git Clone URL:  &lt;a href="git://git.apache.org/xmlbeans.git"&gt;git://git.apache.org/xmlbeans.git&lt;/a&gt;
and
+      Http Clone URL: &lt;a href="http://git.apache.org/xmlbeans.git"&gt;http://git.apache.org/xmlbeans.git&lt;/a&gt;.&lt;/p&gt;
+&lt;p&gt;Now &lt;a href="http://grepcode.com/search/?query=xmlbeans"&gt;search and browse
XMLBeans source code&lt;/a&gt; 
+     is available thanks to &lt;a href="http://grepcode.com/"&gt;grepcode&lt;/a&gt;.&lt;/p&gt;
+&lt;/div&gt;
+
+
+&lt;a name="N1002D"&gt;&lt;/a&gt;&lt;a name="New+Release%3A+Apache+XMLBeans+2.4.0+%28July+8%2C+2008%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;New Release: Apache XMLBeans 2.4.0 (July 8, 2008)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -233,7 +245,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N10040"&gt;&lt;/a&gt;&lt;a name="Release+Apache+XMLBeans+2.3.0+%28June+1%2C+2007%29"&gt;&lt;/a&gt;
+&lt;a name="N10061"&gt;&lt;/a&gt;&lt;a name="Release+Apache+XMLBeans+2.3.0+%28June+1%2C+2007%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Release Apache XMLBeans 2.3.0 (June 1, 2007)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -263,7 +275,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N1006E"&gt;&lt;/a&gt;&lt;a name="XMLBeans%2FXPath+Update+%28July+22%2C+2006%29"&gt;&lt;/a&gt;
+&lt;a name="N1008F"&gt;&lt;/a&gt;&lt;a name="XMLBeans%2FXPath+Update+%28July+22%2C+2006%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;XMLBeans/XPath Update (July 22, 2006)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -287,7 +299,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N10091"&gt;&lt;/a&gt;&lt;a name="Release%3A+Just+released+Apache+XMLBeans+2.2.0%21+%28June+23%2C+2006%29"&gt;&lt;/a&gt;
+&lt;a name="N100B2"&gt;&lt;/a&gt;&lt;a name="Release%3A+Just+released+Apache+XMLBeans+2.2.0%21+%28June+23%2C+2006%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Release: Just released Apache XMLBeans 2.2.0! (June 23, 2006)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -309,7 +321,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N100B0"&gt;&lt;/a&gt;&lt;a name="Apache+XMLBeans+updated+to+use+SaxonB+8.6.1+%2816+February+2006%29"&gt;&lt;/a&gt;
+&lt;a name="N100D1"&gt;&lt;/a&gt;&lt;a name="Apache+XMLBeans+updated+to+use+SaxonB+8.6.1+%2816+February+2006%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Apache XMLBeans updated to use SaxonB 8.6.1 (16 February 2006)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -320,7 +332,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N100BA"&gt;&lt;/a&gt;&lt;a name="Release%3A+Apache+XMLBeans+2.1.0+released%21+%2816+November+2005%29"&gt;&lt;/a&gt;
+&lt;a name="N100DB"&gt;&lt;/a&gt;&lt;a name="Release%3A+Apache+XMLBeans+2.1.0+released%21+%2816+November+2005%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Release: Apache XMLBeans 2.1.0 released! (16 November 2005)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -336,7 +348,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N100D0"&gt;&lt;/a&gt;&lt;a name="Release%3A+Apache+XMLBeans+2.0.0+released%21+%2830+June+2005%29"&gt;&lt;/a&gt;
+&lt;a name="N100F1"&gt;&lt;/a&gt;&lt;a name="Release%3A+Apache+XMLBeans+2.0.0+released%21+%2830+June+2005%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Release: Apache XMLBeans 2.0.0 released! (30 June 2005)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -372,7 +384,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N100F9"&gt;&lt;/a&gt;&lt;a name="Update%3A+The+missing+xbean_xpath.jar+and+xmlpublic.jar+from+the+2.0.0-beta1+release+have+been+found%21+%283+March+2005%29"&gt;&lt;/a&gt;
+&lt;a name="N1011A"&gt;&lt;/a&gt;&lt;a name="Update%3A+The+missing+xbean_xpath.jar+and+xmlpublic.jar+from+the+2.0.0-beta1+release+have+been+found%21+%283+March+2005%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Update: The missing xbean_xpath.jar and xmlpublic.jar from the 2.0.0-beta1
release have been found! (3 March 2005)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -401,7 +413,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N10113"&gt;&lt;/a&gt;&lt;a name="Release%3A+Apache+XMLBeans+2.0.0-beta1%2C+1.0.4%2C+and+1.0.4-jdk1.3+released%21+%2824+February+2005%29"&gt;&lt;/a&gt;
+&lt;a name="N10134"&gt;&lt;/a&gt;&lt;a name="Release%3A+Apache+XMLBeans+2.0.0-beta1%2C+1.0.4%2C+and+1.0.4-jdk1.3+released%21+%2824+February+2005%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Release: Apache XMLBeans 2.0.0-beta1, 1.0.4, and 1.0.4-jdk1.3 released!
(24 February 2005)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;The Apache XMLBeans project is pleased to announce new releases of XMLBeans available
for
@@ -439,7 +451,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N1013F"&gt;&lt;/a&gt;&lt;a name="XMLBeans+moved+to+SVN+%287+December+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N10160"&gt;&lt;/a&gt;&lt;a name="XMLBeans+moved+to+SVN+%287+December+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;XMLBeans moved to SVN (7 December 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;XMLBeans changed it's repository from CVS to &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt;.
See the sources at the new location: 
@@ -448,7 +460,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N10151"&gt;&lt;/a&gt;&lt;a name="Article%3A+Configuring+XMLBeans+%2830+November+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N10172"&gt;&lt;/a&gt;&lt;a name="Article%3A+Configuring+XMLBeans+%2830+November+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Article: Configuring XMLBeans (30 November 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;Read &lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/Configuring_XMLBeans.jsp"&gt;Configuring
XMLBeans&lt;/a&gt;
@@ -460,7 +472,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N10167"&gt;&lt;/a&gt;&lt;a name="Presentation%3A+Apache+XMLBeans+2%3A+Accessing+the+Full+Power+of+XML+in+Java+%2817+November+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N10188"&gt;&lt;/a&gt;&lt;a name="Presentation%3A+Apache+XMLBeans+2%3A+Accessing+the+Full+Power+of+XML+in+Java+%2817+November+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Presentation: Apache XMLBeans 2: Accessing the Full Power of XML in
Java (17 November 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;I've put my presentation from &lt;a href="http://apachecon.com/2004/US/index.html"&gt;ApacheCon
2004&lt;/a&gt; online, titled &lt;a href="http://www.apache.org/~kkrouse/apachecon/ac2004_XmlBeans_v2.ppt"&gt;Apache
XMLBeans 2: Accessing the Full Power of XML in Java&lt;/a&gt; (ppt).  Enjoy!
@@ -471,7 +483,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N1017D"&gt;&lt;/a&gt;&lt;a name="ApacheCon+2004+%2813-17+November+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N1019E"&gt;&lt;/a&gt;&lt;a name="ApacheCon+2004+%2813-17+November+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;ApacheCon 2004 (13-17 November 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -486,7 +498,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N10192"&gt;&lt;/a&gt;&lt;a name="Article%3A+XML-Java+Data+Binding+Using+XMLBeans+%2828+July+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N101B3"&gt;&lt;/a&gt;&lt;a name="Article%3A+XML-Java+Data+Binding+Using+XMLBeans+%2828+July+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Article: XML-Java Data Binding Using XMLBeans (28 July 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;Read &lt;a href="http://www.onjava.com/pub/a/onjava/2004/07/28/XMLBeans.html"&gt;XML-Java
Data
@@ -499,7 +511,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N101AC"&gt;&lt;/a&gt;&lt;a name="XMLBeans+1.0.3+Released+%2828+June+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N101CD"&gt;&lt;/a&gt;&lt;a name="XMLBeans+1.0.3+Released+%2828+June+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;XMLBeans 1.0.3 Released (28 June 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -512,7 +524,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N101C8"&gt;&lt;/a&gt;&lt;a name="XMLBeans+becomes+a+Top+Level+Apache+project+%2825+June+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N101E9"&gt;&lt;/a&gt;&lt;a name="XMLBeans+becomes+a+Top+Level+Apache+project+%2825+June+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;XMLBeans becomes a Top Level Apache project (25 June 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;Apache XMLBeans Project has graduated out the &lt;a href="http://incubator.apache.org/"&gt;Apache
@@ -524,7 +536,7 @@
 &lt;/div&gt;
 
 
-&lt;a name="N101DE"&gt;&lt;/a&gt;&lt;a name="XMLBeans+%28incubated%29+1.0.2+Released+%2823+April+2004%29"&gt;&lt;/a&gt;
+&lt;a name="N101FF"&gt;&lt;/a&gt;&lt;a name="XMLBeans+%28incubated%29+1.0.2+Released+%2823+April+2004%29"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;XMLBeans (incubated) 1.0.2 Released (23 April 2004)&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;

Modified: xmlbeans/site/build/site/sourceAndBinaries/index.html
URL: http://svn.apache.org/viewvc/xmlbeans/site/build/site/sourceAndBinaries/index.html?rev=803718&amp;r1=803717&amp;r2=803718&amp;view=diff
==============================================================================
--- xmlbeans/site/build/site/sourceAndBinaries/index.html (original)
+++ xmlbeans/site/build/site/sourceAndBinaries/index.html Wed Aug 12 21:35:45 2009
@@ -240,10 +240,22 @@
 
 # or, just get the samples for XMLBeans
 svn co http://svn.apache.org/repos/asf/xmlbeans/trunk/samples/ xmlbeans-samples&lt;/pre&gt;
-&lt;a name="N10092"&gt;&lt;/a&gt;&lt;a name="Building+XMLBeans"&gt;&lt;/a&gt;
+&lt;a name="N10092"&gt;&lt;/a&gt;&lt;a name="Source+via+Git"&gt;&lt;/a&gt;
+&lt;h3 class="h4"&gt;Source via Git&lt;/h3&gt;
+&lt;p&gt;Please see the &lt;a href="http://git.apache.org/"&gt;Git at Apache&lt;/a&gt; page
for details. As of this writing the Git acess is read-only.&lt;/p&gt;
+&lt;p&gt;Git Clone URL:  &lt;a href="git://git.apache.org/xmlbeans.git"&gt;git://git.apache.org/xmlbeans.git&lt;/a&gt;
+&lt;/p&gt;
+&lt;p&gt;Http Clone URL: &lt;a href="http://git.apache.org/xmlbeans.git"&gt;http://git.apache.org/xmlbeans.git&lt;/a&gt;
+&lt;/p&gt;
+&lt;a name="N100AC"&gt;&lt;/a&gt;&lt;a name="Search+and+Browse+Sources"&gt;&lt;/a&gt;
+&lt;h3 class="h4"&gt;Search and Browse Sources&lt;/h3&gt;
+&lt;p&gt;
+&lt;a href="http://grepcode.com/search/?query=xmlbeans"&gt;Grep XMLBeans code&lt;/a&gt; with

+           &lt;a href="http://grepcode.com/"&gt;grepcode&lt;/a&gt;.&lt;/p&gt;
+&lt;a name="N100BD"&gt;&lt;/a&gt;&lt;a name="Building+XMLBeans"&gt;&lt;/a&gt;
 &lt;h3 class="h4"&gt;Building XMLBeans&lt;/h3&gt;
 &lt;p&gt;XMLBeans requires that you have Ant installed (1.6.5 works fine).&lt;/p&gt;
-&lt;a name="N1009B"&gt;&lt;/a&gt;&lt;a name="Windows"&gt;&lt;/a&gt;
+&lt;a name="N100C6"&gt;&lt;/a&gt;&lt;a name="Windows"&gt;&lt;/a&gt;
 &lt;h4&gt;Windows&lt;/h4&gt;
 &lt;p&gt;After the steps above you should see an "xmlbeans" directory (or you can choose
a 
             different name in the previous step, of course):&lt;/p&gt;
@@ -254,7 +266,7 @@
 &lt;p&gt;This will create a build directory containing the executables.  The &lt;span class="codefrag"&gt;xbean.jar&lt;/span&gt;
              is in the &lt;span class="codefrag"&gt;xmlbeans\ar&lt;/span&gt; directory. 
Try
           &lt;span class="codefrag"&gt;ant -projecthelp&lt;/span&gt; to see other build options.&lt;/p&gt;
-&lt;a name="N100B5"&gt;&lt;/a&gt;&lt;a name="Unix"&gt;&lt;/a&gt;
+&lt;a name="N100E0"&gt;&lt;/a&gt;&lt;a name="Unix"&gt;&lt;/a&gt;
 &lt;h4&gt;Unix&lt;/h4&gt;
 &lt;p&gt;Building on Unix or Cygwin is essentially the same as for Windows:&lt;/p&gt;
 &lt;pre class="code"&gt;

Modified: xmlbeans/site/src/documentation/content/xdocs/index.xml
URL: http://svn.apache.org/viewvc/xmlbeans/site/src/documentation/content/xdocs/index.xml?rev=803718&amp;r1=803717&amp;r2=803718&amp;view=diff
==============================================================================
--- xmlbeans/site/src/documentation/content/xdocs/index.xml (original)
+++ xmlbeans/site/src/documentation/content/xdocs/index.xml Wed Aug 12 21:35:45 2009
@@ -26,6 +26,17 @@
   &lt;/section&gt;
 
   &lt;section&gt;
+   &lt;title&gt;New access to XMLBeans sources (August 12, 2009)&lt;/title&gt;
+     &lt;p&gt;Git read-only access to XMLBeans sources is now available. Please see the 
+      &lt;link href="http://git.apache.org/"&gt;Git at Apache&lt;/link&gt; page for details.
+      Git Clone URL:  &lt;link href="git://git.apache.org/xmlbeans.git"&gt;git://git.apache.org/xmlbeans.git&lt;/link&gt;
and
+      Http Clone URL: &lt;link href="http://git.apache.org/xmlbeans.git"&gt;http://git.apache.org/xmlbeans.git&lt;/link&gt;.&lt;/p&gt;
+
+     &lt;p&gt;Now &lt;link href="http://grepcode.com/search/?query=xmlbeans"&gt;search and
browse XMLBeans source code&lt;/link&gt; 
+     is available thanks to &lt;link href="http://grepcode.com/"&gt;grepcode&lt;/link&gt;.&lt;/p&gt;
+  &lt;/section&gt;
+
+  &lt;section&gt;
     &lt;title&gt;New Release: Apache XMLBeans 2.4.0 (July 8, 2008)&lt;/title&gt;
     &lt;p&gt;
 	Download the latest release &lt;link href="http://www.apache.org/dyn/closer.cgi/xmlbeans"&gt;here&lt;/link&gt;.

Modified: xmlbeans/site/src/documentation/content/xdocs/news.xml
URL: http://svn.apache.org/viewvc/xmlbeans/site/src/documentation/content/xdocs/news.xml?rev=803718&amp;r1=803717&amp;r2=803718&amp;view=diff
==============================================================================
--- xmlbeans/site/src/documentation/content/xdocs/news.xml (original)
+++ xmlbeans/site/src/documentation/content/xdocs/news.xml Wed Aug 12 21:35:45 2009
@@ -9,6 +9,18 @@
 &lt;body&gt;
 
 &lt;section&gt;
+   &lt;title&gt;New access to XMLBeans sources (August 12, 2009)&lt;/title&gt;
+
+     &lt;p&gt;Git read-only access to XMLBeans sources is now available. Please see the 
+      &lt;link href="http://git.apache.org/"&gt;Git at Apache&lt;/link&gt; page for details.
+      Git Clone URL:  &lt;link href="git://git.apache.org/xmlbeans.git"&gt;git://git.apache.org/xmlbeans.git&lt;/link&gt;
and
+      Http Clone URL: &lt;link href="http://git.apache.org/xmlbeans.git"&gt;http://git.apache.org/xmlbeans.git&lt;/link&gt;.&lt;/p&gt;
+
+     &lt;p&gt;Now &lt;link href="http://grepcode.com/search/?query=xmlbeans"&gt;search and
browse XMLBeans source code&lt;/link&gt; 
+     is available thanks to &lt;link href="http://grepcode.com/"&gt;grepcode&lt;/link&gt;.&lt;/p&gt;
+&lt;/section&gt;
+
+&lt;section&gt;
     &lt;title&gt;New Release: Apache XMLBeans 2.4.0 (July 8, 2008)&lt;/title&gt;
     &lt;p&gt;
         Download the latest release &lt;link href="http://www.apache.org/dyn/closer.cgi/xmlbeans"&gt;here&lt;/link&gt;.

Modified: xmlbeans/site/src/documentation/content/xdocs/sourceAndBinaries/index.xml
URL: http://svn.apache.org/viewvc/xmlbeans/site/src/documentation/content/xdocs/sourceAndBinaries/index.xml?rev=803718&amp;r1=803717&amp;r2=803718&amp;view=diff
==============================================================================
--- xmlbeans/site/src/documentation/content/xdocs/sourceAndBinaries/index.xml (original)
+++ xmlbeans/site/src/documentation/content/xdocs/sourceAndBinaries/index.xml Wed Aug 12 21:35:45
2009
@@ -57,12 +57,14 @@
         download the source for a particular release, browse the source using
         ViewSVN/CVS, or check the source out from SVN.
       &lt;/p&gt;	
+
       &lt;section&gt;
 	&lt;title&gt;Source via ViewSVN/CVS&lt;/title&gt;
         &lt;p&gt;You can browse the XMLBeans source via 
         &lt;link href="http://svn.apache.org/viewcvs.cgi/xmlbeans/trunk/"&gt;ViewSVN/CVS&lt;/link&gt;
 	&lt;/p&gt;
       &lt;/section&gt;
+
       &lt;section&gt;
         &lt;title&gt;Source via SVN checkout&lt;/title&gt;
 
@@ -84,6 +86,23 @@
 svn co http://svn.apache.org/repos/asf/xmlbeans/trunk/samples/ xmlbeans-samples&lt;/source&gt;
 
       &lt;/section&gt;
+
+      &lt;section&gt;
+        &lt;title&gt;Source via Git&lt;/title&gt;
+
+        &lt;p&gt;Please see the &lt;link href="http://git.apache.org/"&gt;Git at Apache&lt;/link&gt;
page for details. As of this writing the Git acess is read-only.&lt;/p&gt;
+
+	&lt;p&gt;Git Clone URL:  &lt;link href="git://git.apache.org/xmlbeans.git"&gt;git://git.apache.org/xmlbeans.git&lt;/link&gt;&lt;/p&gt;
+	&lt;p&gt;Http Clone URL: &lt;link href="http://git.apache.org/xmlbeans.git"&gt;http://git.apache.org/xmlbeans.git&lt;/link&gt;&lt;/p&gt;
+      &lt;/section&gt;
+
+      &lt;section&gt;
+        &lt;title&gt;Search and Browse Sources&lt;/title&gt;
+
+        &lt;p&gt;&lt;link href="http://grepcode.com/search/?query=xmlbeans"&gt;Grep XMLBeans
code&lt;/link&gt; with 
+           &lt;link href="http://grepcode.com/"&gt;grepcode&lt;/link&gt;.&lt;/p&gt;
+      &lt;/section&gt;
+
       &lt;section&gt;
         &lt;title&gt;Building XMLBeans&lt;/title&gt;
         &lt;p&gt;XMLBeans requires that you have Ant installed (1.6.5 works fine).&lt;/p&gt;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r801796 - /xmlbeans/site/README</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200908.mbox/%3c20090806195435.6585623888AD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090806195435-6585623888AD@eris-apache-org%3e</id>
<updated>2009-08-06T19:54:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Aug  6 19:54:35 2009
New Revision: 801796

URL: http://svn.apache.org/viewvc?rev=801796&amp;view=rev
Log:
Adding ho to update site instructions.


Added:
    xmlbeans/site/README

Added: xmlbeans/site/README
URL: http://svn.apache.org/viewvc/xmlbeans/site/README?rev=801796&amp;view=auto
==============================================================================
--- xmlbeans/site/README (added)
+++ xmlbeans/site/README Thu Aug  6 19:54:35 2009
@@ -0,0 +1,33 @@
+TO DO when updating the website:
+--------------------------------
+
+1. have https://svn.apache.org/repos/asf/xmlbeans/site tree checked out
+	svn co https://svn.apache.org/repos/asf/xmlbeans/site xmlbeans-site
+
+2. make sure you're using forrest 0.8
+
+3. modify files in ./src
+
+4. make sure you tun jdk1.5 (forrest 0.8 with jdk1.6 ends with a rng validation error)
+	- java -version is 1.5
+	export PATH=path_to_jdk15:$PATH
+	set PATH=path_to_jdk1.5\bin;%PATH%
+	- JAVA_HOME points to 1.5 jdk
+	set JAVA_HOME=path+to_jdk15
+	
+5. run forrest - will generate all files in build
+	path_to_forrest0.8/forrest site
+	
+6. make sure you svn add any new files
+	svn status
+	svn add ...
+
+7. checkin changes src and build
+	svn ci
+
+8. login into people.apache.org
+	ssh people.apache.org
+
+9. update site from svn repo in:
+	cd /www/xmlbeans.apache.org
+	svn up
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r801793 - in /xmlbeans/site: build/site/community/index.html build/site/resources/index.html src/documentation/content/xdocs/resources/index.xml</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200908.mbox/%3c20090806194622.D76892388981@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090806194622-D76892388981@eris-apache-org%3e</id>
<updated>2009-08-06T19:46:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Aug  6 19:46:22 2009
New Revision: 801793

URL: http://svn.apache.org/viewvc?rev=801793&amp;view=rev
Log:
Updated links to tools and articles.


Modified:
    xmlbeans/site/build/site/community/index.html
    xmlbeans/site/build/site/resources/index.html
    xmlbeans/site/src/documentation/content/xdocs/resources/index.xml

Modified: xmlbeans/site/build/site/community/index.html
URL: http://svn.apache.org/viewvc/xmlbeans/site/build/site/community/index.html?rev=801793&amp;r1=801792&amp;r2=801793&amp;view=diff
==============================================================================
--- xmlbeans/site/build/site/community/index.html (original)
+++ xmlbeans/site/build/site/community/index.html Thu Aug  6 19:46:22 2009
@@ -224,8 +224,8 @@
 &lt;tr&gt;
 					
 &lt;td colspan="1" rowspan="1"&gt;Cezar Andrei&lt;/td&gt;
-					&lt;td colspan="1" rowspan="1"&gt;cezar.andrei@no#spam#!bea.com&lt;/td&gt;
-					&lt;td colspan="1" rowspan="1"&gt;&amp;nbsp;&lt;/td&gt;
+					&lt;td colspan="1" rowspan="1"&gt;cezar.andrei@no#spam#!gmail.com&lt;/td&gt;
+					&lt;td colspan="1" rowspan="1"&gt;&lt;a href="http://www.linkedin.com/in/cezarandrei"&gt;LinkedIn&lt;/a&gt;&lt;/td&gt;
 				
 &lt;/tr&gt;
 				
@@ -242,7 +242,15 @@
 &lt;tr&gt;
 					
 &lt;td colspan="1" rowspan="1"&gt;Patrick Calahan&lt;/td&gt;
-					&lt;td colspan="1" rowspan="1"&gt;pcal@no#spam.bea.com&lt;/td&gt;
+					&lt;td colspan="1" rowspan="1"&gt;pcal@no#spam.apache.org&lt;/td&gt;
+					&lt;td colspan="1" rowspan="1"&gt;&amp;nbsp;&lt;/td&gt;
+				
+&lt;/tr&gt;
+				
+&lt;tr&gt;
+					
+&lt;td colspan="1" rowspan="1"&gt;Jacob Danner&lt;/td&gt;
+					&lt;td colspan="1" rowspan="1"&gt;jacob.danner@no#spam.gmail!.com&lt;/td&gt;
 					&lt;td colspan="1" rowspan="1"&gt;&amp;nbsp;&lt;/td&gt;
 				
 &lt;/tr&gt;
@@ -250,7 +258,7 @@
 &lt;tr&gt;
 					
 &lt;td colspan="1" rowspan="1"&gt;Yana Kadiyska&lt;/td&gt;
-					&lt;td colspan="1" rowspan="1"&gt;ykadiysk@no#spam#!bea.com&lt;/td&gt;
+					&lt;td colspan="1" rowspan="1"&gt;yana@no#spam#!apache.org&lt;/td&gt;
 					&lt;td colspan="1" rowspan="1"&gt;&amp;nbsp;&lt;/td&gt;
 				
 &lt;/tr&gt;
@@ -322,7 +330,7 @@
 &lt;tr&gt;
 					
 &lt;td colspan="1" rowspan="1"&gt;Scott Ziegler&lt;/td&gt;
-					&lt;td colspan="1" rowspan="1"&gt;scott.ziegler@n#ospam.bea.com&lt;/td&gt;
+					&lt;td colspan="1" rowspan="1"&gt;zieg@n#ospam.apache.org&lt;/td&gt;
 					&lt;td colspan="1" rowspan="1"&gt;&amp;nbsp;&lt;/td&gt;
 				
 &lt;/tr&gt;
@@ -339,10 +347,10 @@
 &lt;/div&gt;
 &lt;/div&gt;
 		
-&lt;a name="N101B1"&gt;&lt;/a&gt;&lt;a name="Related+Projects"&gt;&lt;/a&gt;
+&lt;a name="N101C5"&gt;&lt;/a&gt;&lt;a name="Related+Projects"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;Related Projects&lt;/h2&gt;
 &lt;div class="section"&gt;
-&lt;a name="N101B7"&gt;&lt;/a&gt;&lt;a name="Eclipse+Plugin"&gt;&lt;/a&gt;
+&lt;a name="N101CB"&gt;&lt;/a&gt;&lt;a name="Eclipse+Plugin"&gt;&lt;/a&gt;
 &lt;h3 class="h4"&gt;Eclipse Plugin&lt;/h3&gt;
 &lt;p&gt;Development is under way for an XMLBeans IDE plugin. The current focus is on Eclipse
v3 support. For more information, see the &lt;a href="http://sourceforge.net/projects/xmlbeansplug/"&gt;XMLBeans
Plugin project&lt;/a&gt; at the Sourceforge web site.&lt;/p&gt;
 &lt;/div&gt;

Modified: xmlbeans/site/build/site/resources/index.html
URL: http://svn.apache.org/viewvc/xmlbeans/site/build/site/resources/index.html?rev=801793&amp;r1=801792&amp;r2=801793&amp;view=diff
==============================================================================
--- xmlbeans/site/build/site/resources/index.html (original)
+++ xmlbeans/site/build/site/resources/index.html Thu Aug  6 19:46:22 2009
@@ -145,42 +145,16 @@
 &lt;h2 class="h3"&gt;XMLBeans Tools&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
-			
-&lt;a href="http://xmlbeans.webappshosting.com/schemaToolsV103"&gt;XMLBeans Schema Tools
(XMLBeans Version 1.0.3)&lt;/a&gt;
-			&amp;nbsp;This site allows XML Schema validation and compilation tools.  You can submit
an XML Schema (via file upload or
-			cut and paste) or a set of XML Schemas (zip file) and you can download the resulting XMLBeans
JAR file.
+			IntellyJ IDEA 8 - XMLBeans Generator plug-in. Avalable in IntelliJ plug-in list.
 		&lt;/p&gt;
-&lt;ul&gt;
-				
-&lt;li&gt;
-&lt;a href="http://xmlbeans.webappshosting.com/schemaToolsV103/validate.do"&gt;XMLBeans V1.0.3
Schema Validation&lt;/a&gt;
-&lt;/li&gt;
-				
-&lt;li&gt;
-&lt;a href="http://xmlbeans.webappshosting.com/schemaToolsV103/compile.do"&gt;XMLBeans V1.0.3
Schema Compilation&lt;/a&gt;
-&lt;/li&gt;
-			
-&lt;/ul&gt;
 &lt;p&gt;
 			
-&lt;a href="http://xmlbeans.webappshosting.com/schemaToolsV2"&gt;XMLBeans Schema Tools (XMLBeans
Version 2.0)&lt;/a&gt;
-			&amp;nbsp;Same as above but for XMLBeans V2.0
+&lt;a href="http://xmlbeansplug.sourceforge.net/"&gt;Eclipse - XMLBeans plug-in&lt;/a&gt;.
&lt;a href="http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/x/project/xm/xmlbeansplug/EclipseXMLBeansPlugin.pdf"&gt;Documentation&lt;/a&gt;.
 		&lt;/p&gt;
-&lt;ul&gt;
-				
-&lt;li&gt;
-&lt;a href="http://xmlbeans.webappshosting.com/schemaToolsV2/validate.do"&gt;XMLBeans V2.0
Schema Validation&lt;/a&gt;
-&lt;/li&gt;
-				
-&lt;li&gt;
-&lt;a href="http://xmlbeans.webappshosting.com/schemaToolsV2/compile.do"&gt;XMLBeans V2.0
Schema Compilation&lt;/a&gt;
-&lt;/li&gt;
-			
-&lt;/ul&gt;
 &lt;p&gt;Do you have or know of a tool that works with XMLBeans?  Let us know and we will
list it here.&lt;/p&gt;
 &lt;/div&gt;
 	
-&lt;a name="N1003E"&gt;&lt;/a&gt;&lt;a name="XMLBeans+Articles"&gt;&lt;/a&gt;
+&lt;a name="N10026"&gt;&lt;/a&gt;&lt;a name="XMLBeans+Articles"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;XMLBeans Articles&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;
@@ -188,29 +162,29 @@
 &lt;a href="http://www.ibm.com/developerworks/webservices/library/ws-soa-clientxmlbeans.html"&gt;Use
XMLBeans to create a Web service client&lt;/a&gt;, IBM developerWorks, Jul 18 2006&lt;br&gt;
 			
 &lt;a href="http://www-128.ibm.com/developerworks/webservices/library/os-ag-soa/index.html?ca=dnx-610"&gt;Deploy
SOA applications in Apache Geronimo using XMLBeans&lt;/a&gt;, IBM developerWorks, May 09 2006&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/Configuring_XMLBeans.jsp"&gt;Configuring
XMLBeans&lt;/a&gt;, BEA dev2dev, Nov 30 2004&lt;br&gt;
+			Configuring XMLBeans, BEA dev2dev, Nov 30 2004 &lt;a href="http://web.archive.org/web/20060101225745/dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
 			
 &lt;a href="http://www.apache.org/~kkrouse/apachecon/ac2004_XmlBeans_v2.ppt"&gt;Apache XMLBeans
2: Accessing the Full Power of XML in Java&lt;/a&gt; (ppt), www.apache.com/~kkrouse, Nov 2004&lt;br&gt;
 			
 &lt;a href="http://www.onjava.com/pub/a/onjava/2004/07/28/XMLBeans.html"&gt;XML-Java Data
Binding Using XMLBeans&lt;/a&gt;, onJava.com, Jul 2004&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/hanson_xmlbeans_ws.jsp"&gt;Using
XMLBeans in Web Service Clients and User Interfaces&lt;/a&gt;, BEA Dev2Dev, May 2004&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/XMLBeans_raj.jsp"&gt;Leveraging
Complex Schema Features in Java the XMLBeans Way&lt;/a&gt;, BEA Dev2Dev, May 2004&lt;br&gt;
		
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/xmlbeans_andrei.jsp"&gt;Strongly
Typed XML in Java with XMLBeans&lt;/a&gt;, May 2004&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/ryan_xml.jsp"&gt;XML Processing
with Java Object Technology&lt;/a&gt;, May 2004&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/products/wlworkshop81/articles/xmlbeans_dynamic_config.jsp"&gt;Using
XMLBeans to Implement Dynamic Configuration Files&lt;/a&gt;, BEA Dev2Dev, April 2004&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/conaty_xmlbeans.jsp"&gt;XMLBeans
as First-Class Data Objects&lt;/a&gt;, BEA Dev2Dev, May 2004&lt;br&gt;
+			Using XMLBeans in Web Service Clients and User Interfaces, BEA Dev2Dev, May 2004 &lt;a
href="http://web.archive.org/web/20060617035331/dev2dev.bea.com/pub/a/2004/05/hanson_xmlbeans_ws.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
+			Leveraging Complex Schema Features in Java the XMLBeans Way, BEA Dev2Dev, May 2004 &lt;a
href="http://web.archive.org/web/20060617035457/dev2dev.bea.com/pub/a/2004/05/XMLBeans_raj.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
+			Strongly Typed XML in Java with XMLBeans,Cezar Cristian Andrei, May 2004, &lt;a href="http://web.archive.org/web/20060101222246/dev2dev.bea.com/pub/a/2004/05/xmlbeans_andrei.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
+			XML Processing with Java Object Technology, May 2004 &lt;a href="http://web.archive.org/web/20060617035533/dev2dev.bea.com/pub/a/2004/05/ryan_xml.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
+			Using XMLBeans to Implement Dynamic Configuration Files, BEA Dev2Dev, April 2004 &lt;a
href="http://web.archive.org/web/20060906063051/dev2dev.bea.com/pub/a/2004/04/xmlbeans_dynamic_config.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
+			XMLBeans as First-Class Data Objects, BEA Dev2Dev, May 2004 &lt;a href=""&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
+			Handling Mixed Content in a Strongly-Typed World, BEA Dev2Dev, Nov 2003 &lt;a href="http://web.archive.org/web/20060617035319/dev2dev.bea.com/pub/a/2003/11/traut.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
 			
 &lt;a href="http://javaboutique.internet.com/reviews/xml_javabeans/"&gt;Converting XML to
JavaBeans with XMLBeans&lt;/a&gt;, JavaBoutique&lt;br&gt;
 			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/traut.jsp"&gt;Handling
Mixed Content in a Strongly-Typed World&lt;/a&gt;, BEA Dev2Dev, Nov 2003&lt;br&gt;
-			
 &lt;a href="http://davidbau.com/archives/2003/11/14/the_design_of_xmlbeans_part_1.html"&gt;The
Design of XMLBeans (Part 1)&lt;/a&gt;, davidbau.com, Nov 2003&lt;br&gt;
 			
 &lt;a href="http://davidbau.com/archives/2003/11/19/the_design_of_xmlbeans_part_2.html"&gt;The
Design of XMLBeans (Part 2)&lt;/a&gt;, davidbau.com, Nov 2003&lt;br&gt;
@@ -220,10 +194,10 @@
 &lt;a href="http://www.devx.com/xml/Article/17495"&gt;XML Made Easy with XMLBeans&lt;/a&gt;,
DevX.com, Oct 2003&lt;br&gt;
 			
 &lt;a href="http://www.sys-con.com/xml/article.cfm?id=614"&gt;XML Beans: The Best of Both
Worlds&lt;/a&gt;, XML Journal, June 2003&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/Bau.jsp"&gt;XML Beans (by
David Bau)&lt;/a&gt;, BEA Dev2Dev, Mar 2003&lt;br&gt;
-			
-&lt;a href="http://dev2dev.bea.com/technologies/xmlbeans/articles/DJ_003.jsp"&gt;Dear John
(Column #3) - An XMLBeans Example: Address Book&lt;/a&gt;, BEA Dev2Dev, Feb 2003 &lt;br&gt;

+			XML Beans (by David Bau), BEA Dev2Dev, Mar 2003 &lt;a href="http://web.archive.org/web/20060617035510/dev2dev.bea.com/pub/a/2003/03/Bau.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt;
+			Dear John (Column #3) - An XMLBeans Example: Address Book, BEA Dev2Dev, Feb 2003 &lt;a
href="http://web.archive.org/web/20060617035444/dev2dev.bea.com/pub/a/2003/02/DJ_003.html"&gt;archive.org
link&lt;/a&gt;
+&lt;br&gt; 
 		
 &lt;/p&gt;
 &lt;p&gt;
@@ -237,7 +211,7 @@
 &lt;p&gt;Do you know of an XMLBeans article that is not listed here?  Let us know and we
will list it here.&lt;/p&gt;
 &lt;/div&gt;
 	
-&lt;a name="N100D4"&gt;&lt;/a&gt;&lt;a name="XMLBeans+Books"&gt;&lt;/a&gt;
+&lt;a name="N100B2"&gt;&lt;/a&gt;&lt;a name="XMLBeans+Books"&gt;&lt;/a&gt;
 &lt;h2 class="h3"&gt;XMLBeans Books&lt;/h2&gt;
 &lt;div class="section"&gt;
 &lt;p&gt;

Modified: xmlbeans/site/src/documentation/content/xdocs/resources/index.xml
URL: http://svn.apache.org/viewvc/xmlbeans/site/src/documentation/content/xdocs/resources/index.xml?rev=801793&amp;r1=801792&amp;r2=801793&amp;view=diff
==============================================================================
--- xmlbeans/site/src/documentation/content/xdocs/resources/index.xml (original)
+++ xmlbeans/site/src/documentation/content/xdocs/resources/index.xml Thu Aug  6 19:46:22
2009
@@ -7,7 +7,7 @@
   &lt;body&gt;
 	&lt;section&gt;
 		&lt;title&gt;XMLBeans Tools&lt;/title&gt;
-		&lt;p&gt;
+		&lt;!--p&gt;
 			&lt;link href="http://xmlbeans.webappshosting.com/schemaToolsV103"&gt;XMLBeans Schema
Tools (XMLBeans Version 1.0.3)&lt;/link&gt;
 			&amp;nbsp;This site allows XML Schema validation and compilation tools.  You can submit
an XML Schema (via file upload or
 			cut and paste) or a set of XML Schemas (zip file) and you can download the resulting XMLBeans
JAR file.
@@ -23,7 +23,16 @@
 			&lt;ul&gt;
 				&lt;li&gt;&lt;link href="http://xmlbeans.webappshosting.com/schemaToolsV2/validate.do"
&gt;XMLBeans V2.0 Schema Validation&lt;/link&gt;&lt;/li&gt;
 				&lt;li&gt;&lt;link href="http://xmlbeans.webappshosting.com/schemaToolsV2/compile.do"
&gt;XMLBeans V2.0 Schema Compilation&lt;/link&gt;&lt;/li&gt;
-			&lt;/ul&gt;
+			&lt;/ul--&gt;
+		
+		&lt;p&gt;
+			IntellyJ IDEA 8 - XMLBeans Generator plug-in. Avalable in IntelliJ plug-in list.
+		&lt;/p&gt;
+		
+		&lt;p&gt;
+			&lt;link href="http://xmlbeansplug.sourceforge.net/"&gt;Eclipse - XMLBeans plug-in&lt;/link&gt;.
&lt;link href="http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/x/project/xm/xmlbeansplug/EclipseXMLBeansPlugin.pdf"&gt;Documentation&lt;/link&gt;.
+		&lt;/p&gt;
+
 		&lt;p&gt;Do you have or know of a tool that works with XMLBeans?  Let us know and we will
list it here.&lt;/p&gt;
 	&lt;/section&gt;
 	&lt;section&gt;
@@ -31,24 +40,24 @@
 		&lt;p&gt;
        			&lt;link href="http://www.ibm.com/developerworks/webservices/library/ws-soa-clientxmlbeans.html"&gt;Use
XMLBeans to create a Web service client&lt;/link&gt;, IBM developerWorks, Jul 18 2006&lt;br
/&gt;
 			&lt;link href="http://www-128.ibm.com/developerworks/webservices/library/os-ag-soa/index.html?ca=dnx-610"&gt;Deploy
SOA applications in Apache Geronimo using XMLBeans&lt;/link&gt;, IBM developerWorks, May 09
2006&lt;br /&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/Configuring_XMLBeans.jsp"&gt;Configuring
XMLBeans&lt;/link&gt;, BEA dev2dev, Nov 30 2004&lt;br /&gt;
+			Configuring XMLBeans, BEA dev2dev, Nov 30 2004 &lt;link href="http://web.archive.org/web/20060101225745/dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
 			&lt;link href="http://www.apache.org/~kkrouse/apachecon/ac2004_XmlBeans_v2.ppt"&gt;Apache
XMLBeans 2: Accessing the Full Power of XML in Java&lt;/link&gt; (ppt), www.apache.com/~kkrouse,
Nov 2004&lt;br /&gt;
 			&lt;link href="http://www.onjava.com/pub/a/onjava/2004/07/28/XMLBeans.html"&gt;XML-Java
Data Binding Using XMLBeans&lt;/link&gt;, onJava.com, Jul 2004&lt;br /&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/hanson_xmlbeans_ws.jsp"&gt;Using
XMLBeans in Web Service Clients and User Interfaces&lt;/link&gt;, BEA Dev2Dev, May 2004&lt;br
/&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/XMLBeans_raj.jsp"&gt;Leveraging
Complex Schema Features in Java the XMLBeans Way&lt;/link&gt;, BEA Dev2Dev, May 2004&lt;br
/&gt;			
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/xmlbeans_andrei.jsp"&gt;Strongly
Typed XML in Java with XMLBeans&lt;/link&gt;, May 2004&lt;br /&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/ryan_xml.jsp"&gt;XML
Processing with Java Object Technology&lt;/link&gt;, May 2004&lt;br /&gt;
-			&lt;link href="http://dev2dev.bea.com/products/wlworkshop81/articles/xmlbeans_dynamic_config.jsp"&gt;Using
XMLBeans to Implement Dynamic Configuration Files&lt;/link&gt;, BEA Dev2Dev, April 2004&lt;br
/&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/conaty_xmlbeans.jsp"&gt;XMLBeans
as First-Class Data Objects&lt;/link&gt;, BEA Dev2Dev, May 2004&lt;br /&gt;
+			Using XMLBeans in Web Service Clients and User Interfaces, BEA Dev2Dev, May 2004 &lt;link
href="http://web.archive.org/web/20060617035331/dev2dev.bea.com/pub/a/2004/05/hanson_xmlbeans_ws.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
+			Leveraging Complex Schema Features in Java the XMLBeans Way, BEA Dev2Dev, May 2004 &lt;link
href="http://web.archive.org/web/20060617035457/dev2dev.bea.com/pub/a/2004/05/XMLBeans_raj.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
+			Strongly Typed XML in Java with XMLBeans,Cezar Cristian Andrei, May 2004, &lt;link href="http://web.archive.org/web/20060101222246/dev2dev.bea.com/pub/a/2004/05/xmlbeans_andrei.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
+			XML Processing with Java Object Technology, May 2004 &lt;link href="http://web.archive.org/web/20060617035533/dev2dev.bea.com/pub/a/2004/05/ryan_xml.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
+			Using XMLBeans to Implement Dynamic Configuration Files, BEA Dev2Dev, April 2004 &lt;link
href="http://web.archive.org/web/20060906063051/dev2dev.bea.com/pub/a/2004/04/xmlbeans_dynamic_config.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
+			XMLBeans as First-Class Data Objects, BEA Dev2Dev, May 2004 &lt;link href=""&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
+			Handling Mixed Content in a Strongly-Typed World, BEA Dev2Dev, Nov 2003 &lt;link href="http://web.archive.org/web/20060617035319/dev2dev.bea.com/pub/a/2003/11/traut.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
 			&lt;link href="http://javaboutique.internet.com/reviews/xml_javabeans/"&gt;Converting
XML to JavaBeans with XMLBeans&lt;/link&gt;, JavaBoutique&lt;br /&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/traut.jsp"&gt;Handling
Mixed Content in a Strongly-Typed World&lt;/link&gt;, BEA Dev2Dev, Nov 2003&lt;br /&gt;
 			&lt;link href="http://davidbau.com/archives/2003/11/14/the_design_of_xmlbeans_part_1.html"&gt;The
Design of XMLBeans (Part 1)&lt;/link&gt;, davidbau.com, Nov 2003&lt;br /&gt;
 			&lt;link href="http://davidbau.com/archives/2003/11/19/the_design_of_xmlbeans_part_2.html"&gt;The
Design of XMLBeans (Part 2)&lt;/link&gt;, davidbau.com, Nov 2003&lt;br /&gt;
 			&lt;link href="http://davidbau.com/archives/2003/12/18/the_design_of_xmlbeans_part_3.html"&gt;The
Design of XMLBeans (Part 3)&lt;/link&gt;, davidbau.com, Dec 2003&lt;br /&gt;
 			&lt;link href="http://www.devx.com/xml/Article/17495"&gt;XML Made Easy with XMLBeans&lt;/link&gt;,
DevX.com, Oct 2003&lt;br /&gt;
 			&lt;link href="http://www.sys-con.com/xml/article.cfm?id=614"&gt;XML Beans: The Best of
Both Worlds&lt;/link&gt;, XML Journal, June 2003&lt;br /&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/Bau.jsp"&gt;XML Beans
(by David Bau)&lt;/link&gt;, BEA Dev2Dev, Mar 2003&lt;br /&gt;
-			&lt;link href="http://dev2dev.bea.com/technologies/xmlbeans/articles/DJ_003.jsp"&gt;Dear
John (Column #3) - An XMLBeans Example: Address Book&lt;/link&gt;, BEA Dev2Dev, Feb 2003 &lt;br
/&gt; 
+			XML Beans (by David Bau), BEA Dev2Dev, Mar 2003 &lt;link href="http://web.archive.org/web/20060617035510/dev2dev.bea.com/pub/a/2003/03/Bau.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt;
+			Dear John (Column #3) - An XMLBeans Example: Address Book, BEA Dev2Dev, Feb 2003 &lt;link
href="http://web.archive.org/web/20060617035444/dev2dev.bea.com/pub/a/2003/02/DJ_003.html"&gt;archive.org
link&lt;/link&gt;&lt;br /&gt; 
 		&lt;/p&gt;
 		&lt;p&gt;
 			For spanish speaking developers:&lt;br /&gt;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r801498 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200908.mbox/%3c20090806021927.DF3012388985@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090806021927-DF3012388985@eris-apache-org%3e</id>
<updated>2009-08-06T02:19:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Thu Aug  6 02:19:27 2009
New Revision: 801498

URL: http://svn.apache.org/viewvc?rev=801498&amp;view=rev
Log:
Changed the way integer derivation check is done in Validator.java.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java?rev=801498&amp;r1=801497&amp;r2=801498&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java Thu Aug
 6 02:19:27 2009
@@ -23,7 +23,6 @@
 import org.apache.xmlbeans.impl.common.InvalidLexicalValueException;
 import org.apache.xmlbeans.impl.schema.SchemaTypeVisitorImpl;
 import org.apache.xmlbeans.impl.schema.SchemaTypeImpl;
-import org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem;
 import org.apache.xmlbeans.impl.values.JavaBase64HolderEx;
 import org.apache.xmlbeans.impl.values.JavaBooleanHolder;
 import org.apache.xmlbeans.impl.values.JavaBooleanHolderEx;
@@ -1023,6 +1022,19 @@
         State _next;
     }
 
+    private boolean derivedFromInteger( SchemaType type )
+    {
+        int btc = type.getBuiltinTypeCode();
+
+        while (btc == SchemaType.BTC_NOT_BUILTIN)
+        {
+            type = type.getBaseType();
+            btc = type.getBuiltinTypeCode();
+        }
+        // This depends on the ordering of the constant values, which is not ideal but is
easier
+        return btc &gt;= SchemaType.BTC_INTEGER &amp;&amp; btc &lt;= SchemaType.BTC_UNSIGNED_BYTE;
+    }
+
     private void newState ( SchemaType type, SchemaField field, boolean isNil )
     {
         State state = new State();
@@ -1293,9 +1305,7 @@
             // An additional rule states that if the type is xs:integer or derived from it,
             // then the decimal dot is not allowed.
             // verify that values extending xsd:integer don't have a decimal point
-            if ( _strict &amp;&amp;
-                BuiltinSchemaTypeSystem.ST_INTEGER.isAssignableFrom( type ) &amp;&amp;
-                value.lastIndexOf('.') &gt;= 0)
+            if ( _strict &amp;&amp; derivedFromInteger( type ) &amp;&amp; value.lastIndexOf('.')
&gt;= 0 )
             {
                 _vc.invalid(XmlErrorCodes.INTEGER, new Object[] { value });
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r799690 - /xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200907.mbox/%3c20090731184243.076AC23888DC@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090731184243-076AC23888DC@eris-apache-org%3e</id>
<updated>2009-07-31T18:42:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Fri Jul 31 18:42:42 2009
New Revision: 799690

URL: http://svn.apache.org/viewvc?rev=799690&amp;view=rev
Log:
Fix for a corner case of emiting the doctype root element.


Modified:
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=799690&amp;r1=799689&amp;r2=799690&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Fri Jul 31 18:42:42
2009
@@ -364,6 +364,22 @@
             if (docTypeName != null)
             {
                 QName rootElemName = _cur.getName();
+
+                if ( rootElemName == null )
+                {
+                    _cur.push();
+                    while ( !_cur.isFinish() )
+                    {
+                        if (_cur.isElem())
+                        {
+                            rootElemName = _cur.getName();
+                            break;
+                        }
+                        _cur.next();
+                    }
+                    _cur.pop();
+                }
+
                 if ( rootElemName!=null &amp;&amp; docTypeName.equals(rootElemName.getLocalPart())
)
                 {
                     emitDocType( docTypeName, publicId, systemId );



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r799073 - in /xmlbeans/trunk/src: common/org/apache/xmlbeans/impl/common/NameUtil.java typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200907.mbox/%3c20090729205504.BC49A2388893@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090729205504-BC49A2388893@eris-apache-org%3e</id>
<updated>2009-07-29T20:55:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Wed Jul 29 20:55:04 2009
New Revision: 799073

URL: http://svn.apache.org/viewvc?rev=799073&amp;view=rev
Log:
Fix src generator to avoid vars that colide with used package names.


Modified:
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java?rev=799073&amp;r1=799072&amp;r2=799073&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/NameUtil.java Wed Jul 29 20:55:04
2009
@@ -93,6 +93,16 @@
         }
     ));
 
+    private final static Set extraWords = new HashSet(Arrays.asList(
+        new String[]
+        {
+              "i",          // used for indexes
+              "target",     // used for parameter
+              "org",        // used for package names
+              "com",        // used for package names
+        }
+    ));
+
     /*
     private final static Set javaNames = new HashSet(Arrays.asList(
         new String[]
@@ -756,6 +766,18 @@
     }
 
     /**
+     * Intended to be applied to a lowercase-starting identifier that
+     * may collide with a Java keyword.  If it does collide, this
+     * prepends the letter "x".
+     */
+    public static String nonExtraKeyword(String word)
+    {
+        if (isExtraReservedWord(word, true))
+            return word + "Value";
+        return word;
+    }
+
+    /**
      * Intended to be applied to an uppercase-starting identifier that
      * may collide with a java.lang.* classname.  If it does collide, this
      * prepends the letter "X".
@@ -779,6 +801,13 @@
         return javaWords.contains(word);
     }
 
+    private static boolean isExtraReservedWord(String word, boolean ignore_case)
+    {
+        if (ignore_case)
+            word = word.toLowerCase();
+        return extraWords.contains(word);
+    }
+
     public static boolean isJavaCommonClassName(String word)
     {
         return javaNames.contains(word);

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java?rev=799073&amp;r1=799072&amp;r2=799073&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
Wed Jul 29 20:55:04 2009
@@ -2299,10 +2299,7 @@
         throws IOException
     {
         String safeVarName = NameUtil.nonJavaKeyword(NameUtil.lowerCamelCase(propertyName));
-        if (safeVarName.equals("i"))
-            safeVarName = "iValue";
-        else if (safeVarName.equals("target"))
-            safeVarName = "targetValue";
+        safeVarName = NameUtil.nonExtraKeyword(safeVarName);
 
         boolean xmltype = (javaType == SchemaProperty.XML_OBJECT);
         boolean isobj = (javaType == SchemaProperty.JAVA_OBJECT);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r797249 - in /xmlbeans/trunk: src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java test/src/ValidatingXSRTests/checkin/TestUriValidation.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200907.mbox/%3c20090723223035.7425D23888D3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090723223035-7425D23888D3@eris-apache-org%3e</id>
<updated>2009-07-23T22:30:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Jul 23 22:30:34 2009
New Revision: 797249

URL: http://svn.apache.org/viewvc?rev=797249&amp;view=rev
Log:
Update list of chars to be replaced in URI validation.


Added:
    xmlbeans/trunk/test/src/ValidatingXSRTests/checkin/TestUriValidation.java
Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java?rev=797249&amp;r1=797248&amp;r2=797249&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java Thu Jul
23 22:30:34 2009
@@ -42,6 +42,10 @@
     private static final String EMPTY_PREFIX = "";
     private static final BigDecimal DECIMAL__ZERO = new BigDecimal(0.0);
 
+    // See Section 2.4.3 of FRC2396  http://www.ietf.org/rfc/rfc2396.txt
+    private static final String[] URI_CHARS_TO_BE_REPLACED = {" "  , "{"  , "}"  , "|"  ,
"\\" , "^"  , "["  , "]"  , "`"  };
+    private static final String[] URI_CHARS_REPLACED_WITH  = {"%20", "%7b", "%7d", "%7c",
"%5c", "%5e", "%5b", "%5d", "%60"};
+
     // ======================== float ========================
     public static float lexFloat(CharSequence cs)
         throws NumberFormatException
@@ -762,11 +766,14 @@
 
         // Per XMLSchema spec allow spaces inside URIs
         StringBuffer s = new StringBuffer(lexical_value.toString());
-        int i = 0;
-        while ((i = s.indexOf(" ", i)) &gt;= 0)
+        for (int ic = 0; ic&lt;URI_CHARS_TO_BE_REPLACED.length; ic++)
         {
-            s.replace(i, i + 1, "%20");
-            i += 3;
+            int i = 0;
+            while ((i = s.indexOf(URI_CHARS_TO_BE_REPLACED[ic], i)) &gt;= 0)
+            {
+                s.replace(i, i + 1, URI_CHARS_REPLACED_WITH[ic]);
+                i += 3;
+            }
         }
 
         try

Added: xmlbeans/trunk/test/src/ValidatingXSRTests/checkin/TestUriValidation.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/ValidatingXSRTests/checkin/TestUriValidation.java?rev=797249&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/ValidatingXSRTests/checkin/TestUriValidation.java (added)
+++ xmlbeans/trunk/test/src/ValidatingXSRTests/checkin/TestUriValidation.java Thu Jul 23 22:30:34
2009
@@ -0,0 +1,110 @@
+package ValidatingXSRTests.checkin;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.framework.TestCase;
+import junit.framework.Assert;
+import org.apache.xmlbeans.impl.util.XsTypeConverter;
+import org.apache.xmlbeans.impl.common.InvalidLexicalValueException;
+
+/**
+ * Created by Cezar Andrei (cezar dot andrei at gmail dot com)
+ * Date: Jul 23, 2009
+ */
+public class TestUriValidation
+    extends TestCase
+{
+    public TestUriValidation(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite()
+    {
+        return new TestSuite(TestUriValidation.class);
+    }
+
+    public void testLexAnyUriValid()
+    {
+        String[] validURIs = {
+            "http://www.ics.uci.edu/pub/ietf/uri/#Related",
+            "http://www.ics.uci.edu/pub/ietf/uri/?query=abc#Related",
+            "http://a/b/c/d;p?q",
+            "g:h",
+            "./g",
+            "g/",
+            "/g",
+            "//g",
+            "?y",
+            "g?y",
+            "#s",
+            "g#s",
+            "g?y#s",
+            ";x",
+            "g;x",
+            "g;x?y#s",
+            ".",
+            "./",
+            "..",
+            "../",
+            "../g",
+            "../..",
+            "../../",
+            "../../g",
+            "http:// www   .ics.uci.edu   /pub/ietf/uri  /#Related",
+            "http:// www   .ics.uci.edu   /pub/iet%20%20f/uri  /#Related",
+            "http:\\example.com\\examples",
+            "http:\\\\example.com\\\\examples",
+        };
+
+        for (int i = 0; i &lt; validURIs.length; i++)
+        {
+            try
+            {
+                XsTypeConverter.lexAnyURI(validURIs[i]);
+            }
+            catch (RuntimeException e)
+            {
+                System.out.println("URI should be valid: " + validURIs[i] + "  " + e.getCause().getCause().getMessage());
+                Assert.assertTrue("URI should be valid: " + validURIs[i], false);
+                throw new IllegalStateException("URI should be valid: " + validURIs[i]);
+            }
+        }
+    }
+
+    public void testLexAnyUriInvalid()
+    {
+        // From XQTS cvshead June 2009
+        String[] invalidURIs = {
+            "http:\\\\invalid&gt;URI\\someURI",        // K2-SeqExprCast-207: Construct an
xs:anyURI from an invalid string. However, in F&amp;O 17.1.1, it is said that "For xs:anyURI,
the extent to which an implementation validates the lexical form of xs:anyURI is implementation
dependent.".
+            "http://www.example.com/file%GF.html",  // K2-SeqExprCast-210: '%' is not a disallowed
character and therefore it's not encoded before being considered for RFC 2396 validness.
+            "foo://",                               // K2-SeqExprCast-421: Pass an invalid
anyURI.
+            "foo:",                                 // K2-SeqExprCast-421-2: Pass an invalid
anyURI.
+            "%gg",                                  // K2-SeqExprCast-422: Pass an invalid
anyURI(#2).
+            ":/cut.jpg",                            // K2-SeqExprCast-423: no scheme
+            ":/images/cut.png",                     // K2-SeqExprCast-424: An URI without
scheme, combined with a relative directory.
+            ":/",                                   // K2-SeqExprCast-505: ':/' is an invalid
URI, no scheme.
+            "http:%%",                              // fn-resolve-uri-4: Evaluation of resolve-uri
function with an invalid URI value for second argument.
+            ":",                                    // fn-resolve-uri-3: Evaluation of resolve-uri
function with an invalid URI value for first argument.
+            "###Rel",
+            "##",
+            "????###",
+            "###????"
+        };
+
+        for (int i = 0; i &lt; invalidURIs.length; i++)
+        {
+            try
+            {
+                XsTypeConverter.lexAnyURI(invalidURIs[i]);
+                System.out.println("URI should be invalid: " + invalidURIs[i] );
+                Assert.assertTrue("URI should be invalid: " + invalidURIs[i], false);
+                throw new IllegalStateException("URI should be invalid: " + invalidURIs[i]);
+            }
+            catch (InvalidLexicalValueException e)
+            {
+                Assert.assertTrue("URI should be invalid: " + invalidURIs[i] + "  " + e.getCause().getCause().getMessage(),
true);
+            }
+        }
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r792729 - in /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl: util/XsTypeConverter.java validator/Validator.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200907.mbox/%3c20090709221404.C635523888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090709221404-C635523888C5@eris-apache-org%3e</id>
<updated>2009-07-09T22:14:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Thu Jul  9 22:14:04 2009
New Revision: 792729

URL: http://svn.apache.org/viewvc?rev=792729&amp;view=rev
Log:
Incorporated anyURI stricter validation from revision 729009.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java?rev=792729&amp;r1=792728&amp;r2=792729&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java Thu Jul
 9 22:14:04 2009
@@ -761,11 +761,17 @@
         } */
 
         // Per XMLSchema spec allow spaces inside URIs
-        String s = lexical_value.toString().replace(" ", "%20");
+        StringBuffer s = new StringBuffer(lexical_value.toString());
+        int i = 0;
+        while ((i = s.indexOf(" ", i)) &gt;= 0)
+        {
+            s.replace(i, i + 1, "%20");
+            i += 3;
+        }
 
         try
         {
-            URI.create(s);
+            URI.create(s.toString());
         }
         catch (IllegalArgumentException e)
         {
@@ -774,67 +780,4 @@
 
         return lexical_value;
     }
-
-//    public static void main(String[] args)
-//    {
-//        lexAnyURI("http://www.ics.uci.edu/pub/ietf/uri/#Related");
-//        lexAnyURI("http://www.ics.uci.edu/pub/ietf/uri/?query=abc#Related");
-//        lexAnyURI("http://a/b/c/d;p?q");
-//        lexAnyURI("g:h");
-//        lexAnyURI("./g");
-//        lexAnyURI("g/");
-//        lexAnyURI("/g");
-//        lexAnyURI("//g");
-//        lexAnyURI("?y");
-//        lexAnyURI("g?y");
-//        lexAnyURI("#s");
-//        lexAnyURI("g#s");
-//        lexAnyURI("g?y#s");
-//        lexAnyURI(";x");
-//        lexAnyURI("g;x");
-//        lexAnyURI("g;x?y#s");
-//        lexAnyURI(".");
-//        lexAnyURI("./");
-//        lexAnyURI("..");
-//        lexAnyURI("../");
-//        lexAnyURI("../g");
-//        lexAnyURI("../..");
-//        lexAnyURI("../../");
-//        lexAnyURI("../../g");
-//
-//        lexAnyURI("http:// www   .ics.uci.edu   /pub/ietf/uri  /#Related");
-//        lexAnyURI("http:// www   .ics.uci.edu   /pub/iet%20%20f/uri  /#Related");
-//
-//
-//        // From XQTS cvshead June 2009
-//        String[] invalidURIs = {"http:\\\\invalid&gt;URI\\someURI",        // K2-SeqExprCast-207:
Construct an xs:anyURI from an invalid string. However, in F&amp;O 17.1.1, it is said that
"For xs:anyURI, the extent to which an implementation validates the lexical form of xs:anyURI
is implementation dependent.".
-//                                "http://www.example.com/file%GF.html",  // K2-SeqExprCast-210:
'%' is not a disallowed character and therefore it's not encoded before being considered for
RFC 2396 validness.
-//                                "foo://",                               // K2-SeqExprCast-421:
Pass an invalid anyURI.
-//                                "foo:",                                 // K2-SeqExprCast-421-2:
Pass an invalid anyURI.
-//                                "%gg",                                  // K2-SeqExprCast-422:
Pass an invalid anyURI(#2).
-//                                ":/cut.jpg",                            // K2-SeqExprCast-423:
no scheme
-//                                ":/images/cut.png",                     // K2-SeqExprCast-424:
An URI without scheme, combined with a relative directory.
-//                                ":/",                                   // K2-SeqExprCast-505:
':/' is an invalid URI, no scheme.
-//                                "http:%%",                              // fn-resolve-uri-4:
Evaluation of resolve-uri function with an invalid URI value for second argument.
-//                                ":",                                    // fn-resolve-uri-3:
Evaluation of resolve-uri function with an invalid URI value for first argument.
-//                                "###Rel",
-//                                "##",
-//                                "????###",
-//                                "###????"
-//                               };
-//
-//        for ( int i = 0; i &lt; invalidURIs.length ; i++ )
-//        {
-//            try
-//            {
-//                lexAnyURI(invalidURIs[i]);
-//                throw new IllegalStateException("URI should be invalid: " + invalidURIs[i]);
-//            }
-//            catch (InvalidLexicalValueException e)
-//            {
-//                System.out.println("URI invalid: " + invalidURIs[i] + "  " + e.getCause().getCause().getMessage());
-//                assert true;
-//            }
-//        }
-//    }
 }
\ No newline at end of file

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java?rev=792729&amp;r1=792728&amp;r2=792729&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java Thu Jul
 9 22:14:04 2009
@@ -20,6 +20,7 @@
 import org.apache.xmlbeans.impl.common.ValidationContext;
 import org.apache.xmlbeans.impl.common.ValidatorListener;
 import org.apache.xmlbeans.impl.common.XmlWhitespace;
+import org.apache.xmlbeans.impl.common.InvalidLexicalValueException;
 import org.apache.xmlbeans.impl.schema.SchemaTypeVisitorImpl;
 import org.apache.xmlbeans.impl.schema.SchemaTypeImpl;
 import org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem;
@@ -40,6 +41,7 @@
 import org.apache.xmlbeans.impl.values.XmlListImpl;
 import org.apache.xmlbeans.impl.values.XmlQNameImpl;
 import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
+import org.apache.xmlbeans.impl.util.XsTypeConverter;
 import org.apache.xmlbeans.GDate;
 import org.apache.xmlbeans.GDuration;
 import org.apache.xmlbeans.QNameSet;
@@ -1348,6 +1350,18 @@
         case SchemaType.BTC_ANY_URI :
         {
             JavaUriHolderEx.validateLexical( value, type, _vc );
+            // Do strict validation
+            if (_strict)
+            {
+                try
+                {
+                    XsTypeConverter.lexAnyURI( value );
+                }
+                catch (InvalidLexicalValueException ilve)
+                {
+                     _vc.invalid(XmlErrorCodes.ANYURI, new Object[] { value });
+                }
+            }
             _stringValue = value;
             break;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r792266 - in /xmlbeans/trunk/src: typeimpl/org/apache/xmlbeans/impl/validator/ typeimpl/org/apache/xmlbeans/impl/values/ xmlcomp/org/apache/xmlbeans/impl/tool/ xmlpublic/org/apache/xmlbeans/</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200907.mbox/%3c20090708190541.EFEA523888CE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090708190541-EFEA523888CE@eris-apache-org%3e</id>
<updated>2009-07-08T19:05:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Wed Jul  8 19:05:41 2009
New Revision: 792266

URL: http://svn.apache.org/viewvc?rev=792266&amp;view=rev
Log:
Added option to perform additional, stricter Schema validation checks. See JIRA issue XMLBEANS-350.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaDecimalHolderEx.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntHolderEx.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaLongHolderEx.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptions.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptionsBean.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java Wed Jul
 8 19:05:41 2009
@@ -22,6 +22,7 @@
 import org.apache.xmlbeans.impl.common.XmlWhitespace;
 import org.apache.xmlbeans.impl.schema.SchemaTypeVisitorImpl;
 import org.apache.xmlbeans.impl.schema.SchemaTypeImpl;
+import org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem;
 import org.apache.xmlbeans.impl.values.JavaBase64HolderEx;
 import org.apache.xmlbeans.impl.values.JavaBooleanHolder;
 import org.apache.xmlbeans.impl.values.JavaBooleanHolderEx;
@@ -81,6 +82,7 @@
         options = XmlOptions.maskNull(options);
         _errorListener = (Collection) options.get(XmlOptions.ERROR_LISTENER);
         _treatLaxAsSkip = options.hasOption(XmlOptions.VALIDATE_TREAT_LAX_AS_SKIP);
+        _strict = options.hasOption(XmlOptions.VALIDATE_STRICT);
 
         if (_errorListener == null)
             _errorListener = defaultErrorListener;
@@ -1286,6 +1288,16 @@
         {
             JavaDecimalHolderEx.validateLexical( value, type, _vc );
 
+            // An additional rule states that if the type is xs:integer or derived from it,
+            // then the decimal dot is not allowed.
+            // verify that values extending xsd:integer don't have a decimal point
+            if ( _strict &amp;&amp;
+                BuiltinSchemaTypeSystem.ST_INTEGER.isAssignableFrom( type ) &amp;&amp;
+                value.lastIndexOf('.') &gt;= 0)
+            {
+                _vc.invalid(XmlErrorCodes.INTEGER, new Object[] { value });
+            }
+
             if (errorState == _errorState)
             {
                 _decimalValue = new BigDecimal( value );
@@ -1339,6 +1351,14 @@
             _stringValue = value;
             break;
         }
+        case SchemaType.BTC_G_MONTH :
+        {
+            // In the case of gMonth, there is some strict mode validation to do
+            if (_strict &amp;&amp; value.length() == 6 &amp;&amp;
+                value.charAt( 4 ) == '-' &amp;&amp; value.charAt( 5 ) == '-')
+                _vc.invalid(XmlErrorCodes.DATE, new Object[] { value });
+            // Fall through
+        }
         case SchemaType.BTC_DATE_TIME :
         case SchemaType.BTC_TIME :
         case SchemaType.BTC_DATE :
@@ -1346,7 +1366,6 @@
         case SchemaType.BTC_G_YEAR :
         case SchemaType.BTC_G_MONTH_DAY :
         case SchemaType.BTC_G_DAY :
-        case SchemaType.BTC_G_MONTH :
         {
             GDate d = XmlDateImpl.validateLexical( value, type, _vc );
 
@@ -1732,6 +1751,7 @@
     private int                _errorState;
     private Collection         _errorListener;
     private boolean            _treatLaxAsSkip;
+    private boolean            _strict;
     private ValidatorVC        _vc;
     private int                _suspendErrors;
     private IdentityConstraint _constraintEngine;

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaDecimalHolderEx.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaDecimalHolderEx.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaDecimalHolderEx.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaDecimalHolderEx.java Wed
Jul  8 19:05:41 2009
@@ -87,7 +87,7 @@
         XmlObject fd = sType.getFacet(SchemaType.FACET_FRACTION_DIGITS);
         if (fd != null)
         {
-            int scale = ((XmlObjectBase)fd).bigIntegerValue().intValue();
+            int scale = ((XmlObjectBase)fd).getBigIntegerValue().intValue();
             try
             {
                 // used only for side-effect - this does not change v despite
@@ -110,7 +110,7 @@
         if (td != null)
         {
             String temp = v.unscaledValue().toString();
-            int tdf = ((XmlObjectBase)td).bigIntegerValue().intValue();
+            int tdf = ((XmlObjectBase)td).getBigIntegerValue().intValue();
             int origLen = temp.length();
             int len = origLen;
             if (origLen &gt; 0)
@@ -146,7 +146,7 @@
         XmlObject mine = sType.getFacet(SchemaType.FACET_MIN_EXCLUSIVE);
         if (mine != null)
         {
-            BigDecimal m = ((XmlObjectBase)mine).bigDecimalValue();
+            BigDecimal m = ((XmlObjectBase)mine).getBigDecimalValue();
             if (v.compareTo(m) &lt;= 0)
             {
                 context.invalid(XmlErrorCodes.DATATYPE_MIN_EXCLUSIVE_VALID,
@@ -159,7 +159,7 @@
         XmlObject mini = sType.getFacet(SchemaType.FACET_MIN_INCLUSIVE);
         if (mini != null)
         {
-            BigDecimal m = ((XmlObjectBase)mini).bigDecimalValue();
+            BigDecimal m = ((XmlObjectBase)mini).getBigDecimalValue();
             if (v.compareTo(m) &lt; 0)
             {
                 context.invalid(XmlErrorCodes.DATATYPE_MIN_INCLUSIVE_VALID,
@@ -172,7 +172,7 @@
         XmlObject maxi = sType.getFacet(SchemaType.FACET_MAX_INCLUSIVE);
         if (maxi != null)
         {
-            BigDecimal m = ((XmlObjectBase)maxi).bigDecimalValue();
+            BigDecimal m = ((XmlObjectBase)maxi).getBigDecimalValue();
             if (v.compareTo(m) &gt; 0)
             {
                 context.invalid(XmlErrorCodes.DATATYPE_MAX_INCLUSIVE_VALID,
@@ -185,7 +185,7 @@
         XmlObject maxe = sType.getFacet(SchemaType.FACET_MAX_EXCLUSIVE);
         if (maxe != null)
         {
-            BigDecimal m = ((XmlObjectBase)maxe).bigDecimalValue();
+            BigDecimal m = ((XmlObjectBase)maxe).getBigDecimalValue();
             if (v.compareTo(m) &gt;= 0)
             {
                 context.invalid(XmlErrorCodes.DATATYPE_MAX_EXCLUSIVE_VALID,
@@ -199,7 +199,7 @@
         if (vals != null)
         {
             for (int i = 0; i &lt; vals.length; i++)
-                if (v.equals(((XmlObjectBase)vals[i]).bigDecimalValue()))
+                if (v.equals(((XmlObjectBase)vals[i]).getBigDecimalValue()))
                     return;
             context.invalid(XmlErrorCodes.DATATYPE_ENUM_VALID,
                 new Object[] { "decimal", v, QNameHelper.readable(sType) });
@@ -209,7 +209,7 @@
     protected void validate_simpleval(String lexical, ValidationContext ctx)
     {
         validateLexical(lexical, schemaType(), ctx);
-        validateValue(bigDecimalValue(), schemaType(), ctx);
+        validateValue(getBigDecimalValue(), schemaType(), ctx);
     }
 
 }

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntHolderEx.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntHolderEx.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntHolderEx.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntHolderEx.java Wed Jul
 8 19:05:41 2009
@@ -60,7 +60,7 @@
     public static void validateLexical(String v, SchemaType sType, ValidationContext context)
     {
         JavaDecimalHolder.validateLexical(v, context);
-        
+
         // check pattern
         if (sType.hasPatternFacet())
         {
@@ -162,13 +162,13 @@
         switch (s.getDecimalSize()) 
         {
             case SchemaType.SIZE_BIG_DECIMAL:
-                return ((XmlObjectBase)o).bigDecimalValue().intValue();
+                return ((XmlObjectBase)o).getBigDecimalValue().intValue();
             case SchemaType.SIZE_BIG_INTEGER:
-                return ((XmlObjectBase)o).bigIntegerValue().intValue();
+                return ((XmlObjectBase)o).getBigIntegerValue().intValue();
             case SchemaType.SIZE_LONG:
-                return (int)((XmlObjectBase)o).longValue();
+                return (int)((XmlObjectBase)o).getLongValue();
             default:
-                return ((XmlObjectBase)o).intValue();
+                return ((XmlObjectBase)o).getIntValue();
         }
 
     }
@@ -176,7 +176,7 @@
     protected void validate_simpleval(String lexical, ValidationContext ctx)
     {
         validateLexical(lexical, schemaType(), ctx);
-        validateValue(intValue(), schemaType(), ctx);
+        validateValue(getIntValue(), schemaType(), ctx);
     }
     
 }

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java Wed
Jul  8 19:05:41 2009
@@ -59,7 +59,7 @@
     public static void validateLexical(String v, SchemaType sType, ValidationContext context)
     {
         JavaDecimalHolder.validateLexical(v, context);
-        
+
         // check pattern
         if (sType.hasPatternFacet())
         {
@@ -172,7 +172,7 @@
     protected void validate_simpleval(String lexical, ValidationContext ctx)
     {
         validateLexical(lexical, schemaType(), ctx);
-        validateValue(bigIntegerValue(), schemaType(), ctx);
+        validateValue(getBigIntegerValue(), schemaType(), ctx);
     }
     
 }

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaLongHolderEx.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaLongHolderEx.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaLongHolderEx.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaLongHolderEx.java Wed
Jul  8 19:05:41 2009
@@ -60,7 +60,7 @@
     public static void validateLexical(String v, SchemaType sType, ValidationContext context)
     {
         JavaDecimalHolder.validateLexical(v, context);
-        
+
         // check pattern
         if (sType.hasPatternFacet())
         {
@@ -162,11 +162,11 @@
         switch (s.getDecimalSize()) 
         {
             case SchemaType.SIZE_BIG_DECIMAL:
-                return ((XmlObjectBase)o).bigDecimalValue().longValue();
+                return ((XmlObjectBase)o).getBigDecimalValue().longValue();
             case SchemaType.SIZE_BIG_INTEGER:
-                return ((XmlObjectBase)o).bigIntegerValue().longValue();
+                return ((XmlObjectBase)o).getBigIntegerValue().longValue();
             case SchemaType.SIZE_LONG:
-                return ((XmlObjectBase)o).longValue();
+                return ((XmlObjectBase)o).getLongValue();
             default:
                 throw new IllegalStateException("Bad facet type: " + s);
         }
@@ -176,6 +176,6 @@
     protected void validate_simpleval(String lexical, ValidationContext ctx)
     {
         validateLexical(lexical, schemaType(), ctx);
-        validateValue(longValue(), schemaType(), ctx);
+        validateValue(getLongValue(), schemaType(), ctx);
     }
 }

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java Wed Jul
 8 19:05:41 2009
@@ -41,6 +41,7 @@
         System.out.println("    -dl - permit network downloads for imports and includes (default
is off)");
         System.out.println("    -noupa - do not enforce the unique particle attribution rule");
         System.out.println("    -nopvr - do not enforce the particle valid (restriction)
rule");
+        System.out.println("    -strict - performs strict(er) validation");
         System.out.println("    -partial - allow partial schema type system");
         System.out.println("    -license - prints license information");
     }
@@ -56,6 +57,7 @@
         flags.add("dl");
         flags.add("noupa");
         flags.add("nopvr");
+        flags.add("strict");
         flags.add("partial");
 
         CommandLine cl = new CommandLine(args, flags, Collections.EMPTY_SET);
@@ -99,6 +101,7 @@
         boolean dl = (cl.getOpt("dl") != null);
         boolean nopvr = (cl.getOpt("nopvr") != null);
         boolean noupa = (cl.getOpt("noupa") != null);
+        boolean strict = (cl.getOpt("strict") != null);
         boolean partial = (cl.getOpt("partial") != null);
 
         File[] schemaFiles = cl.filesEndingWith(".xsd");
@@ -191,7 +194,9 @@
                 System.out.println(instanceFiles[i] + " NOT valid.  ");
                 System.out.println("  Document type not found." );
             }
-            else if (xobj.validate(new XmlOptions().setErrorListener(errors)))
+            else if (xobj.validate(strict ?
+                new XmlOptions().setErrorListener(errors).setValidateStrict() :
+                new XmlOptions().setErrorListener(errors)))
                 System.out.println(instanceFiles[i] + " valid.");
             else
             {

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptions.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptions.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptions.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptions.java Wed Jul  8 19:05:41 2009
@@ -70,7 +70,8 @@
  *   &lt;td align="center"&gt;&lt;code&gt;setLoad***&lt;/code&gt;&lt;br/&gt;
  *                      &lt;code&gt;setEntityResolver&lt;/code&gt;&lt;/td&gt;
  *   &lt;td align="center"&gt;&lt;code&gt;setErrorListener&lt;/code&gt;&lt;br/&gt;
- *                      &lt;code&gt;setValidateTreatLaxAsSkip&lt;/code&gt;&lt;/td&gt;
+ *                      &lt;code&gt;setValidateTreatLaxAsSkip&lt;/code&gt;
+ *                      &lt;code&gt;setValidateStrict&lt;/code&gt;&lt;/td&gt;
  *   &lt;td align="center"&gt;&lt;code&gt;setErrorListener&lt;/code&gt;&lt;br/&gt;
  *                      &lt;code&gt;setCompile***&lt;/code&gt;&lt;br/&gt;
  *                      &lt;code&gt;setEntityResolver&lt;/code&gt;&lt;br/&gt;
@@ -773,6 +774,14 @@
     }
 
     /**
+     * Performs additional validation checks that are disabled by
+     * default for better compatibility.
+     */
+    public XmlOptions setValidateStrict() {
+        return set ( VALIDATE_STRICT );
+    }
+
+    /**
      * This option controls whether or not operations on XmlBeans are
      * thread safe.  When not on, all XmlBean operations will be syncronized.
      * This provides for multiple thread the ability to access a single
@@ -944,6 +953,8 @@
     /** @exclude */
     public static final String VALIDATE_TREAT_LAX_AS_SKIP      = "VALIDATE_TREAT_LAX_AS_SKIP";
     /** @exclude */
+    public static final String VALIDATE_STRICT                 = "VALIDATE_STRICT";
+    /** @exclude */
     public static final String VALIDATE_TEXT_ONLY              = "VALIDATE_TEXT_ONLY";
     /** @exclude */
     public static final String UNSYNCHRONIZED                  = "UNSYNCHRONIZED";

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptionsBean.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptionsBean.java?rev=792266&amp;r1=792265&amp;r2=792266&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptionsBean.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptionsBean.java Wed Jul  8 19:05:41
2009
@@ -407,6 +407,19 @@
         return hasOption( VALIDATE_TREAT_LAX_AS_SKIP );
     }
 
+    public void setValidateStrict(boolean b)
+    {
+        if (b)
+            super.setValidateStrict();
+        else
+            remove( VALIDATE_STRICT );
+    }
+
+    public boolean isValidateStrict()
+    {
+        return hasOption( VALIDATE_STRICT );
+    }
+
     public void setUnsynchronized(boolean b)
     {
         if (b)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r792009 - in /xmlbeans/trunk: build.xml src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java src/xmlpublic/org/apache/xmlbeans/GDate.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200907.mbox/%3c20090708010345.BC59D23888D7@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090708010345-BC59D23888D7@eris-apache-org%3e</id>
<updated>2009-07-08T01:03:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Wed Jul  8 01:03:45 2009
New Revision: 792009

URL: http://svn.apache.org/viewvc?rev=792009&amp;view=rev
Log:
- Updated dist-src jar file name to sources instead of source.
- Uncomment year check in GDate parsing.
- Added lexical validation of URI in XsTypeConverter, to be used externaly if necesary.


Modified:
    xmlbeans/trunk/build.xml
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java

Modified: xmlbeans/trunk/build.xml
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/build.xml?rev=792009&amp;r1=792008&amp;r2=792009&amp;view=diff
==============================================================================
--- xmlbeans/trunk/build.xml (original)
+++ xmlbeans/trunk/build.xml Wed Jul  8 01:03:45 2009
@@ -425,7 +425,7 @@
                 &lt;exclude name="bin/*.cmd"/&gt;
             &lt;/tarfileset&gt;
         &lt;/tar&gt;
-        &lt;jar jarfile="build/private/xmlbeans-${version.base}-source.jar" index="false"&gt;
+        &lt;jar jarfile="build/private/xmlbeans-${version.base}-sources.jar" index="false"&gt;
 	    &lt;fileset dir="src/common" includes="**/*.java"/&gt;
 	    &lt;fileset dir="src/configschema" includes="**/*.java"/&gt;
 	    &lt;fileset dir="src/jamsupport" includes="**/*.java"/&gt;

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java?rev=792009&amp;r1=792008&amp;r2=792009&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/util/XsTypeConverter.java Wed Jul
 8 01:03:45 2009
@@ -30,6 +30,7 @@
 import java.util.Calendar;
 import java.util.Collection;
 import java.util.Date;
+import java.net.URI;
 
 public final class XsTypeConverter
 {
@@ -729,4 +730,111 @@
         return sign * result;
     }
 
-}
+    // ======================== anyURI ========================
+    public static CharSequence printAnyURI(CharSequence val)
+    {
+        return val;
+    }
+
+    /**
+     * Checkes the regular expression of URI, defined by RFC2369 http://www.ietf.org/rfc/rfc2396.txt
Appendix B.
+     * Note: The whitespace normalization rule collapse must be applied priot to calling
this method.
+     * @param lexical_value the lexical value
+     * @return same input value if input value is in the lexical space
+     * @throws InvalidLexicalValueException
+     */
+    public static CharSequence lexAnyURI(CharSequence lexical_value)
+    {
+        /*  // Reg exp from RFC2396, but it's too forgiving for XQTS
+        Pattern p = Pattern.compile("^([^:/?#]+:)?(//[^/?#]*)?([^?#]*)(\\?[^#]*)?(#.*)?");
+        Matcher m = p.matcher(lexical_value);
+        if ( !m.matches() )
+            throw new InvalidLexicalValueException("invalid anyURI value");
+        else
+        {
+            for ( int i = 0; i&lt;= m.groupCount(); i++ )
+            {
+                System.out.print("  " + i + ": " + m.group(i));
+            }
+            System.out.println("");
+            return lexical_value;
+        } */
+
+        // Per XMLSchema spec allow spaces inside URIs
+        String s = lexical_value.toString().replace(" ", "%20");
+
+        try
+        {
+            URI.create(s);
+        }
+        catch (IllegalArgumentException e)
+        {
+            throw new InvalidLexicalValueException("invalid anyURI value: " + lexical_value,
e);
+        }
+
+        return lexical_value;
+    }
+
+//    public static void main(String[] args)
+//    {
+//        lexAnyURI("http://www.ics.uci.edu/pub/ietf/uri/#Related");
+//        lexAnyURI("http://www.ics.uci.edu/pub/ietf/uri/?query=abc#Related");
+//        lexAnyURI("http://a/b/c/d;p?q");
+//        lexAnyURI("g:h");
+//        lexAnyURI("./g");
+//        lexAnyURI("g/");
+//        lexAnyURI("/g");
+//        lexAnyURI("//g");
+//        lexAnyURI("?y");
+//        lexAnyURI("g?y");
+//        lexAnyURI("#s");
+//        lexAnyURI("g#s");
+//        lexAnyURI("g?y#s");
+//        lexAnyURI(";x");
+//        lexAnyURI("g;x");
+//        lexAnyURI("g;x?y#s");
+//        lexAnyURI(".");
+//        lexAnyURI("./");
+//        lexAnyURI("..");
+//        lexAnyURI("../");
+//        lexAnyURI("../g");
+//        lexAnyURI("../..");
+//        lexAnyURI("../../");
+//        lexAnyURI("../../g");
+//
+//        lexAnyURI("http:// www   .ics.uci.edu   /pub/ietf/uri  /#Related");
+//        lexAnyURI("http:// www   .ics.uci.edu   /pub/iet%20%20f/uri  /#Related");
+//
+//
+//        // From XQTS cvshead June 2009
+//        String[] invalidURIs = {"http:\\\\invalid&gt;URI\\someURI",        // K2-SeqExprCast-207:
Construct an xs:anyURI from an invalid string. However, in F&amp;O 17.1.1, it is said that
"For xs:anyURI, the extent to which an implementation validates the lexical form of xs:anyURI
is implementation dependent.".
+//                                "http://www.example.com/file%GF.html",  // K2-SeqExprCast-210:
'%' is not a disallowed character and therefore it's not encoded before being considered for
RFC 2396 validness.
+//                                "foo://",                               // K2-SeqExprCast-421:
Pass an invalid anyURI.
+//                                "foo:",                                 // K2-SeqExprCast-421-2:
Pass an invalid anyURI.
+//                                "%gg",                                  // K2-SeqExprCast-422:
Pass an invalid anyURI(#2).
+//                                ":/cut.jpg",                            // K2-SeqExprCast-423:
no scheme
+//                                ":/images/cut.png",                     // K2-SeqExprCast-424:
An URI without scheme, combined with a relative directory.
+//                                ":/",                                   // K2-SeqExprCast-505:
':/' is an invalid URI, no scheme.
+//                                "http:%%",                              // fn-resolve-uri-4:
Evaluation of resolve-uri function with an invalid URI value for second argument.
+//                                ":",                                    // fn-resolve-uri-3:
Evaluation of resolve-uri function with an invalid URI value for first argument.
+//                                "###Rel",
+//                                "##",
+//                                "????###",
+//                                "###????"
+//                               };
+//
+//        for ( int i = 0; i &lt; invalidURIs.length ; i++ )
+//        {
+//            try
+//            {
+//                lexAnyURI(invalidURIs[i]);
+//                throw new IllegalStateException("URI should be invalid: " + invalidURIs[i]);
+//            }
+//            catch (InvalidLexicalValueException e)
+//            {
+//                System.out.println("URI invalid: " + invalidURIs[i] + "  " + e.getCause().getCause().getMessage());
+//                assert true;
+//            }
+//        }
+//    }
+}
\ No newline at end of file

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java?rev=792009&amp;r1=792008&amp;r2=792009&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java Wed Jul  8 01:03:45 2009
@@ -159,12 +159,12 @@
             else if (digits &gt; 0)
                 throw new IllegalArgumentException("year must be four digits (may pad with
zeroes, e.g., 0560)");
 
-            /*if ( _CY &gt; MAX_YEAR )
-                throw new IllegalArgumentException("year must be less than " + MAX_YEAR);
+            if ( _CY &gt; MAX_YEAR )
+                throw new IllegalArgumentException("year value not supported: too big, must
be less than " + MAX_YEAR);
 
             if ( _CY &lt; MIN_YEAR )
-                throw new IllegalArgumentException("year must be bigger than " + MIN_YEAR);
-            */
+                throw new IllegalArgumentException("year values not supported: too small,
must be bigger than " + MIN_YEAR);
+
             // hyphen introduces a month
             if (ch != '-')
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r789921 - /xmlbeans/trunk/build.xml</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200906.mbox/%3c20090630201403.EF52A238888C@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090630201403-EF52A238888C@eris-apache-org%3e</id>
<updated>2009-06-30T20:14:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Tue Jun 30 20:14:03 2009
New Revision: 789921

URL: http://svn.apache.org/viewvc?rev=789921&amp;view=rev
Log:
Include source jar creation in build script for maven repository.


Modified:
    xmlbeans/trunk/build.xml

Modified: xmlbeans/trunk/build.xml
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/build.xml?rev=789921&amp;r1=789920&amp;r2=789921&amp;view=diff
==============================================================================
--- xmlbeans/trunk/build.xml (original)
+++ xmlbeans/trunk/build.xml Tue Jun 30 20:14:03 2009
@@ -395,9 +395,10 @@
         &lt;/tar&gt;
     &lt;/target&gt;
 
-    &lt;target name="dist-src" depends="clean, dirs"&gt;
+    &lt;target name="dist-src" depends="clean, dirs, version"&gt;
         &lt;delete file="build/private/xmlbeans-${version.base}-src.zip"/&gt;
         &lt;delete file="build/private/xmlbeans-${version.base}-src.tgz"/&gt;
+        &lt;delete file="build/private/xmlbeans-${version.base}-source.jar"/&gt;
 
         &lt;zip destfile="build/private/xmlbeans-${version.base}-src.zip"&gt;
             &lt;zipfileset dir="." prefix="xmlbeans-${version.base}"&gt;
@@ -424,6 +425,39 @@
                 &lt;exclude name="bin/*.cmd"/&gt;
             &lt;/tarfileset&gt;
         &lt;/tar&gt;
+        &lt;jar jarfile="build/private/xmlbeans-${version.base}-source.jar" index="false"&gt;
+	    &lt;fileset dir="src/common" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/configschema" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/jamsupport" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/marshal" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/repackage" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/saaj_api" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/store" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/tools" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/toolschema" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/typeholder" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/typeimpl" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/typestore" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xmlcomp" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xmlconfig" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xmlinputstream" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xmlpublic" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xmlschema" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xpath" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xpath_xquery" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/xsdschema" includes="**/*.java"/&gt;
+	    &lt;fileset dir="src/zipcompare" includes="**/*.java"/&gt;
+	    &lt;fileset dir="maven-plugin/src/java" includes="**/*.java"/&gt;
+            &lt;manifest&gt;
+                &lt;section name="${manifest.name}"&gt;
+                    &lt;attribute name="Comment" value="${manifest.comment}"/&gt;
+                    &lt;attribute name="Implementation-Title" value="${manifest.title}"/&gt;
+                    &lt;attribute name="Implementation-Version" value="${version.full}"/&gt;
+                    &lt;attribute name="Implementation-Vendor" value="${manifest.vendor}"/&gt;
+                    &lt;attribute name="Implementation-URL" value="${manifest.url}"/&gt;
+                &lt;/section&gt;
+            &lt;/manifest&gt;	    
+        &lt;/jar&gt;
     &lt;/target&gt;
 
     &lt;target name="enum-support.jar"



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r784826 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200906.mbox/%3c20090615154618.7DAF423888CF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090615154618-7DAF423888CF@eris-apache-org%3e</id>
<updated>2009-06-15T15:46:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Mon Jun 15 15:46:18 2009
New Revision: 784826

URL: http://svn.apache.org/viewvc?rev=784826&amp;view=rev
Log:
Fixed pattern for dayTimeDuration

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java?rev=784826&amp;r1=784825&amp;r2=784826&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
Mon Jun 15 15:46:18 2009
@@ -1070,7 +1070,7 @@
                 hasPattern = true;
                 break;
             case BTC_DAY_TIME_DURATION:
-                pattern = "[^YM]*(DT.*)?";
+                pattern = "[^YM]*[DT].*";
                 hasPattern = true;
                 break;
             case BTC_YEAR_MONTH_DURATION:



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r783519 - in /xmlbeans/trunk: src/xmlpublic/org/apache/xmlbeans/GDate.java src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java test/src/xmlobject/schematypes/checkin/GDateTests.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200906.mbox/%3c20090610210525.0376323888D4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090610210525-0376323888D4@eris-apache-org%3e</id>
<updated>2009-06-10T21:05:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Wed Jun 10 21:05:24 2009
New Revision: 783519

URL: http://svn.apache.org/viewvc?rev=783519&amp;view=rev
Log:
Fix normalization of dates with hour 24.
Extended the year limitations or dates.
Added date tests


Modified:
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java
    xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java?rev=783519&amp;r1=783518&amp;r2=783519&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java Wed Jun 10 21:05:24 2009
@@ -40,7 +40,12 @@
 public final class GDate implements GDateSpecification, java.io.Serializable
 {
     private static final long serialVersionUID = 1L;
-    
+
+    // XMLSchema spec requires support only for years 1 to 9999, but XMLBeans covers more
up to the following limitations
+    // to avoid losing precision when transforming to a java.util.Date
+    static final int MAX_YEAR =  292277265;  // is Long.MAX_VALUE ms in years - 1 (for the
11month, 31days, 23h, 59m, 59sec case).
+    static final int MIN_YEAR = -292275295; // is Long.MIN_VALUE ms in years + 1970 + 1
+
     // for fast equality comparison, hashing, and serialization
     private transient String _canonicalString;
     private transient String _string;
@@ -143,8 +148,8 @@
                 start += 1;
             }
             digits += start;
-            if (digits &gt; 6)
-                throw new IllegalArgumentException("year too long (up to 6 digits)");
+            if (digits &gt; 9)
+                throw new IllegalArgumentException("year too long (up to 9 digits)");
             else if (digits &gt;= 4)
             {
                 _bits |= HAS_YEAR;
@@ -154,6 +159,12 @@
             else if (digits &gt; 0)
                 throw new IllegalArgumentException("year must be four digits (may pad with
zeroes, e.g., 0560)");
 
+            /*if ( _CY &gt; MAX_YEAR )
+                throw new IllegalArgumentException("year must be less than " + MAX_YEAR);
+
+            if ( _CY &lt; MIN_YEAR )
+                throw new IllegalArgumentException("year must be bigger than " + MIN_YEAR);
+            */
             // hyphen introduces a month
             if (ch != '-')
             {
@@ -279,8 +290,7 @@
                 if ( hasDate() )
                 {
                     GDateBuilder gdb = new GDateBuilder(_CY, _M, _D, _h, _m, _s, _fs, _tzsign,
_tzh, _tzm);
-                    gdb.normalize();
-                    gdb.normalizeToTimeZone(_tzsign, _tzh, _tzm);
+                    gdb.normalize24h();                    
 
                     _D = gdb.getDay();
                     _M = gdb.getMonth();

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java?rev=783519&amp;r1=783518&amp;r2=783519&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java Wed Jun 10 21:05:24
2009
@@ -374,13 +374,15 @@
     public final int getTimeZoneMinute()
         { return _tzm; }
 
+    
+
     /**
      * Sets the year. Should be a four-digit year specification.
      * @param year the year
      */
     public void setYear(int year)
     {
-        if (year &lt; -4713 || year &gt; 999999)
+        if (year &lt; GDate.MIN_YEAR || year &gt; GDate.MAX_YEAR)
             throw new IllegalArgumentException("year out of range");
         if (year == 0)
             throw new IllegalArgumentException("year cannot be 0");
@@ -602,37 +604,14 @@
         // DateTime or Time, with TimeZone: normalize to UTC.
         // In the process all the fields will be normalized.
         if (hasDay() == hasMonth() &amp;&amp; hasDay() == hasYear() &amp;&amp;
-            hasTimeZone() &amp;&amp; hasTime() &amp;&amp; getHour()!=24 )
+            hasTimeZone() &amp;&amp; hasTime() )
         {
             normalizeToTimeZone(0, 0, 0);
         }
         else
         {
             // No timezone, or incomplete date.
-            long carry = 0;
-
-            if (hasTime())
-                carry = _normalizeTime();
-
-            if (hasDay())
-                _D += carry;
-
-            if (hasDate())
-            {
-                _normalizeDate();
-            }
-            else if (hasMonth())
-            {
-                // with incomplete dates, just months can be normalized:
-                // days stay denormalized.
-                if (_M &lt; 1 || _M &gt; 12)
-                {
-                    int temp = _M;
-                    _M = _modulo(temp, 1, 13);
-                    if (hasYear())
-                        _CY = _CY + (int)_fQuotient(temp, 1, 13);
-                }
-            }
+            _normalizeTimeAndDate();
         }
 
         // remove trailing zeros from fractional seconds
@@ -654,6 +633,46 @@
         }
     }
 
+   /**
+     * Normalizes the instance when hour is 24. If day is present, hour 24 is equivalent
to hour 00 next day.
+     */
+    void normalize24h()
+    {
+        if ( !hasTime() || getHour()!=24 )
+            return;
+
+        _normalizeTimeAndDate();
+    }
+
+
+    private void _normalizeTimeAndDate()
+    {
+        long carry = 0;
+
+        if (hasTime())
+            carry = _normalizeTime();
+
+        if (hasDay())
+            _D += carry;
+
+        if (hasDate())
+        {
+            _normalizeDate();
+        }
+        else if (hasMonth())
+        {
+            // with incomplete dates, just months can be normalized:
+            // days stay denormalized.
+            if (_M &lt; 1 || _M &gt; 12)
+            {
+                int temp = _M;
+                _M = _modulo(temp, 1, 13);
+                if (hasYear())
+                    _CY = _CY + (int)_fQuotient(temp, 1, 13);
+            }
+        }
+    }
+
     /**
      * If the time and timezone are known, this method changes the timezone to the
      * specified UTC offset, altering minutes, hours, day, month, and year as

Modified: xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java?rev=783519&amp;r1=783518&amp;r2=783519&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java (original)
+++ xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java Wed Jun 10 21:05:24
2009
@@ -29,6 +29,7 @@
 import java.util.GregorianCalendar;
 import java.util.Date;
 import java.util.Calendar;
+import java.math.BigDecimal;
 
 public class GDateTests extends TestCase
 {
@@ -134,8 +135,8 @@
                 "00:00", // time incomplete
                 "00", // incomplete
                 "2100-02-29", // not leap
-                "-9999999-02-28T00:00:00Z", // too long ago
-                "9999999-02-28T00:00:00Z", // too long from now
+                "-999999999-02-28T00:00:00Z", // too long ago
+                "999999999-02-28T00:00:00Z", // too long from now
                 "9999999999999999999999999999999-02-28T00:00:00Z", // overflow?
                 "0000-01-01", // year zero
                 "0000-12-31T04:35:22.456", // year zero
@@ -635,4 +636,89 @@
             }
         }
     }
+
+    public void test24hDates()
+    {
+        GDate d1 = new GDate("2004-03-31T24:00:00");
+        Assert.assertEquals("2004-04-01T00:00:00", d1.toString());
+
+
+        GDateBuilder b = new GDateBuilder();
+        b.setTime(24, 0, 0, new BigDecimal("0.00"));
+        System.out.println("hour 24: " + b.getCalendar());
+        Assert.assertEquals("24:00:00.000", b.getCalendar().toString());
+
+        b.setDay(10);
+        b.setMonth(1);
+        System.out.println("hour 24: " + b.getCalendar());
+        Assert.assertEquals("--01-10T24:00:00.000", b.getCalendar().toString());
+
+        b.setYear(2010);
+        System.out.println("hour 24: " + b.getCalendar());
+        Assert.assertEquals("2010-01-10T24:00:00.000", b.getCalendar().toString());
+
+        b.setDay(31);
+        b.setMonth(03);
+        b.setYear(2004);
+
+        System.out.println("hour 24: canonical str: " + b.canonicalString());
+        Assert.assertEquals("2004-04-01T00:00:00", b.canonicalString());
+        System.out.println("hour 24: toString: " + b.toString());
+        Assert.assertEquals("2004-03-31T24:00:00.00", b.toString());
+        System.out.println("hour 24: toGDate: " + b.toGDate());
+        Assert.assertEquals("2004-03-31T24:00:00.00", b.toGDate().toString());
+        System.out.println("hour 24: toGDate().canonicalStr: " + b.toGDate().canonicalString());
+        Assert.assertEquals("2004-04-01T00:00:00", b.toGDate().canonicalString());
+        System.out.println("hour 24: toGDate().getCal: " + b.toGDate().getCalendar());
+        Assert.assertEquals("2004-03-31T24:00:00.000", b.toGDate().getCalendar().toString());
+
+
+        GDateBuilder gdb = new GDateBuilder("24:00:00+01:00");
+        System.out.println("gdb: " + gdb);
+        Assert.assertEquals("24:00:00+01:00", gdb.toString());
+
+        gdb.normalize();
+        System.out.println("gdb.normalize(): " + gdb);
+        Assert.assertEquals("23:00:00Z", gdb.toString());
+    }
+
+    public void testYearStartingWith0()
+    {
+        GDate gdate = new GDate("0004-08-01");    //      00004-08-01 must fail
+        System.out.println("year starting with 0: " + gdate.getCalendar());
+        Assert.assertEquals("0004-08-01", gdate.toString());
+
+        String txt = "-9999-06";
+        GDate d = new GDate(txt);
+        System.out.println(" gdate(" + txt + ") = " + d);
+        Assert.assertEquals("-9999-06", d.toString());
+
+        txt = "-12345-06";
+        d = new GDate(txt);
+        System.out.println(" gdate(" + txt + ") = " + d);
+        Assert.assertEquals(txt, d.toString());
+
+
+        try
+        {
+            txt = "00004-08-01";
+            d = new GDate(txt);    //      00004-08-01 must fail
+            Assert.assertTrue("Year starting with 0 of five digits: " + txt, false);
+        }
+        catch(IllegalArgumentException e)
+        {
+            Assert.assertTrue("Year starting with 0 of five digits: " + txt, true);
+        }
+
+        try
+        {
+            txt = "-012340-08-01";
+            d = new GDate(txt);
+            Assert.assertTrue("Year starting with 0 of six digits: " + txt, false);
+        }
+        catch(IllegalArgumentException e)
+        {
+            Assert.assertTrue("Year starting with 0 of six digits: " + txt, true);
+        }
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r781862 - in /xmlbeans/trunk/src: typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java xmlpublic/org/apache/xmlbeans/GDate.java xmlpublic/org/apache/xmlbeans/GDateBuilder.java xmlpublic/org/apache/xmlbeans/GDuration.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200906.mbox/%3c20090604223720.9193B23888D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090604223720-9193B23888D0@eris-apache-org%3e</id>
<updated>2009-06-04T22:37:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Jun  4 22:37:19 2009
New Revision: 781862

URL: http://svn.apache.org/viewvc?rev=781862&amp;view=rev
Log:
Various fixes:
 - more validation checks for dates with year starting with 0.
 - for durations without containing any fields
 - for normalization of dateTime with hour 24.
 - for including prefix when validating QNames.
 

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDuration.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java?rev=781862&amp;r1=781861&amp;r2=781862&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java Thu Jun
 4 22:37:19 2009
@@ -142,7 +142,10 @@
             uri = "";
         }
 
-        return new QName( uri, localname );
+        if ( prefix!=null &amp;&amp; prefix.length()&gt;0 )
+            return new QName(uri, localname, prefix );
+        else
+            return new QName( uri, localname );
     }
     
     protected void set_text(String s)

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java?rev=781862&amp;r1=781861&amp;r2=781862&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java Thu Jun  4 22:37:19 2009
@@ -128,11 +128,17 @@
             int value = 0;
             int digits = -start;
             char ch;
+            boolean startsWithZero = start &lt; len &amp;&amp; digitVal(string.charAt(start))==0;
+
             for (;;)
             {
                 ch = start &lt; len ? string.charAt(start) : '\0';
                 if (!isDigit(ch))
                     break;
+                
+                if ( startsWithZero &amp;&amp; start+digits&gt;=4 )
+                    throw new IllegalArgumentException("year value starting with zero must
be 4 or less digits: " + string);
+
                 value = value * 10 + digitVal(ch);
                 start += 1;
             }

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java?rev=781862&amp;r1=781861&amp;r2=781862&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java Thu Jun  4 22:37:19
2009
@@ -602,7 +602,7 @@
         // DateTime or Time, with TimeZone: normalize to UTC.
         // In the process all the fields will be normalized.
         if (hasDay() == hasMonth() &amp;&amp; hasDay() == hasYear() &amp;&amp;
-            hasTimeZone() &amp;&amp; hasTime())
+            hasTimeZone() &amp;&amp; hasTime() &amp;&amp; getHour()!=24 )
         {
             normalizeToTimeZone(0, 0, 0);
         }

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDuration.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDuration.java?rev=781862&amp;r1=781861&amp;r2=781862&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDuration.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDuration.java Thu Jun  4 22:37:19 2009
@@ -196,6 +196,9 @@
                     throw new IllegalArgumentException("duration must specify Y M D T H M
S in order");
             }
         }
+
+        if ( seen == SEEN_NOTHING )
+            throw new IllegalArgumentException("duration must contain at least one number
and its designator: " + str);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r781550 - in /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema: StscChecker.java StscSimpleTypeResolver.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200906.mbox/%3c20090603210720.9F70B2388898@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090603210720-9F70B2388898@eris-apache-org%3e</id>
<updated>2009-06-03T21:07:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Wed Jun  3 21:07:20 2009
New Revision: 781550

URL: http://svn.apache.org/viewvc?rev=781550&amp;view=rev
Log:
Another tweak to NOTATION-related checks

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java?rev=781550&amp;r1=781549&amp;r2=781550&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java Wed Jun 
3 21:07:20 2009
@@ -120,6 +120,15 @@
                     }
                     else
                     {
+                        if (sAttrs[i].getType().getSimpleVariety() == SchemaType.UNION)
+                        {
+                            SchemaType[] members = sAttrs[i].getType().getUnionConstituentTypes();
+                            for (int j = 0; j &lt; members.length; j++)
+                                if (members[j].getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                                    StscState.get().recover(XmlErrorCodes.ATTR_NOTATION_TYPE_FORBIDDEN,
+                                        new Object[]{ QNameHelper.pretty(sAttrs[i].getName())
},
+                                        attrLocation != null ? attrLocation : location);
+                        }
                         // Check that the Schema in which this is present doesn't have a
targetNS
                         boolean hasNS;
                         if (sType.isAttributeType())
@@ -305,7 +314,19 @@
                             ((SchemaLocalElementImpl) model)._parseObject.selectAttribute("",
"type"));
                     }
                     else
+                    {
+                        if (model.getType().getSimpleVariety() == SchemaType.UNION)
+                        {
+                            SchemaType[] members = model.getType().getUnionConstituentTypes();
+                            for (int i = 0; i &lt; members.length; i++)
+                                if (members[i].getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                                    StscState.get().recover(XmlErrorCodes.ELEM_NOTATION_TYPE_FORBIDDEN,
+                                        new Object[]{ QNameHelper.pretty(model.getName())
},
+                                        ((SchemaLocalElementImpl) model)._parseObject ==
null ? location :
+                                        ((SchemaLocalElementImpl) model)._parseObject.selectAttribute("",
"type"));
+                        }
                         warningType = BuiltinSchemaTypeSystem.ST_NOTATION.getName().getLocalPart();
+                    }
 
                     // Check that the Schema in which this is present doesn't have a targetNS
                     boolean hasNS;

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java?rev=781550&amp;r1=781549&amp;r2=781550&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
Wed Jun  3 21:07:20 2009
@@ -380,10 +380,6 @@
             SchemaTypeImpl mImpl = (SchemaTypeImpl)memberImplList.get(i);
             if (mImpl.finalUnion())
                 state.error(XmlErrorCodes.SIMPLE_TYPE_PROPERTIES$UNION_FINAL, null, parseUnion);
-
-            // Check that the member type is not a plan NOTATION
-            if (mImpl.getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
-                state.recover(XmlErrorCodes.DATATYPE_ENUM_NOTATION, null, parseUnion);
         }
 
         sImpl.setUnionOfLists(isUnionOfLists);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r781219 - in /xmlbeans/trunk: src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java test/src/xmlobject/schematypes/checkin/GDateTests.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200906.mbox/%3c20090603001304.E18B523888D7@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090603001304-E18B523888D7@eris-apache-org%3e</id>
<updated>2009-06-03T00:13:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Wed Jun  3 00:13:04 2009
New Revision: 781219

URL: http://svn.apache.org/viewvc?rev=781219&amp;view=rev
Log:
Checkintest fix and additional NOTATION checks

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
    xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java?rev=781219&amp;r1=781218&amp;r2=781219&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
Wed Jun  3 00:13:04 2009
@@ -242,6 +242,9 @@
                 // fallthrough: nonlist unions are just like atomic items
             case SchemaType.ATOMIC:
                 sImpl.setListItemTypeRef(itemImpl.getRef());
+                // Check that the item type is not a plan NOTATION
+                if (sImpl.getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                    state.recover(XmlErrorCodes.DATATYPE_ENUM_NOTATION, null, errorLoc);
                 break;
             default:
                 assert(false);
@@ -377,6 +380,10 @@
             SchemaTypeImpl mImpl = (SchemaTypeImpl)memberImplList.get(i);
             if (mImpl.finalUnion())
                 state.error(XmlErrorCodes.SIMPLE_TYPE_PROPERTIES$UNION_FINAL, null, parseUnion);
+
+            // Check that the member type is not a plan NOTATION
+            if (mImpl.getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                state.recover(XmlErrorCodes.DATATYPE_ENUM_NOTATION, null, parseUnion);
         }
 
         sImpl.setUnionOfLists(isUnionOfLists);
@@ -677,7 +684,8 @@
                         new Object[] { facetName, QNameHelper.pretty(baseImpl.getName())
}, facet);
                     continue;
                 }
-                else if (baseImpl.getPrimitiveType().getBuiltinTypeCode() == SchemaType.BTC_NOTATION
+                else if (baseImpl.getSimpleVariety() == SchemaType.ATOMIC &amp;&amp;
+                    baseImpl.getPrimitiveType().getBuiltinTypeCode() == SchemaType.BTC_NOTATION
                     &amp;&amp; (code == SchemaType.FACET_LENGTH || code == SchemaType.FACET_MIN_LENGTH
||
                     code == SchemaType.FACET_MAX_LENGTH))
                 {

Modified: xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java?rev=781219&amp;r1=781218&amp;r2=781219&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java (original)
+++ xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java Wed Jun  3 00:13:04
2009
@@ -576,9 +576,9 @@
                 Assert.fail("Problem with " + str + ": " + e.getMessage());
             }
 
-            if ( str.contains("24:00:00") &amp;&amp; gdate.hasDay() )   // for 24h if hasDay
must be normalized, else has the same representation
+            if ( str.indexOf("24:00:00") &gt;= 0 &amp;&amp; gdate.hasDay() )   // for 24h
if hasDay must be normalized, else has the same representation
             {
-                Assert.assertTrue(str + " " + gdate.toString(), gdate.hasDay() &amp;&amp;
gdate.toString().contains("00:00:00"));
+                Assert.assertTrue(str + " " + gdate.toString(), gdate.hasDay() &amp;&amp;
gdate.toString().indexOf("00:00:00") &gt;= 0);
             }
             else
                 // must round-trip to string



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r781199 - in /xmlbeans/trunk: src/typeimpl/org/apache/xmlbeans/impl/schema/ src/typeimpl/org/apache/xmlbeans/impl/validator/ src/typeimpl/org/apache/xmlbeans/impl/values/ src/xmlpublic/org/apache/xmlbeans/ test/src/compile/scomp/detailed/</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200906.mbox/%3c20090602224553.6D07C23888CB@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090602224553-6D07C23888CB@eris-apache-org%3e</id>
<updated>2009-06-02T22:45:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Tue Jun  2 22:45:52 2009
New Revision: 781199

URL: http://svn.apache.org/viewvc?rev=781199&amp;view=rev
Log:
Partial implementation of the NOTATION built-in type

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaNotationHolderEx.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolderEx.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlErrorCodes.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties
    xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscChecker.java Tue Jun 
2 22:45:52 2009
@@ -28,6 +28,7 @@
 import org.apache.xmlbeans.XmlID;
 import org.apache.xmlbeans.XmlAnySimpleType;
 import org.apache.xmlbeans.XmlErrorCodes;
+import org.apache.xmlbeans.XmlNOTATION;
 import org.apache.xmlbeans.XmlString;
 import org.apache.xmlbeans.impl.common.XBeanDebug;
 import org.apache.xmlbeans.impl.common.QNameHelper;
@@ -73,7 +74,8 @@
     
     /**
      * The following code checks rule #5 of http://www.w3.org/TR/xmlschema-1/#coss-ct
-     * as well as attribute + element default/fixed validity.
+     * as well as attribute + element default/fixed validity. &lt;p/&gt;
+     * Checks that xs:NOTATION is not used directly
      */
     public static void checkFields(SchemaTypeImpl sType)
     {
@@ -108,6 +110,35 @@
                             null, attrLocation != null ? attrLocation : location);
                     }
                 }
+                else if (XmlNOTATION.type.isAssignableFrom(sAttrs[i].getType()))
+                {
+                    if (sAttrs[i].getType().getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                    {
+                        StscState.get().recover(XmlErrorCodes.ATTR_NOTATION_TYPE_FORBIDDEN,
+                            new Object[]{ QNameHelper.pretty(sAttrs[i].getName()) },
+                            attrLocation != null ? attrLocation : location);
+                    }
+                    else
+                    {
+                        // Check that the Schema in which this is present doesn't have a
targetNS
+                        boolean hasNS;
+                        if (sType.isAttributeType())
+                            hasNS = sAttrs[i].getName().getNamespaceURI().length() &gt; 0;
+                        else
+                        {
+                            SchemaType t = sType;
+                            while (t.getOuterType() != null)
+                                t = t.getOuterType();
+                            if (t.isDocumentType())
+                                hasNS = t.getDocumentElementName().getNamespaceURI().length()
&gt; 0;
+                            else hasNS = t.getName().getNamespaceURI().length() &gt; 0;
+                        }
+                        if (hasNS)
+                            StscState.get().warning(XmlErrorCodes.ATTR_COMPATIBILITY_TARGETNS,
+                                new Object[] {QNameHelper.pretty(sAttrs[i].getName()) },
+                                attrLocation != null ? attrLocation : location);
+                    }
+                }
                 else
                 {
                     String valueConstraint = sAttrs[i].getDefaultText();
@@ -151,7 +182,15 @@
         
         checkElementDefaults(sType.getContentModel(), location, sType);
     }
-    
+
+    /**
+     * Checks the default values of elements.&lt;p/&gt;
+     * Also checks that the type of elements is not one of ID, IDREF, IDREFS, ENTITY, ENTITIES
or
+     * NOTATION as per XMLSchema part 2.
+     * @param model
+     * @param location
+     * @param parentType
+     */
     private static void checkElementDefaults(SchemaParticle model, XmlObject location, SchemaType
parentType)
     {
         if (model == null)
@@ -244,8 +283,54 @@
                             (constraintLocation==null ? location : constraintLocation));
                     }
                 }
+                // Checks if the type is one of the "attribute-specific" types
+                String warningType = null;
+                if (BuiltinSchemaTypeSystem.ST_ID.isAssignableFrom(model.getType()))
+                    warningType = BuiltinSchemaTypeSystem.ST_ID.getName().getLocalPart();
+                else if (BuiltinSchemaTypeSystem.ST_IDREF.isAssignableFrom(model.getType()))
+                    warningType = BuiltinSchemaTypeSystem.ST_IDREF.getName().getLocalPart();
+                else if (BuiltinSchemaTypeSystem.ST_IDREFS.isAssignableFrom(model.getType()))
+                    warningType = BuiltinSchemaTypeSystem.ST_IDREFS.getName().getLocalPart();
+                else if (BuiltinSchemaTypeSystem.ST_ENTITY.isAssignableFrom(model.getType()))
+                    warningType = BuiltinSchemaTypeSystem.ST_ENTITY.getName().getLocalPart();
+                else if (BuiltinSchemaTypeSystem.ST_ENTITIES.isAssignableFrom(model.getType()))
+                    warningType = BuiltinSchemaTypeSystem.ST_ENTITIES.getName().getLocalPart();
+                else if (BuiltinSchemaTypeSystem.ST_NOTATION.isAssignableFrom(model.getType()))
+                {
+                    if (model.getType().getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                    {
+                        StscState.get().recover(XmlErrorCodes.ELEM_NOTATION_TYPE_FORBIDDEN,
+                            new Object[]{ QNameHelper.pretty(model.getName()) },
+                            ((SchemaLocalElementImpl) model)._parseObject == null ? location
:
+                            ((SchemaLocalElementImpl) model)._parseObject.selectAttribute("",
"type"));
+                    }
+                    else
+                        warningType = BuiltinSchemaTypeSystem.ST_NOTATION.getName().getLocalPart();
+
+                    // Check that the Schema in which this is present doesn't have a targetNS
+                    boolean hasNS;
+                    SchemaType t = parentType;
+                    while (t.getOuterType() != null)
+                        t = t.getOuterType();
+                    if (t.isDocumentType())
+                        hasNS = t.getDocumentElementName().getNamespaceURI().length() &gt;
0;
+                    else
+                        hasNS = t.getName().getNamespaceURI().length() &gt; 0;
+                    if (hasNS)
+                        StscState.get().warning(XmlErrorCodes.ELEM_COMPATIBILITY_TARGETNS,
+                            new Object[] {QNameHelper.pretty(model.getName()) },
+                            ((SchemaLocalElementImpl) model)._parseObject == null ? location
:
+                            ((SchemaLocalElementImpl) model)._parseObject);
+                }
+
+                if (warningType != null)
+                    StscState.get().warning(XmlErrorCodes.ELEM_COMPATIBILITY_TYPE, new Object[]
+                        { QNameHelper.pretty(model.getName()), warningType },
+                        ((SchemaLocalElementImpl) model)._parseObject == null ? location
:
+                        ((SchemaLocalElementImpl) model)._parseObject.selectAttribute("",
"type"));
+
                 break;
-                
+
            default:
                 // nothing to do.
                 break;

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
Tue Jun  2 22:45:52 2009
@@ -24,18 +24,18 @@
 import org.apache.xmlbeans.impl.regex.RegularExpression;
 import org.apache.xmlbeans.impl.regex.ParseException;
 import org.apache.xmlbeans.impl.common.QNameHelper;
-import org.apache.xmlbeans.XmlErrorCodes;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlInteger;
 import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlAnySimpleType;
 import org.apache.xmlbeans.SimpleValue;
+import org.apache.xmlbeans.XmlAnySimpleType;
 import org.apache.xmlbeans.XmlByte;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlErrorCodes;
+import org.apache.xmlbeans.XmlInteger;
+import org.apache.xmlbeans.XmlNonNegativeInteger;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlPositiveInteger;
 import org.apache.xmlbeans.XmlShort;
 import org.apache.xmlbeans.XmlUnsignedByte;
-import org.apache.xmlbeans.XmlPositiveInteger;
-import org.apache.xmlbeans.XmlNonNegativeInteger;
 import org.apache.xmlbeans.impl.xb.xsdschema.*;
 import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument.Schema;
 
@@ -622,6 +622,7 @@
                         return true;
                 }
                 return false;
+
             default:
                 assert(false);
                 return false;
@@ -676,6 +677,13 @@
                         new Object[] { facetName, QNameHelper.pretty(baseImpl.getName())
}, facet);
                     continue;
                 }
+                else if (baseImpl.getPrimitiveType().getBuiltinTypeCode() == SchemaType.BTC_NOTATION
+                    &amp;&amp; (code == SchemaType.FACET_LENGTH || code == SchemaType.FACET_MIN_LENGTH
||
+                    code == SchemaType.FACET_MAX_LENGTH))
+                {
+                    state.warning(XmlErrorCodes.FACETS_DEPRECATED_NOTATION,
+                        new Object[] {facetName, QNameHelper.pretty(baseImpl.getName()) },
facet);
+                }
                 if (seenFacet[code] &amp;&amp; !isMultipleFacet(code))
                 {
                     state.error(XmlErrorCodes.DATATYPE_SINGLE_FACET_VALUE, null, facet);
@@ -984,6 +992,12 @@
             patternArray = EMPTY_REGEX_ARRAY;
         sImpl.setPatternFacet((patternArray.length &gt; 0 || baseImpl.hasPatternFacet()));
         sImpl.setPatterns(patternArray);
+
+        // Check that, if the base type is NOTATION, there is an enumeration facet
+        // http://www.w3.org/TR/xmlschema-2/#NOTATION
+        if (baseImpl.getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+            if (sImpl.getEnumerationValues() == null)
+                state.recover(XmlErrorCodes.DATATYPE_ENUM_NOTATION, null, restriction);
     }
 
     private static XmlValueRef[] makeValueRefArray(XmlAnySimpleType[] source)

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java Tue Jun
 2 22:45:52 2009
@@ -18,27 +18,27 @@
 import org.apache.xmlbeans.impl.common.IdentityConstraint;
 import org.apache.xmlbeans.impl.common.QNameHelper;
 import org.apache.xmlbeans.impl.common.ValidationContext;
-import org.apache.xmlbeans.impl.common.ValidatorListener.Event;
 import org.apache.xmlbeans.impl.common.ValidatorListener;
 import org.apache.xmlbeans.impl.common.XmlWhitespace;
 import org.apache.xmlbeans.impl.schema.SchemaTypeVisitorImpl;
 import org.apache.xmlbeans.impl.schema.SchemaTypeImpl;
-import org.apache.xmlbeans.impl.values.NamespaceContext;
-import org.apache.xmlbeans.impl.values.JavaUriHolderEx;
 import org.apache.xmlbeans.impl.values.JavaBase64HolderEx;
+import org.apache.xmlbeans.impl.values.JavaBooleanHolder;
 import org.apache.xmlbeans.impl.values.JavaBooleanHolderEx;
-import org.apache.xmlbeans.impl.values.XmlDateImpl;
 import org.apache.xmlbeans.impl.values.JavaDecimalHolderEx;
 import org.apache.xmlbeans.impl.values.JavaDoubleHolderEx;
-import org.apache.xmlbeans.impl.values.XmlDurationImpl;
 import org.apache.xmlbeans.impl.values.JavaFloatHolderEx;
 import org.apache.xmlbeans.impl.values.JavaHexBinaryHolderEx;
-import org.apache.xmlbeans.impl.values.JavaBooleanHolder;
-import org.apache.xmlbeans.impl.values.XmlQNameImpl;
+import org.apache.xmlbeans.impl.values.JavaNotationHolderEx;
 import org.apache.xmlbeans.impl.values.JavaQNameHolderEx;
 import org.apache.xmlbeans.impl.values.JavaStringEnumerationHolderEx;
-import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
+import org.apache.xmlbeans.impl.values.JavaUriHolderEx;
+import org.apache.xmlbeans.impl.values.NamespaceContext;
+import org.apache.xmlbeans.impl.values.XmlDateImpl;
+import org.apache.xmlbeans.impl.values.XmlDurationImpl;
 import org.apache.xmlbeans.impl.values.XmlListImpl;
+import org.apache.xmlbeans.impl.values.XmlQNameImpl;
+import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
 import org.apache.xmlbeans.GDate;
 import org.apache.xmlbeans.GDuration;
 import org.apache.xmlbeans.QNameSet;
@@ -178,15 +178,6 @@
         }
     }
 
-    // KHK: remove this
-    private void emitFieldError ( Event event, String message, QName offendingQName,
-                                  SchemaType expectedSchemaType, List expectedQNames,
-                                  int errorType, SchemaType badSchemaType )
-    {
-        emitFieldError(event, message, null, null, XmlError.SEVERITY_ERROR, offendingQName,
-            expectedSchemaType, expectedQNames, errorType, badSchemaType);
-    }
-
     private void emitFieldError ( Event event, String code, Object[] args, QName offendingQName,
                                   SchemaType expectedSchemaType, List expectedQNames,
                                   int errorType, SchemaType badSchemaType )
@@ -1398,9 +1389,17 @@
             break;
         }
         case SchemaType.BTC_NOTATION :
-            // Unimplemented.
-            _stringValue = value;
+        {
+            QName n =
+                JavaNotationHolderEx.validateLexical(
+                    value, type, _vc, event );
+
+            if (errorState == _errorState)
+                JavaNotationHolderEx.validateValue( n, type, _vc );
+
+            _qnameValue = n;
             break;
+        }
 
         default :
             throw new RuntimeException( "Unexpected primitive type code" );
@@ -1711,8 +1710,8 @@
                 }
             case SchemaType.BTC_NOTATION :
                 {
-                    _listValue.add(_stringValue);
-                    _stringValue = null;
+                    _listValue.add(_qnameValue);
+                    _qnameValue = null;
                     break;
                 }
 

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaNotationHolderEx.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaNotationHolderEx.java?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaNotationHolderEx.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaNotationHolderEx.java
Tue Jun  2 22:45:52 2009
@@ -17,6 +17,13 @@
 
 import org.apache.xmlbeans.SchemaType;
 import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlAnySimpleType;
+import org.apache.xmlbeans.XmlErrorCodes;
+import org.apache.xmlbeans.impl.common.ValidationContext;
+import org.apache.xmlbeans.impl.common.PrefixResolver;
+import org.apache.xmlbeans.impl.common.QNameHelper;
+
+import javax.xml.namespace.QName;
 
 public abstract class JavaNotationHolderEx extends JavaNotationHolder
 {
@@ -51,13 +58,49 @@
     protected void set_notation(String v)
     { set_text(v); }
 
+    protected void set_xmlanysimple(XmlAnySimpleType value)
+    {
+        QName v;
+        if (_validateOnSet())
+        {
+            v = validateLexical(value.getStringValue(), _schemaType, _voorVc, NamespaceContext.getCurrent());
+
+            if (v != null)
+                validateValue(v, _schemaType, _voorVc);
+        }
+        else
+            v = JavaNotationHolder.validateLexical(value.getStringValue(), _voorVc, NamespaceContext.getCurrent());
+
+        super.set_QName(v);
+    }
+
+    public static QName validateLexical(String v, SchemaType sType, ValidationContext context,
PrefixResolver resolver)
+    {
+        QName name = JavaQNameHolder.validateLexical(v, context, resolver);
+
+        // check pattern
+        if (sType.hasPatternFacet())
+        {
+            if (!sType.matchPatternFacet(v))
+            {
+                // TODO - describe string and pattern here in error
+                context.invalid(XmlErrorCodes.DATATYPE_VALID$PATTERN_VALID,
+                    new Object[] { "NOTATION", v, QNameHelper.readable(sType) });
+            }
+        }
+
+        check(v, sType);
+
+        return name;
+    }
+
     private static boolean check(String v, SchemaType sType)
     {
         // check against length
         XmlObject len = sType.getFacet(SchemaType.FACET_LENGTH);
         if (len != null)
         {
-            int m = ((XmlObjectBase)len).bigIntegerValue().intValue();
+            int m = ((XmlObjectBase)len).getBigIntegerValue().intValue();
             if (!(v.length() != m))
                 return false;
         }
@@ -66,7 +109,7 @@
         XmlObject min = sType.getFacet(SchemaType.FACET_MIN_LENGTH);
         if (min != null)
         {
-            int m = ((XmlObjectBase)min).bigIntegerValue().intValue();
+            int m = ((XmlObjectBase)min).getBigIntegerValue().intValue();
             if (!(v.length() &gt;= m))
                 return false;
         }
@@ -75,7 +118,7 @@
         XmlObject max = sType.getFacet(SchemaType.FACET_MAX_LENGTH);
         if (max != null)
         {
-            int m = ((XmlObjectBase)max).bigIntegerValue().intValue();
+            int m = ((XmlObjectBase)max).getBigIntegerValue().intValue();
             if (!(v.length() &lt;= m))
                 return false;
         }
@@ -83,4 +126,17 @@
         return true;
     }
 
+    public static void validateValue(QName v, SchemaType sType, ValidationContext context)
+    {
+        XmlObject[] vals = sType.getEnumerationValues();
+        if (vals != null)
+        {
+            for (int i = 0; i &lt; vals.length; i++)
+                if (v.equals(((XmlObjectBase)vals[i]).getQNameValue()))
+                    return;
+            context.invalid(XmlErrorCodes.DATATYPE_ENUM_VALID,
+                new Object[] { "NOTATION", v, QNameHelper.readable(sType) });
+        }
+    }
+
 }

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolderEx.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolderEx.java?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolderEx.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolderEx.java Tue
Jun  2 22:45:52 2009
@@ -87,7 +87,7 @@
     public static QName validateLexical(String v, SchemaType sType, ValidationContext context,
PrefixResolver resolver)
     {
         QName name = JavaQNameHolder.validateLexical(v, context, resolver);
-        
+
         // check pattern
         if (sType.hasPatternFacet())
         {
@@ -128,7 +128,7 @@
         if (vals != null)
         {
             for (int i = 0; i &lt; vals.length; i++)
-                if (v.equals(((XmlObjectBase)vals[i]).qNameValue()))
+                if (v.equals(((XmlObjectBase)vals[i]).getQNameValue()))
                     return;
             context.invalid(XmlErrorCodes.DATATYPE_ENUM_VALID,
                 new Object[] { "QName", v, QNameHelper.readable(sType) });
@@ -137,7 +137,7 @@
 
     protected void validate_simpleval(String lexical, ValidationContext ctx)
     {
-        validateValue(qNameValue(), schemaType(), ctx);
+        validateValue(getQNameValue(), schemaType(), ctx);
     }
 
 }

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlErrorCodes.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlErrorCodes.java?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlErrorCodes.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlErrorCodes.java Tue Jun  2 22:45:52
2009
@@ -951,6 +951,12 @@
     public static final String FACETS_APPLICABLE = "cos-applicable-facets"; // KHK: name
ok?
 
     /**
+     * notation-facets: See
+     * http://www.w3.org/TR/xmlschema-2/#NOTATION-facets
+     */
+    public static final String FACETS_DEPRECATED_NOTATION = "notation-facets";
+
+    /**
      * cos-aw-intersect: See
      * &lt;a href="http://www.w3c.org/TR/xmlschema-1/#cos-aw-intersect"&gt;XMLSchema Structures
1.0: Attribute Wildcard Intersection&lt;/a&gt;
      */
@@ -963,6 +969,17 @@
     public static final String ATTR_WILDCARD_UNION = "cos-aw-union";
 
     /**
+     * enumeration-required-notation: See
+     * &lt;a href="http://www.w3.org/TR/xmlschema-2/#enumeration-required-notation"&gt;XMLSchema
Datatypes 1.0: Schema Component Constraint: enumeration facet value required for NOTATION&lt;/a&gt;
+     */
+    public static final String ATTR_NOTATION_TYPE_FORBIDDEN = "enumeration-required-notation-attr";
+
+    /**
+     * &lt;a href="http://www.w3c.org/TR/xmlschema-2/#NOTATION"&gt;XMLSchema Datatypes 1.0:
Definition of type NOTATION&lt;/&gt;
+     */
+    public static final String ATTR_COMPATIBILITY_TARGETNS = "notation-targetns-attr";
+
+    /**
      * cos-choice-range: See
      * &lt;a href="http://www.w3c.org/TR/xmlschema-1/#cos-choice-range"&gt;XMLSchema Structures
1.0: Effective Total Range (choice)&lt;/a&gt;
      */
@@ -1131,6 +1148,16 @@
     public static final String ELEM_DEFAULT_VALID$MIXED_AND_EMPTIABLE = "cos-valid-default.2.2.2";
 
     /**
+     * &lt;a href="http://www.w3c.org/TR/xmlschema-2/#ID"&gt;XMLSchema Datatypes 1.0: Definitions
of types ID, IDREF, IDREFS, ENTITY, ENTITIES, NOTATION&lt;/&gt;
+     */
+    public static final String ELEM_COMPATIBILITY_TYPE = "id-idref-idrefs-entity-entities-notation";
+
+    /**
+     * &lt;a href="http://www.w3c.org/TR/xmlschema-2/#NOTATION"&gt;XMLSchema Datatypes 1.0:
Definition of type NOTATION&lt;/&gt;
+     */
+    public static final String ELEM_COMPATIBILITY_TARGETNS = "notation-targetns-elem";
+
+    /**
      * ct-props-correct: See
      * &lt;a href="http://www.w3c.org/TR/xmlschema-1/#ct-props-correct"&gt;XMLSchema Structures
1.0: Complex Type Definition Properties Correct&lt;/a&gt;
      */
@@ -1264,6 +1291,12 @@
 
     /**
      * enumeration-required-notation: See
+     * &lt;a href="http://www.w3.org/TR/xmlschema-2/#enumeration-required-notation"&gt;XMLSchema
Datatypes 1.0: Schema Component Constraint: enumeration facet value required for NOTATION&lt;/a&gt;
+     */
+    public static final String ELEM_NOTATION_TYPE_FORBIDDEN = "enumeration-required-notation-elem";
+
+    /**
+     * enumeration-required-notation: See
      * &lt;a href="http://www.w3c.org/TR/xmlschema-2/#enumeration-required-notation"&gt;XMLSchema
Datatypes 1.0: enumeration facet value required for NOTATION&lt;/a&gt;
      */
     public static final String DATATYPE_ENUM_NOTATION = "enumeration-required-notation";

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/message.properties Tue Jun  2 22:45:52
2009
@@ -585,6 +585,9 @@
 cos-valid-default.2.2.2 = \
 The {0} element cannot have a {1} value ''{2}'' because it's content is mixed but not emptiable.
 
+id-idref-idrefs-entity-entities-notation = \
+For compatibility, type ''{1}'' should only be used for attributes (used for element ''{0}'').
+
 ct-props-correct = \
 Complex Type Definition Properties Correct
 
@@ -651,9 +654,18 @@
 e-props-correct.4a = \
 Element ''{0}'' is not a valid substitution for element ''{1}'' with final=''{2}''
 
+notation-targetns-attr = \
+For compatibility, NOTATION should only be used in schemas with no target namespace (attribute
''{0}'').
+
+notation-targetns-elem = \
+For compatibility, NOTATION should only be used in schemas with no target namespace (element
''{0}'').
+
 enumeration-required-notation = \
 enumeration facet value required for NOTATION
 
+notation-facets = \
+The use of {0} on datatypes derived from NOTATION (''{1}'') is deprecated.
+
 enumeration-valid-restriction = \
 Enumerated value ''{0}'' invalid: {1}
 
@@ -726,6 +738,12 @@
 no-xsi = \
 Illegal namespace for attribute declaration: {0}
 
+enumeration-required-notation-attr = \
+It is an error for NOTATION to be used directly in a schema. Only datatypes that are derived
from NOTATION by specifying a value for enumeration can be used in a schema (attribute ''{0}'').
+
+enumeration-required-notation-elem = \
+It is an error for NOTATION to be used directly in a schema. Only datatypes that are derived
from NOTATION by specifying a value for enumeration can be used in a schema (element ''{0}'').
+
 p-props-correct = \
 Particle Correct
 

Modified: xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java?rev=781199&amp;r1=781198&amp;r2=781199&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java Tue Jun  2 22:45:52
2009
@@ -20,6 +20,7 @@
 import junit.framework.TestSuite;
 import junit.framework.Assert;
 import org.apache.xmlbeans.*;
+import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
 
 import java.io.File;
 import java.util.*;
@@ -114,4 +115,175 @@
 
     }
 
+    private static final String schema_begin = "&lt;xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"&gt;\n";
+    private static final String root_decl    = "&lt;xs:element name=\"root\"&gt;\n  &lt;xs:complexType&gt;\n";
+    private static final String att_decl     = "    &lt;xs:attribute name=\"att\" type=\"simpleNotType\"/&gt;\n";
+    private static final String root_end     = "  &lt;/xs:complexType&gt;\n&lt;/xs:element&gt;\n";
+    private static final String schema_end   = "&lt;/xs:schema&gt;\n";
+
+    private static final String notation1    = "    &lt;xs:attribute name=\"att\" type=\"xs:NOTATION\"/&gt;\n";
+    private static final String notation2    = "&lt;xs:simpleType name=\"simpleNotType\"&gt;\n"
+
+                                               "  &lt;xs:restriction base=\"xs:NOTATION\"&gt;\n"
+
+                                               "    &lt;xs:pattern value=\"ns:.*\"/&gt;\n"
+
+                                               "  &lt;/xs:restriction&gt;\n&lt;/xs:simpleType&gt;\n";
+    private static final String notation3    = "    &lt;xs:sequence&gt;\n      " +
+                                               "&lt;xs:element name=\"elem\" type=\"xs:ID\"/&gt;\n"
+
+                                               "    &lt;/xs:sequence&gt;\n";
+    private static final String notation4    = " targetNamespace=\"scomp.detailed.CompilationTests\"
" +
+                                               "xmlns=\"scomp.detailed.CompilationTests\"&gt;\n";
+    private static final String simpleTypeDef= "&lt;xs:simpleType name=\"simpleNotType\"&gt;\n"
+
+                                               "  &lt;xs:restriction base=\"enumDef\"&gt;\n";
+    private static final String notation6    = "    &lt;xs:pattern value=\"ns:.*\"/&gt;\n";
+    private static final String notation5    = "    &lt;xs:length value=\"6\"/&gt;\n";
+    private static final String enumDef      = "  &lt;/xs:restriction&gt;\n&lt;/xs:simpleType&gt;\n"
+
+                                               "&lt;xs:simpleType name=\"enumDef\"&gt;\n"
+
+                                               "  &lt;xs:restriction base=\"xs:NOTATION\"
xmlns:ns=\"namespace.notation\"&gt;\n" +
+                                               "    &lt;xs:enumeration value=\"ns:app1\"/&gt;\n"
+
+                                               "    &lt;xs:enumeration value=\"ns:app2\"/&gt;\n"
+
+                                               "  &lt;/xs:restriction&gt;\n&lt;/xs:simpleType&gt;\n";
+
+    private static final String doc_begin    = "&lt;root xmlns:ns=\"namespace.notation\"
" +
+                                               "xmlns:app=\"namespace.notation\" att=\"";
+    private static final String doc_end      = "\"/&gt;";
+    private static final String notation7    = "ns1:app1";
+    private static final String notation8    = "ns:app";
+    private static final String notation9    = "app:app1";
+    private static final String notation10   = "ns:app1";
+
+    /**
+     * This tests usage of the xs:NOTATION type
+     * @throws Exception
+     */
+    public void testNotation() throws Exception
+    {
+        String schema;
+        String xml;
+        SchemaTypeSystem typeSystem;
+        XmlObject[] parsedSchema = new XmlObject[1];
+        XmlObject parsedDoc;
+        XmlOptions opts = new XmlOptions();
+        ArrayList errors = new ArrayList();
+        opts.setErrorListener(errors);
+        opts.put("COMPILE_PARTIAL_TYPESYSTEM");
+
+        // 1. Negative test - Error if xs:NOTATION used directly
+        schema = schema_begin + root_decl + notation1 + root_end + schema_end;
+//        System.out.println(schema);
+        parsedSchema[0] = SchemaDocument.Factory.parse(schema);
+        errors.clear();
+        XmlBeans.compileXsd(parsedSchema, null, opts);
+        assertTrue("Expected error: NOTATION type cannot be used directly", errors.size()
== 1);
+        assertEquals("Expected error: NOTATION type cannot be used directly",
+            XmlErrorCodes.ATTR_NOTATION_TYPE_FORBIDDEN, ((XmlError)errors.get(0)).getErrorCode());
+        assertEquals(XmlError.SEVERITY_ERROR, ((XmlError)errors.get(0)).getSeverity());
+
+        // 2. Negative test - Error if xs:NOTATION restricted without enumeration
+        schema = schema_begin + root_decl + att_decl + root_end + notation2 + schema_end;
+//        System.out.println(schema);
+        parsedSchema[0] = SchemaDocument.Factory.parse(schema);
+        errors.clear();
+        XmlBeans.compileXsd(parsedSchema, null, opts);
+        assertTrue("Expected error: restriction of NOTATION must use enumeration facet",
errors.size() == 1);
+        assertEquals("Expected error: restriction of NOTATION must use enumeration facet",
+            XmlErrorCodes.DATATYPE_ENUM_NOTATION, ((XmlError)errors.get(0)).getErrorCode());
+        assertEquals(XmlError.SEVERITY_ERROR, ((XmlError)errors.get(0)).getSeverity());
+
+        // 3. Warning if xs:NOTATION used as type of an element
+        final String correctTypes = simpleTypeDef + notation6 + enumDef;
+        schema = schema_begin + root_decl + notation3 + root_end + correctTypes + schema_end;
+//        System.out.println(schema);
+        parsedSchema[0] = SchemaDocument.Factory.parse(schema);
+        errors.clear();
+        XmlBeans.compileXsd(parsedSchema, null, opts);
+        assertTrue("Expected warning: NOTATION-derived type should not be used on elements",
errors.size() == 1);
+        assertEquals("Expected warning: NOTATION-derived type should not be used on elements",
+            XmlErrorCodes.ELEM_COMPATIBILITY_TYPE, ((XmlError)errors.get(0)).getErrorCode());
+        assertEquals(XmlError.SEVERITY_WARNING, ((XmlError)errors.get(0)).getSeverity());
+
+        // 4. Warning if xs:NOTATION is used in a Schema with target namespace
+        schema = schema_begin.substring(0, schema_begin.length() - 2) + notation4 + root_decl
+
+            att_decl + root_end + correctTypes + schema_end;
+//        System.out.println(schema);
+        parsedSchema[0] = SchemaDocument.Factory.parse(schema);
+        errors.clear();
+        XmlBeans.compileXsd(parsedSchema, null, opts);
+        assertTrue("Expected warning: NOTATION-derived type should not be used in a Schema
with target namespace", errors.size() == 1);
+        assertEquals("Expected warning: NOTATION-derived type should not be used in a Schema
with target namespace",
+            XmlErrorCodes.ATTR_COMPATIBILITY_TARGETNS, ((XmlError)errors.get(0)).getErrorCode());
+        assertEquals(XmlError.SEVERITY_WARNING, ((XmlError)errors.get(0)).getSeverity());
+
+        // 5. Warning - Deprecation of minLength, maxLength and length facets
+        schema = schema_begin + root_decl + att_decl + root_end + simpleTypeDef + notation5
+
+            enumDef + schema_end;
+//        System.out.println(schema);
+        parsedSchema[0] = SchemaDocument.Factory.parse(schema);
+        errors.clear();
+        XmlBeans.compileXsd(parsedSchema, null, opts);
+        assertTrue("Expected warning: length facet cannot be used on a type derived from
NOTATION", errors.size() == 1);
+        assertEquals("Expected warning: length facet cannot be used on a type derived from
NOTATION",
+            XmlErrorCodes.FACETS_DEPRECATED_NOTATION, ((XmlError)errors.get(0)).getErrorCode());
+        assertEquals(XmlError.SEVERITY_WARNING, ((XmlError)errors.get(0)).getSeverity());
+
+        // 6. Positive test - Test restriction via enumeration, then same as 2
+        schema = schema_begin + root_decl + att_decl + root_end + correctTypes + schema_end;
+//        System.out.println(schema);
+        parsedSchema[0] = SchemaDocument.Factory.parse(schema);
+        errors.clear();
+        typeSystem = XmlBeans.compileXsd(parsedSchema, null, opts);
+        assertTrue("Expected no errors or warnings", errors.size() == 0);
+        SchemaType docType = typeSystem.findDocumentType(new QName("", "root"));
+        SchemaType type = docType.getElementProperty(new QName("", "root")).getType().
+            getAttributeProperty(new QName("", "att")).getType();
+        assertEquals(type.getPrimitiveType().getBuiltinTypeCode(), SchemaType.BTC_NOTATION);
+
+        SchemaTypeLoader loader = XmlBeans.typeLoaderUnion(new SchemaTypeLoader[] {typeSystem,
+            XmlBeans.getBuiltinTypeSystem()});
+
+        // 7. Validation negative - Test error if QName has bad prefix
+        xml = doc_begin + notation7 + doc_end;
+        parsedDoc = loader.parse(xml, null, opts);
+        assertEquals("Did not find the root element in the Schema", docType, parsedDoc.schemaType());
+        errors.clear();
+        parsedDoc.validate(opts);
+        // Both "prefix not found" and "pattern doesn't match" errors
+        assertTrue("Expected validation errors", errors.size() == 2);
+        // Unfortunately, can't get the error code because it is logged via an intermediate
exception
+        assertTrue("Expected prefix not found error", ((XmlError) errors.get(0)).getMessage().
+            indexOf("Invalid QName") &gt;= 0);
+        assertEquals(XmlError.SEVERITY_ERROR, ((XmlError) errors.get(0)).getSeverity());
+//        System.out.println(xml);
+
+        // 8. Validation negative - Test error if QName has correct prefix but not in enumeration
+        xml = doc_begin + notation8 + doc_end;
+        parsedDoc = loader.parse(xml, null, opts);
+        assertEquals("Did not find the root element in the Schema", docType, parsedDoc.schemaType());
+        errors.clear();
+        parsedDoc.validate(opts);
+        assertTrue("Expected validation errors", errors.size() == 1);
+        assertEquals("Expected prefix not found error", XmlErrorCodes.DATATYPE_ENUM_VALID,
+            ((XmlError) errors.get(0)).getErrorCode());
+        assertEquals(XmlError.SEVERITY_ERROR, ((XmlError) errors.get(0)).getSeverity());
+//        System.out.println(xml);
+
+        // 9. Validation negative - Test error if QName doesn't match the extra facet
+        xml = doc_begin + notation9 + doc_end;
+        parsedDoc = loader.parse(xml, null, opts);
+        assertEquals("Did not find the root element in the Schema", docType, parsedDoc.schemaType());
+        errors.clear();
+        parsedDoc.validate(opts);
+        assertTrue("Expected validation errors", errors.size() == 1);
+        assertEquals("Expected prefix not found error", XmlErrorCodes.DATATYPE_VALID$PATTERN_VALID,
+            ((XmlError) errors.get(0)).getErrorCode());
+        assertEquals(XmlError.SEVERITY_ERROR, ((XmlError) errors.get(0)).getSeverity());
+//        System.out.println(xml);
+
+        // 10. Validation positive - Test that validation can be performed correctly
+        xml = doc_begin + notation10 + doc_end;
+        parsedDoc = loader.parse(xml, null, opts);
+        assertEquals("Did not find the root element in the Schema", docType, parsedDoc.schemaType());
+        errors.clear();
+        parsedDoc.validate(opts);
+        assertTrue("Expected no validation errors", errors.size() == 0);
+//        System.out.println(xml);
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r778929 - in /xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans: GDate.java GDateBuilder.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200905.mbox/%3c20090526234821.3D67823888C2@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090526234821-3D67823888C2@eris-apache-org%3e</id>
<updated>2009-05-26T23:48:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Tue May 26 23:48:20 2009
New Revision: 778929

URL: http://svn.apache.org/viewvc?rev=778929&amp;view=rev
Log:
Fix for 24h time when using setTime in GDateBuilder.


Modified:
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java?rev=778929&amp;r1=778928&amp;r2=778929&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java Tue May 26 23:48:20 2009
@@ -267,7 +267,7 @@
         if ( hasTime() &amp;&amp; _h == 24 )
         {
             if ( _m != 0 || _s != 0 || _fs.compareTo(_zero) != 0 )
-                throw new IllegalArgumentException("if hour is 24 minutes, seconds and fraction
must be 0");
+                throw new IllegalArgumentException("if hour is 24, minutes, seconds and fraction
must be 0");
             else
             {   // normalize to next day if it has date or at least has day
                 if ( hasDate() )

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java?rev=778929&amp;r1=778928&amp;r2=778929&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java Tue May 26 23:48:20
2009
@@ -414,14 +414,14 @@
      * minutes and seconds range from 0 to 59; and fractional
      * seconds range from 0 (inclusive) to 1 (exclusive).
      * The fraction can be null and is assumed to be zero.
-     * @param hour the hour of day, from 0-23
+     * @param hour the hour of day, from 0-23 or 24 only if min, sec and fraction are 0
      * @param minute the minute of hour, from 0-59
      * @param second the second of minute, from 0-59
      * @param fraction the fraction of second, 0.0 to 0.999... (may be null)
      */
     public void setTime(int hour, int minute, int second, BigDecimal fraction)
     {
-        if (hour &lt; 0 || hour &gt; 23)
+        if (hour &lt; 0 || hour &gt; 24 )
             throw new IllegalArgumentException("hour out of range");
         if (minute &lt; 0 || minute &gt; 59)
             throw new IllegalArgumentException("minute out of range");
@@ -429,6 +429,9 @@
             throw new IllegalArgumentException("second out of range");
         if (fraction != null &amp;&amp; (fraction.signum() &lt; 0 || fraction.compareTo(GDate._one)
&gt; 1))
             throw new IllegalArgumentException("fraction out of range");
+        if ( hour == 24 &amp;&amp; (minute!=0 || second!=0 || (fraction!=null &amp;&amp;
(GDate._zero.compareTo(fraction)!=0)) ))
+            throw new IllegalArgumentException("when hour is 24, min sec and fracton must
be 0");
+
         _bits |= HAS_TIME;
         _h = hour;
         _m = minute;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r778889 - in /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema: SchemaTypeSystemImpl.java XQuerySchemaTypeSystem.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200905.mbox/%3c20090526211318.6AAD423888C2@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090526211318-6AAD423888C2@eris-apache-org%3e</id>
<updated>2009-05-26T21:13:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Tue May 26 21:13:17 2009
New Revision: 778889

URL: http://svn.apache.org/viewvc?rev=778889&amp;view=rev
Log:
Added XQuerySchemaTypeSystem class as an alternative to BuiltinSchemaTypeSystem to enable
processing of Schema documents that contain the extra types defined in XQuery 1.0

Added:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java?rev=778889&amp;r1=778888&amp;r2=778889&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
Tue May 26 21:13:17 2009
@@ -1988,7 +1988,11 @@
             switch (handle.charAt(2))
             {
                 case 'I': // _BI_ - built-in schema type system
-                    return ((SchemaType)BuiltinSchemaTypeSystem.get().resolveHandle(handle)).getRef();
+                    SchemaType st = (SchemaType) BuiltinSchemaTypeSystem.get().resolveHandle(handle);
+                    if (st != null)
+                        return st.getRef();
+                    st = (SchemaType) XQuerySchemaTypeSystem.get().resolveHandle(handle);
+                    return st.getRef();
                 case 'T': // _XT_ - external type
                     return _linker.findTypeRef(QNameHelper.forPretty(handle, 4));
                 case 'E': // _XE_ - external element

Added: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java?rev=778889&amp;view=auto
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
(added)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XQuerySchemaTypeSystem.java
Tue May 26 21:13:17 2009
@@ -0,0 +1,1139 @@
+/*   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.xmlbeans.impl.schema;
+
+import java.io.File;
+import java.io.InputStream;
+import java.math.BigInteger;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xmlbeans.Filer;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.SchemaAnnotation;
+import org.apache.xmlbeans.SchemaAttributeGroup;
+import org.apache.xmlbeans.SchemaAttributeModel;
+import org.apache.xmlbeans.SchemaComponent;
+import org.apache.xmlbeans.SchemaGlobalAttribute;
+import org.apache.xmlbeans.SchemaGlobalElement;
+import org.apache.xmlbeans.SchemaIdentityConstraint;
+import org.apache.xmlbeans.SchemaModelGroup;
+import org.apache.xmlbeans.SchemaParticle;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.SchemaTypeSystem;
+import org.apache.xmlbeans.impl.common.QNameHelper;
+import org.apache.xmlbeans.impl.values.XmlIntegerImpl;
+import org.apache.xmlbeans.impl.values.XmlStringImpl;
+import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
+
+/**
+ * Same as {@link BuiltinSchemaTypeSystem} but adds three extra types
+ * (&lt;i&gt;dayTimeDuration&lt;/i&gt;, &lt;i&gt;yearMonthDuration&lt;/i&gt; and &lt;i&gt;anyAtomicType&lt;/i&gt;)

+ * and makes all the primitives extend &lt;i&gt;anyAtomicType&lt;/i&gt;.
+ * 
+ * @author Radu Preotiuc
+ *
+ */
+public class XQuerySchemaTypeSystem extends SchemaTypeLoaderBase implements
+        SchemaTypeSystem
+{
+    // The global builtin type system
+    public static SchemaTypeSystem get()
+        { return _global; }
+
+    // Extra constants; since the extra types are going to be part of XMLSchema 1.1
+    // we will want to eventually move these to SchemaType
+    public static final int BTC_FIRST_XQUERY = 52;
+    public static final int BTC_ANY_ATOMIC = 52;
+    public static final int BTC_DAY_TIME_DURATION = 53;
+    public static final int BTC_YEAR_MONTH_DURATION = 54;
+    public static final int BTC_LAST_XQUERY = 54;
+
+    // some constants that need to be initialized early
+    private static final SchemaType[] EMPTY_SCHEMATYPE_ARRAY = new SchemaType[0];
+    private static final SchemaType.Ref[] EMPTY_SCHEMATYPEREF_ARRAY = new SchemaType.Ref[0];
+    private static final SchemaGlobalElement[] EMPTY_SCHEMAELEMENT_ARRAY = new SchemaGlobalElement[0];
+    private static final SchemaGlobalAttribute[] EMPTY_SCHEMAATTRIBUTE_ARRAY = new SchemaGlobalAttribute[0];
+    private static final SchemaModelGroup[] EMPTY_SCHEMAMODELGROUP_ARRAY = new SchemaModelGroup[0];
+    private static final SchemaAttributeGroup[] EMPTY_SCHEMAATTRIBUTEGROUP_ARRAY = new SchemaAttributeGroup[0];
+    private static final SchemaAnnotation[] EMPTY_SCHEMAANNOTATION_ARRAY = new SchemaAnnotation[0];
+
+    private static XQuerySchemaTypeSystem _global = new XQuerySchemaTypeSystem();
+
+    // UR types
+    public static final SchemaTypeImpl ST_ANY_TYPE = _global.getBuiltinType(SchemaType.BTC_ANY_TYPE);
+    public static final SchemaTypeImpl ST_ANY_SIMPLE = _global.getBuiltinType(SchemaType.BTC_ANY_SIMPLE);
+    public static final SchemaTypeImpl ST_ANY_ATOMIC = _global.getBuiltinType(BTC_ANY_ATOMIC);
+
+    // primitives
+    public static final SchemaTypeImpl ST_BOOLEAN = _global.getBuiltinType(SchemaType.BTC_BOOLEAN);
+    public static final SchemaTypeImpl ST_BASE_64_BINARY = _global.getBuiltinType(SchemaType.BTC_BASE_64_BINARY);
+    public static final SchemaTypeImpl ST_HEX_BINARY = _global.getBuiltinType(SchemaType.BTC_HEX_BINARY);
+    public static final SchemaTypeImpl ST_ANY_URI = _global.getBuiltinType(SchemaType.BTC_ANY_URI);
+    public static final SchemaTypeImpl ST_QNAME = _global.getBuiltinType(SchemaType.BTC_QNAME);
+    public static final SchemaTypeImpl ST_NOTATION = _global.getBuiltinType(SchemaType.BTC_NOTATION);
+    public static final SchemaTypeImpl ST_FLOAT = _global.getBuiltinType(SchemaType.BTC_FLOAT);
+    public static final SchemaTypeImpl ST_DOUBLE = _global.getBuiltinType(SchemaType.BTC_DOUBLE);
+    public static final SchemaTypeImpl ST_DECIMAL = _global.getBuiltinType(SchemaType.BTC_DECIMAL);
+    public static final SchemaTypeImpl ST_STRING = _global.getBuiltinType(SchemaType.BTC_STRING);
+
+    public static final SchemaTypeImpl ST_DURATION = _global.getBuiltinType(SchemaType.BTC_DURATION);
+    public static final SchemaTypeImpl ST_DATE_TIME = _global.getBuiltinType(SchemaType.BTC_DATE_TIME);
+    public static final SchemaTypeImpl ST_TIME = _global.getBuiltinType(SchemaType.BTC_TIME);
+    public static final SchemaTypeImpl ST_DATE = _global.getBuiltinType(SchemaType.BTC_DATE);
+    public static final SchemaTypeImpl ST_G_YEAR_MONTH = _global.getBuiltinType(SchemaType.BTC_G_YEAR_MONTH);
+    public static final SchemaTypeImpl ST_G_YEAR = _global.getBuiltinType(SchemaType.BTC_G_YEAR);
+    public static final SchemaTypeImpl ST_G_MONTH_DAY = _global.getBuiltinType(SchemaType.BTC_G_MONTH_DAY);
+    public static final SchemaTypeImpl ST_G_DAY = _global.getBuiltinType(SchemaType.BTC_G_DAY);
+    public static final SchemaTypeImpl ST_G_MONTH = _global.getBuiltinType(SchemaType.BTC_G_MONTH);
+
+    // derived numerics
+    public static final SchemaTypeImpl ST_INTEGER = _global.getBuiltinType(SchemaType.BTC_INTEGER);
+    public static final SchemaTypeImpl ST_LONG = _global.getBuiltinType(SchemaType.BTC_LONG);
+    public static final SchemaTypeImpl ST_INT = _global.getBuiltinType(SchemaType.BTC_INT);
+    public static final SchemaTypeImpl ST_SHORT = _global.getBuiltinType(SchemaType.BTC_SHORT);
+    public static final SchemaTypeImpl ST_BYTE = _global.getBuiltinType(SchemaType.BTC_BYTE);
+    public static final SchemaTypeImpl ST_NON_POSITIVE_INTEGER = _global.getBuiltinType(SchemaType.BTC_NON_POSITIVE_INTEGER);
+    public static final SchemaTypeImpl ST_NEGATIVE_INTEGER = _global.getBuiltinType(SchemaType.BTC_NEGATIVE_INTEGER);
+    public static final SchemaTypeImpl ST_NON_NEGATIVE_INTEGER = _global.getBuiltinType(SchemaType.BTC_NON_NEGATIVE_INTEGER);
+    public static final SchemaTypeImpl ST_POSITIVE_INTEGER = _global.getBuiltinType(SchemaType.BTC_POSITIVE_INTEGER);
+    public static final SchemaTypeImpl ST_UNSIGNED_LONG = _global.getBuiltinType(SchemaType.BTC_UNSIGNED_LONG);
+    public static final SchemaTypeImpl ST_UNSIGNED_INT = _global.getBuiltinType(SchemaType.BTC_UNSIGNED_INT);
+    public static final SchemaTypeImpl ST_UNSIGNED_SHORT = _global.getBuiltinType(SchemaType.BTC_UNSIGNED_SHORT);
+    public static final SchemaTypeImpl ST_UNSIGNED_BYTE = _global.getBuiltinType(SchemaType.BTC_UNSIGNED_BYTE);
+
+    // derived strings
+    public static final SchemaTypeImpl ST_NORMALIZED_STRING = _global.getBuiltinType(SchemaType.BTC_NORMALIZED_STRING);
+    public static final SchemaTypeImpl ST_TOKEN = _global.getBuiltinType(SchemaType.BTC_TOKEN);
+    public static final SchemaTypeImpl ST_NAME = _global.getBuiltinType(SchemaType.BTC_NAME);
+    public static final SchemaTypeImpl ST_NCNAME = _global.getBuiltinType(SchemaType.BTC_NCNAME);
+    public static final SchemaTypeImpl ST_LANGUAGE = _global.getBuiltinType(SchemaType.BTC_LANGUAGE);
+    public static final SchemaTypeImpl ST_ID = _global.getBuiltinType(SchemaType.BTC_ID);
+    public static final SchemaTypeImpl ST_IDREF = _global.getBuiltinType(SchemaType.BTC_IDREF);
+    public static final SchemaTypeImpl ST_IDREFS = _global.getBuiltinType(SchemaType.BTC_IDREFS);
+    public static final SchemaTypeImpl ST_ENTITY = _global.getBuiltinType(SchemaType.BTC_ENTITY);
+    public static final SchemaTypeImpl ST_ENTITIES = _global.getBuiltinType(SchemaType.BTC_ENTITIES);
+    public static final SchemaTypeImpl ST_NMTOKEN = _global.getBuiltinType(SchemaType.BTC_NMTOKEN);
+    public static final SchemaTypeImpl ST_NMTOKENS = _global.getBuiltinType(SchemaType.BTC_NMTOKENS);
+
+    // derived durations
+    public static final SchemaTypeImpl ST_DAY_TIME_DURATION = _global.getBuiltinType(BTC_DAY_TIME_DURATION);
+    public static final SchemaTypeImpl ST_YEAR_MONTH_DURATION = _global.getBuiltinType(BTC_YEAR_MONTH_DURATION);
+
+    // the no-type
+    public static final SchemaTypeImpl ST_NO_TYPE = _global.getBuiltinType(SchemaType.BTC_NOT_BUILTIN);
+
+    private final static XmlValueRef XMLSTR_PRESERVE = buildString("preserve");
+    private final static XmlValueRef XMLSTR_REPLACE = buildString("preserve");
+    private final static XmlValueRef XMLSTR_COLLAPSE = buildString("preserve");
+
+    private final static XmlValueRef[] FACETS_NONE = new XmlValueRef[]
+        { null, null, null, null, null, null, null, null, null,
+          null, null, null };
+
+    private final static boolean[] FIXED_FACETS_NONE = new boolean[]
+        { false, false, false, false, false, false, false, false, false,
+          false, false, false };
+
+    private final static XmlValueRef[] FACETS_WS_COLLAPSE = new XmlValueRef[]
+        { null, null, null, null, null, null, null, null, null,
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_WS_REPLACE = new XmlValueRef[]
+        { null, null, null, null, null, null, null, null, null,
+          build_wsstring(SchemaType.WS_REPLACE), null, null };
+
+    private final static XmlValueRef[] FACETS_WS_PRESERVE = new XmlValueRef[]
+        { null, null, null, null, null, null, null, null, null,
+          build_wsstring(SchemaType.WS_PRESERVE), null, null };
+
+    private final static XmlValueRef[] FACETS_INTEGER = new XmlValueRef[]
+        { null, null, null, null, null, null, null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_LONG = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.valueOf(Long.MIN_VALUE)), buildInteger(BigInteger.valueOf(Long.MAX_VALUE)),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_INT = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.valueOf(Integer.MIN_VALUE)), buildInteger(BigInteger.valueOf(Integer.MAX_VALUE)),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_SHORT = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.valueOf(Short.MIN_VALUE)), buildInteger(BigInteger.valueOf(Short.MAX_VALUE)),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_BYTE = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.valueOf(Byte.MIN_VALUE)), buildInteger(BigInteger.valueOf(Byte.MAX_VALUE)),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_NONNEGATIVE = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.ZERO), null, null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_POSITIVE = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.ONE), null, null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_NONPOSITIVE = new XmlValueRef[]
+        { null, null, null, null, null, buildInteger(BigInteger.ZERO), null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_NEGATIVE = new XmlValueRef[]
+        { null, null, null, null, null, buildInteger(BigInteger.ONE.negate()), null, null,
buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_UNSIGNED_LONG = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.ZERO), buildInteger(new BigInteger("18446744073709551615")),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_UNSIGNED_INT = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.ZERO), buildInteger(BigInteger.valueOf(4294967295L)),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_UNSIGNED_SHORT = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.ZERO), buildInteger(BigInteger.valueOf(65535)),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_UNSIGNED_BYTE = new XmlValueRef[]
+        { null, null, null, null, buildInteger(BigInteger.ZERO), buildInteger(BigInteger.valueOf(255)),
null, null, buildNnInteger(BigInteger.ZERO),
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static XmlValueRef[] FACETS_BUILTIN_LIST = new XmlValueRef[]
+        { null, buildNnInteger(BigInteger.ONE), null, null, null, null, null, null, null,
+          build_wsstring(SchemaType.WS_COLLAPSE), null, null };
+
+    private final static boolean[] FIXED_FACETS_WS = new boolean[]
+        { false, false, false, false, false, false, false, false, false,
+          true, false, false };
+
+    private final static boolean[] FIXED_FACETS_INTEGER = new boolean[]
+        { false, false, false, false, false, false, false, false, true,
+          true, false, false };
+
+    final static XmlValueRef[] FACETS_UNION = FACETS_NONE;
+    final static boolean[] FIXED_FACETS_UNION = FIXED_FACETS_NONE;
+
+    final static XmlValueRef[] FACETS_LIST = FACETS_WS_COLLAPSE;
+    final static boolean[] FIXED_FACETS_LIST = FIXED_FACETS_WS;
+
+
+    /*
+     * LAST Static initializer
+     */
+    static {
+        for (int i = SchemaType.BTC_NOT_BUILTIN; i &lt;= SchemaType.BTC_LAST_BUILTIN; i++)
+        {
+            _global.fillInType(i);
+        }
+        for (int i = BTC_FIRST_XQUERY; i &lt;= BTC_LAST_XQUERY; i++)
+        {
+            _global.fillInType(i);
+        }
+    }
+
+    private Map _typeMap = new HashMap();
+    private SchemaTypeImpl[] _typeArray = new SchemaTypeImpl[SchemaType.BTC_LAST_BUILTIN
+ 1 + 
+                                                             BTC_LAST_XQUERY - BTC_FIRST_XQUERY
+ 1];
+    private Map _handlesToObjects = new HashMap();
+    private Map _objectsToHandles = new HashMap();
+    private Map _typesByClassname = new HashMap();
+    private SchemaContainer _container = new SchemaContainer("http://www.w3.org/2001/XMLSchema");
+
+    private SchemaTypeImpl getBuiltinType(int btc)
+    {
+        return _typeArray[arrayIndexForBtc(btc)];
+    }
+
+    private XQuerySchemaTypeSystem()
+    {
+        _container.setTypeSystem(this);
+        // UR types
+        setupType(SchemaType.BTC_ANY_TYPE, "anyType", "org.apache.xmlbeans.XmlObject");
+        setupType(SchemaType.BTC_ANY_SIMPLE, "anySimpleType", "org.apache.xmlbeans.XmlAnySimpleType");
+        setupType(BTC_ANY_ATOMIC, "anyAtomicType", null);
+
+        // primitives
+        setupType(SchemaType.BTC_BOOLEAN, "boolean", "org.apache.xmlbeans.XmlBoolean");
+        setupType(SchemaType.BTC_BASE_64_BINARY, "base64Binary", "org.apache.xmlbeans.XmlBase64Binary");
+        setupType(SchemaType.BTC_HEX_BINARY, "hexBinary", "org.apache.xmlbeans.XmlHexBinary");
+        setupType(SchemaType.BTC_ANY_URI, "anyURI", "org.apache.xmlbeans.XmlAnyURI");
+        setupType(SchemaType.BTC_QNAME, "QName", "org.apache.xmlbeans.XmlQName");
+        setupType(SchemaType.BTC_NOTATION, "NOTATION", "org.apache.xmlbeans.XmlNOTATION");
+        setupType(SchemaType.BTC_FLOAT, "float", "org.apache.xmlbeans.XmlFloat");
+        setupType(SchemaType.BTC_DOUBLE, "double", "org.apache.xmlbeans.XmlDouble");
+        setupType(SchemaType.BTC_DECIMAL, "decimal", "org.apache.xmlbeans.XmlDecimal");
+        setupType(SchemaType.BTC_STRING, "string", "org.apache.xmlbeans.XmlString");
+
+        setupType(SchemaType.BTC_DURATION, "duration", "org.apache.xmlbeans.XmlDuration");
+        setupType(SchemaType.BTC_DATE_TIME, "dateTime", "org.apache.xmlbeans.XmlDateTime");
+        setupType(SchemaType.BTC_TIME, "time", "org.apache.xmlbeans.XmlTime");
+        setupType(SchemaType.BTC_DATE, "date", "org.apache.xmlbeans.XmlDate");
+        setupType(SchemaType.BTC_G_YEAR_MONTH, "gYearMonth", "org.apache.xmlbeans.XmlGYearMonth");
+        setupType(SchemaType.BTC_G_YEAR, "gYear", "org.apache.xmlbeans.XmlGYear");
+        setupType(SchemaType.BTC_G_MONTH_DAY, "gMonthDay", "org.apache.xmlbeans.XmlGMonthDay");
+        setupType(SchemaType.BTC_G_DAY, "gDay", "org.apache.xmlbeans.XmlGDay");
+        setupType(SchemaType.BTC_G_MONTH, "gMonth", "org.apache.xmlbeans.XmlGMonth");
+
+        // derived numerics
+        setupType(SchemaType.BTC_INTEGER, "integer", "org.apache.xmlbeans.XmlInteger");
+        setupType(SchemaType.BTC_LONG, "long", "org.apache.xmlbeans.XmlLong");
+        setupType(SchemaType.BTC_INT, "int", "org.apache.xmlbeans.XmlInt");
+        setupType(SchemaType.BTC_SHORT, "short", "org.apache.xmlbeans.XmlShort");
+        setupType(SchemaType.BTC_BYTE, "byte", "org.apache.xmlbeans.XmlByte");
+        setupType(SchemaType.BTC_NON_POSITIVE_INTEGER, "nonPositiveInteger", "org.apache.xmlbeans.XmlNonPositiveInteger");
+        setupType(SchemaType.BTC_NEGATIVE_INTEGER, "negativeInteger", "org.apache.xmlbeans.XmlNegativeInteger");
+        setupType(SchemaType.BTC_NON_NEGATIVE_INTEGER, "nonNegativeInteger", "org.apache.xmlbeans.XmlNonNegativeInteger");
+        setupType(SchemaType.BTC_POSITIVE_INTEGER, "positiveInteger", "org.apache.xmlbeans.XmlPositiveInteger");
+        setupType(SchemaType.BTC_UNSIGNED_LONG, "unsignedLong", "org.apache.xmlbeans.XmlUnsignedLong");
+        setupType(SchemaType.BTC_UNSIGNED_INT, "unsignedInt", "org.apache.xmlbeans.XmlUnsignedInt");
+        setupType(SchemaType.BTC_UNSIGNED_SHORT, "unsignedShort", "org.apache.xmlbeans.XmlUnsignedShort");
+        setupType(SchemaType.BTC_UNSIGNED_BYTE, "unsignedByte", "org.apache.xmlbeans.XmlUnsignedByte");
+
+        // derived strings
+        setupType(SchemaType.BTC_NORMALIZED_STRING, "normalizedString", "org.apache.xmlbeans.XmlNormalizedString");
+        setupType(SchemaType.BTC_TOKEN, "token", "org.apache.xmlbeans.XmlToken");
+        setupType(SchemaType.BTC_NAME, "Name", "org.apache.xmlbeans.XmlName");
+        setupType(SchemaType.BTC_NCNAME, "NCName", "org.apache.xmlbeans.XmlNCName");
+        setupType(SchemaType.BTC_LANGUAGE, "language", "org.apache.xmlbeans.XmlLanguage");
+        setupType(SchemaType.BTC_ID, "ID", "org.apache.xmlbeans.XmlID");
+        setupType(SchemaType.BTC_IDREF, "IDREF", "org.apache.xmlbeans.XmlIDREF");
+        setupType(SchemaType.BTC_IDREFS, "IDREFS", "org.apache.xmlbeans.XmlIDREFS");
+        setupType(SchemaType.BTC_ENTITY, "ENTITY", "org.apache.xmlbeans.XmlENTITY");
+        setupType(SchemaType.BTC_ENTITIES, "ENTITIES", "org.apache.xmlbeans.XmlENTITIES");
+        setupType(SchemaType.BTC_NMTOKEN, "NMTOKEN", "org.apache.xmlbeans.XmlNMTOKEN");
+        setupType(SchemaType.BTC_NMTOKENS, "NMTOKENS", "org.apache.xmlbeans.XmlNMTOKENS");
+
+        // derived durations
+        setupType(BTC_DAY_TIME_DURATION, "dayTimeDuration", null);
+        setupType(BTC_YEAR_MONTH_DURATION, "yearMonthDuration", null);
+
+        // the no-type
+        setupType(SchemaType.BTC_NOT_BUILTIN, null, null);
+        _container.setImmutable();
+    }
+
+
+    /**
+     * Returns the name of this loader.
+     */
+    public String getName()
+    {
+        return "xquery.typesystem.builtin";
+    }
+
+    public boolean isNamespaceDefined(String namespace)
+    {
+        return namespace.equals("http://www.w3.org/2001/XMLSchema");
+    }
+
+    public SchemaType findType(QName name)
+    {
+        return (SchemaType)_typeMap.get(name);
+    }
+
+
+    public SchemaType findDocumentType(QName name)
+    {
+        return null;
+    }
+
+    public SchemaType findAttributeType(QName name)
+    {
+        return null;
+    }
+
+    public SchemaGlobalElement findElement(QName name)
+    {
+        return null;
+    }
+
+    public SchemaGlobalAttribute findAttribute(QName name)
+    {
+        return null;
+    }
+
+    public SchemaType.Ref findTypeRef(QName name)
+    {
+        SchemaType type = findType(name);
+        return (type == null ? null : type.getRef());
+    }
+
+    public SchemaType.Ref findDocumentTypeRef(QName name)
+    {
+        return null;
+    }
+
+    public SchemaType.Ref findAttributeTypeRef(QName name)
+    {
+        return null;
+    }
+
+    public SchemaGlobalElement.Ref findElementRef(QName name)
+    {
+        return null;
+    }
+
+    public SchemaGlobalAttribute.Ref findAttributeRef(QName name)
+    {
+        return null;
+    }
+
+    public SchemaModelGroup.Ref findModelGroupRef(QName name)
+    {
+        return null;
+    }
+
+    public SchemaAttributeGroup.Ref findAttributeGroupRef(QName name)
+    {
+        return null;
+    }
+
+    public SchemaIdentityConstraint.Ref findIdentityConstraintRef(QName name) 
+    {
+        return null;
+    }
+
+    public SchemaType typeForClassname(String classname)
+    {
+        return (SchemaType)_typesByClassname.get(classname);
+    }
+
+    public InputStream getSourceAsStream(String sourceName)
+    {
+        return null; // builtin schema type system has no source.
+    }
+
+    /**
+     * Returns the global types defined in this loader.
+     */
+    public SchemaType[] globalTypes()
+    {
+        SchemaType[] result = new SchemaType[_typeArray.length - 1];
+        System.arraycopy(_typeArray, 1, result, 0, result.length);
+        return result;
+    }
+
+    /**
+     * Returns the document types defined in this loader.
+     */
+    public SchemaType[] documentTypes()
+    {
+        return EMPTY_SCHEMATYPE_ARRAY;
+    }
+
+    /**
+     * Returns the attribute types defined in this loader.
+     */
+    public SchemaType[] attributeTypes()
+    {
+        return EMPTY_SCHEMATYPE_ARRAY;
+    }
+
+    /**
+     * Returns the global elements defined in this loader.
+     */
+    public SchemaGlobalElement[] globalElements()
+    {
+        return EMPTY_SCHEMAELEMENT_ARRAY;
+    }
+
+    /**
+     * Returns the global attributes defined in this loader.
+     */
+    public SchemaGlobalAttribute[] globalAttributes()
+    {
+        return EMPTY_SCHEMAATTRIBUTE_ARRAY;
+    }
+
+    /**
+     * Returns the model groups defined in this loader.
+     */
+    public SchemaModelGroup[] modelGroups()
+    {
+        return EMPTY_SCHEMAMODELGROUP_ARRAY;
+    }
+
+    /**
+     * Returns the attribute groups defined in this loader.
+     */
+    public SchemaAttributeGroup[] attributeGroups()
+    {
+        return EMPTY_SCHEMAATTRIBUTEGROUP_ARRAY;
+    }
+
+    /*
+     * Returns the top-level annotations.
+     */
+    public SchemaAnnotation[] annotations()
+    {
+        return EMPTY_SCHEMAANNOTATION_ARRAY;
+    }
+
+    /**
+     * Returns the handle for the given type within this loader.
+     */
+    public String handleForType(SchemaType type)
+    {
+        return (String)_objectsToHandles.get(type);
+    }
+
+    /**
+     * Returns the classloader used by this loader for resolving types.
+     */
+    public ClassLoader getClassLoader()
+    {
+        return BuiltinSchemaTypeSystem.class.getClassLoader();
+    }
+
+    /**
+     * Saves this type to a directory.
+     */
+    public void saveToDirectory(File classDir)
+    {
+        throw new UnsupportedOperationException("The builtin schema type system cannot be
saved.");
+    }
+
+    /**
+     * Saves this type system using a Filer
+     */
+    public void save(Filer filer)
+    {
+        throw new UnsupportedOperationException("The builtin schema type system cannot be
saved.");
+    }
+
+    private int arrayIndexForBtc(int btc)
+    {
+        return btc &gt; SchemaType.BTC_LAST_BUILTIN ?
+            btc - BTC_FIRST_XQUERY + SchemaType.BTC_LAST_BUILTIN + 1 : btc;
+    }
+
+    private static XmlValueRef build_wsstring(int wsr)
+    {
+        switch (wsr)
+        {
+            case SchemaType.WS_PRESERVE:
+                return XMLSTR_PRESERVE;
+            case SchemaType.WS_REPLACE:
+                return XMLSTR_REPLACE;
+            case SchemaType.WS_COLLAPSE:
+                return XMLSTR_COLLAPSE;
+        }
+        return null;
+    }
+
+    private static XmlValueRef buildNnInteger(BigInteger bigInt)
+    {
+        if (bigInt == null)
+            return null;
+        if (bigInt.signum() &lt; 0)
+            return null;
+        try
+        {
+            XmlIntegerImpl i = new XmlIntegerImpl();
+            i.setBigIntegerValue(bigInt);
+            i.setImmutable();
+            return new XmlValueRef(i);
+        }
+        catch (XmlValueOutOfRangeException e)
+        {
+            return null;
+        }
+    }
+
+    private static XmlValueRef buildInteger(BigInteger bigInt)
+    {
+        if (bigInt == null)
+            return null;
+        try
+        {
+            XmlIntegerImpl i = new XmlIntegerImpl();
+            i.setBigIntegerValue(bigInt);
+            i.setImmutable();
+            return new XmlValueRef(i);
+        }
+        catch (XmlValueOutOfRangeException e)
+        {
+            return null;
+        }
+    }
+
+    private static XmlValueRef buildString(String str)
+    {
+        if (str == null)
+            return null;
+
+        try
+        {
+            XmlStringImpl i = new XmlStringImpl();
+            i.setStringValue(str);
+            i.setImmutable();
+            return new XmlValueRef(i);
+        }
+        catch (XmlValueOutOfRangeException e)
+        {
+            return null;
+        }
+    }
+
+    private void setupType(int btc, String localname, String classname)
+    {
+        SchemaTypeImpl result = new SchemaTypeImpl(_container, true);
+        _container.addGlobalType(result.getRef());
+        QName name = localname == null ? null : QNameHelper.forLNS(localname, "http://www.w3.org/2001/XMLSchema");
+        String handle = "_BI_" + (localname == null ? "NO_TYPE" : localname);
+        result.setName(name);
+        result.setBuiltinTypeCode(btc);
+        if (classname != null)
+            result.setFullJavaName(classname);
+
+        _typeArray[arrayIndexForBtc(btc)] = result;
+        _typeMap.put(name, result);
+        _handlesToObjects.put(handle, result);
+        _objectsToHandles.put(result, handle);
+        if (classname != null)
+            _typesByClassname.put(classname, result);
+    }
+
+    public void resolve()
+    {
+        // we're born resolved and don't need to do anything.
+    }
+
+    public SchemaType typeForHandle(String handle)
+    {
+        return (SchemaType)_handlesToObjects.get(handle);
+    }
+
+    public SchemaComponent resolveHandle(String handle)
+    {
+        return (SchemaComponent)_handlesToObjects.get(handle);
+    }
+
+    /**
+     * Links a type.
+     */
+    public void fillInType(int btc)
+    {
+        SchemaTypeImpl result = getBuiltinType(btc);
+        SchemaType base;
+        SchemaType item = null;
+        int variety = SchemaType.ATOMIC;
+        int derivationType = SchemaType.DT_RESTRICTION;
+
+        switch (btc)
+        {
+            case SchemaType.BTC_NOT_BUILTIN:
+                variety = SchemaType.NOT_SIMPLE;
+                base = ST_ANY_TYPE;
+                break;
+
+            case SchemaType.BTC_ANY_TYPE:
+                variety = SchemaType.NOT_SIMPLE;
+                base = null;
+                derivationType = SchemaType.DT_RESTRICTION;
+                break;
+
+            default:
+                assert(false);
+
+            case SchemaType.BTC_ANY_SIMPLE:
+                base = ST_ANY_TYPE; break;
+
+            case BTC_ANY_ATOMIC:
+                base = ST_ANY_SIMPLE;
+
+            case SchemaType.BTC_BOOLEAN:
+            case SchemaType.BTC_BASE_64_BINARY:
+            case SchemaType.BTC_HEX_BINARY:
+            case SchemaType.BTC_ANY_URI:
+            case SchemaType.BTC_QNAME:
+            case SchemaType.BTC_NOTATION:
+            case SchemaType.BTC_FLOAT:
+            case SchemaType.BTC_DOUBLE:
+            case SchemaType.BTC_DECIMAL:
+            case SchemaType.BTC_STRING:
+            case SchemaType.BTC_DURATION:
+            case SchemaType.BTC_DATE_TIME:
+            case SchemaType.BTC_TIME:
+            case SchemaType.BTC_DATE:
+            case SchemaType.BTC_G_YEAR_MONTH:
+            case SchemaType.BTC_G_YEAR:
+            case SchemaType.BTC_G_MONTH_DAY:
+            case SchemaType.BTC_G_DAY:
+            case SchemaType.BTC_G_MONTH:
+                base = ST_ANY_ATOMIC; break;
+
+            // derived numerics
+            case SchemaType.BTC_INTEGER:
+                base = ST_DECIMAL; break;
+
+            case SchemaType.BTC_LONG:
+                base = ST_INTEGER; break;
+
+            case SchemaType.BTC_INT:
+                base = ST_LONG; break;
+
+            case SchemaType.BTC_SHORT:
+                base = ST_INT; break;
+
+            case SchemaType.BTC_BYTE:
+                base = ST_SHORT; break;
+
+            case SchemaType.BTC_NON_POSITIVE_INTEGER:
+                base = ST_INTEGER; break;
+
+            case SchemaType.BTC_NEGATIVE_INTEGER:
+                base = ST_NON_POSITIVE_INTEGER; break;
+
+            case SchemaType.BTC_NON_NEGATIVE_INTEGER:
+                base = ST_INTEGER; break;
+
+            case SchemaType.BTC_POSITIVE_INTEGER:
+                base = ST_NON_NEGATIVE_INTEGER; break;
+
+            case SchemaType.BTC_UNSIGNED_LONG:
+                base = ST_NON_NEGATIVE_INTEGER; break;
+
+            case SchemaType.BTC_UNSIGNED_INT:
+                base = ST_UNSIGNED_LONG; break;
+
+            case SchemaType.BTC_UNSIGNED_SHORT:
+                base = ST_UNSIGNED_INT; break;
+
+            case SchemaType.BTC_UNSIGNED_BYTE:
+                base = ST_UNSIGNED_SHORT; break;
+
+            // derived strings
+            case SchemaType.BTC_NORMALIZED_STRING:
+                base = ST_STRING; break;
+
+            case SchemaType.BTC_TOKEN:
+                base = ST_NORMALIZED_STRING; break;
+
+            case SchemaType.BTC_NAME:
+                base = ST_TOKEN; break;
+
+            case SchemaType.BTC_NCNAME:
+                base = ST_NAME; break;
+
+            case SchemaType.BTC_ID:
+            case SchemaType.BTC_IDREF:
+            case SchemaType.BTC_ENTITY:
+                base = ST_NCNAME; break;
+
+            case SchemaType.BTC_LANGUAGE:
+            case SchemaType.BTC_NMTOKEN:
+                base = ST_TOKEN; break;
+
+            case SchemaType.BTC_IDREFS:
+            case SchemaType.BTC_ENTITIES:
+            case SchemaType.BTC_NMTOKENS:
+                variety = SchemaType.LIST;
+                base = ST_ANY_SIMPLE;
+                if (btc == SchemaType.BTC_IDREFS)
+                    item = ST_IDREF;
+                else if (btc == SchemaType.BTC_ENTITIES)
+                    item = ST_ENTITY;
+                else
+                    item = ST_NMTOKEN;
+                break;
+
+            // derived durations
+            case BTC_DAY_TIME_DURATION:
+            case BTC_YEAR_MONTH_DURATION:
+                base = ST_DURATION;
+                break;
+
+        }
+
+        result.setDerivationType(derivationType);
+        result.setSimpleTypeVariety(variety);
+        if (variety != SchemaType.NOT_SIMPLE)
+        {
+            result.setSimpleType(true);
+        }
+        else
+        {
+            assert (btc == SchemaType.BTC_ANY_TYPE || btc == SchemaType.BTC_NOT_BUILTIN);
+        }
+        result.setBaseTypeRef(base == null ? null : base.getRef());
+        result.setBaseDepth(base == null ? 0 : ((SchemaTypeImpl)base).getBaseDepth() + 1);
+        result.setListItemTypeRef(item == null ? null : item.getRef());
+        if (btc &gt;= SchemaType.BTC_FIRST_PRIMITIVE &amp;&amp; btc &lt;= SchemaType.BTC_LAST_PRIMITIVE
||
+                btc == BTC_ANY_ATOMIC)
+            result.setPrimitiveTypeRef(result.getRef());
+        else if (variety == SchemaType.ATOMIC)
+        {
+            if (base == null)
+                throw new IllegalStateException("Base was null for " + btc);
+            if (base.getPrimitiveType() == null)
+                throw new IllegalStateException("Base.gpt was null for " + btc);
+            result.setPrimitiveTypeRef(base.getPrimitiveType().getRef());
+        }
+
+        XmlValueRef[] facets;
+        boolean[] fixedf;
+        int wsr = SchemaType.WS_COLLAPSE;
+        int decimalSize = SchemaType.NOT_DECIMAL;
+
+        // now set up facets
+        switch (btc)
+        {
+            default:
+                assert(false);
+
+            case SchemaType.BTC_ANY_TYPE:
+            case SchemaType.BTC_ANY_SIMPLE:
+            case SchemaType.BTC_NOT_BUILTIN:
+            case BTC_ANY_ATOMIC:
+                facets = FACETS_NONE;
+                fixedf = FIXED_FACETS_NONE;
+                wsr = SchemaType.WS_UNSPECIFIED;
+                break;
+
+            case SchemaType.BTC_STRING:
+                facets = FACETS_WS_PRESERVE;
+                fixedf = FIXED_FACETS_NONE;
+                wsr = SchemaType.WS_PRESERVE;
+                break;
+
+            case SchemaType.BTC_BOOLEAN:
+            case SchemaType.BTC_BASE_64_BINARY:
+            case SchemaType.BTC_HEX_BINARY:
+            case SchemaType.BTC_ANY_URI:
+            case SchemaType.BTC_QNAME:
+            case SchemaType.BTC_FLOAT:
+            case SchemaType.BTC_DOUBLE:
+            case SchemaType.BTC_NOTATION:
+            case SchemaType.BTC_DURATION:
+            case SchemaType.BTC_DATE_TIME:
+            case SchemaType.BTC_TIME:
+            case SchemaType.BTC_DATE:
+            case SchemaType.BTC_G_YEAR_MONTH:
+            case SchemaType.BTC_G_YEAR:
+            case SchemaType.BTC_G_MONTH_DAY:
+            case SchemaType.BTC_G_DAY:
+            case SchemaType.BTC_G_MONTH:
+                facets = FACETS_WS_COLLAPSE;
+                fixedf = FIXED_FACETS_WS;
+                break;
+
+            case SchemaType.BTC_DECIMAL:
+                facets = FACETS_WS_COLLAPSE;
+                fixedf = FIXED_FACETS_WS;
+                decimalSize = SchemaType.SIZE_BIG_DECIMAL;
+                break;
+
+            // derived numerics
+            case SchemaType.BTC_INTEGER:
+                facets = FACETS_INTEGER;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_BIG_INTEGER;
+                break;
+
+            case SchemaType.BTC_LONG:
+                facets = FACETS_LONG;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_LONG;
+                break;
+
+            case SchemaType.BTC_INT:
+                facets = FACETS_INT;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_INT;
+                break;
+
+            case SchemaType.BTC_SHORT:
+                facets = FACETS_SHORT;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_SHORT;
+                break;
+
+            case SchemaType.BTC_BYTE:
+                facets = FACETS_BYTE;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_BYTE;
+                break;
+
+            case SchemaType.BTC_NON_POSITIVE_INTEGER:
+                facets = FACETS_NONPOSITIVE;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_BIG_INTEGER;
+                break;
+
+            case SchemaType.BTC_NEGATIVE_INTEGER:
+                facets = FACETS_NEGATIVE;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_BIG_INTEGER;
+                break;
+
+            case SchemaType.BTC_NON_NEGATIVE_INTEGER:
+                facets = FACETS_NONNEGATIVE;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_BIG_INTEGER;
+                break;
+
+            case SchemaType.BTC_POSITIVE_INTEGER:
+                facets = FACETS_POSITIVE;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_BIG_INTEGER;
+                break;
+
+            case SchemaType.BTC_UNSIGNED_LONG:
+                facets = FACETS_UNSIGNED_LONG;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_BIG_INTEGER;
+                break;
+
+            case SchemaType.BTC_UNSIGNED_INT:
+                facets = FACETS_UNSIGNED_INT;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_LONG;
+                break;
+
+            case SchemaType.BTC_UNSIGNED_SHORT:
+                facets = FACETS_UNSIGNED_SHORT;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_INT;
+                break;
+
+            case SchemaType.BTC_UNSIGNED_BYTE:
+                facets = FACETS_UNSIGNED_BYTE;
+                fixedf = FIXED_FACETS_INTEGER;
+                decimalSize = SchemaType.SIZE_SHORT;
+                break;
+
+
+            // derived strings
+            case SchemaType.BTC_NORMALIZED_STRING:
+                facets = FACETS_WS_REPLACE;
+                fixedf = FIXED_FACETS_NONE;
+                wsr = SchemaType.WS_REPLACE;
+                break;
+
+            case SchemaType.BTC_TOKEN:
+            case SchemaType.BTC_NAME:
+            case SchemaType.BTC_NCNAME:
+            case SchemaType.BTC_LANGUAGE:
+            case SchemaType.BTC_ID:
+            case SchemaType.BTC_IDREF:
+            case SchemaType.BTC_IDREFS:
+            case SchemaType.BTC_ENTITY:
+            case SchemaType.BTC_NMTOKEN:
+                facets = FACETS_WS_COLLAPSE;
+                fixedf = FIXED_FACETS_NONE;
+                wsr = SchemaType.WS_COLLAPSE;
+                break;
+
+            case SchemaType.BTC_ENTITIES:
+            case SchemaType.BTC_NMTOKENS:
+                facets = FACETS_BUILTIN_LIST;
+                fixedf = FIXED_FACETS_NONE;
+                wsr = SchemaType.WS_UNSPECIFIED;
+                break;
+
+            case BTC_DAY_TIME_DURATION:
+            case BTC_YEAR_MONTH_DURATION:
+                facets = FACETS_WS_COLLAPSE;
+                fixedf = FIXED_FACETS_WS;
+                wsr = SchemaType.WS_COLLAPSE;
+                break;
+                
+        }
+
+        // fundamental facets
+        int ordered = SchemaType.UNORDERED;
+        boolean isNumeric = false;
+        boolean isFinite = false;
+        boolean isBounded = false;
+
+        switch (btc)
+        {
+            default:
+                assert(false);
+
+            case SchemaType.BTC_ANY_TYPE:
+            case SchemaType.BTC_NOT_BUILTIN:
+            case SchemaType.BTC_ANY_SIMPLE:
+            case BTC_ANY_ATOMIC:
+            case SchemaType.BTC_STRING:
+            case SchemaType.BTC_BASE_64_BINARY:
+            case SchemaType.BTC_HEX_BINARY:
+            case SchemaType.BTC_ANY_URI:
+            case SchemaType.BTC_QNAME:
+            case SchemaType.BTC_NOTATION:
+            case SchemaType.BTC_NORMALIZED_STRING:
+            case SchemaType.BTC_TOKEN:
+            case SchemaType.BTC_NAME:
+            case SchemaType.BTC_NCNAME:
+            case SchemaType.BTC_LANGUAGE:
+            case SchemaType.BTC_ID:
+            case SchemaType.BTC_IDREF:
+            case SchemaType.BTC_IDREFS:
+            case SchemaType.BTC_ENTITY:
+            case SchemaType.BTC_NMTOKEN:
+            case SchemaType.BTC_ENTITIES:
+            case SchemaType.BTC_NMTOKENS:
+                break;
+
+            case SchemaType.BTC_BOOLEAN:
+                isFinite = true;
+                break;
+
+
+            case SchemaType.BTC_FLOAT:
+            case SchemaType.BTC_DOUBLE:
+            case SchemaType.BTC_DECIMAL:
+            case SchemaType.BTC_INTEGER:
+                isNumeric = true;
+                ordered = SchemaType.TOTAL_ORDER;
+                break;
+
+            case SchemaType.BTC_DURATION:
+            case SchemaType.BTC_DATE_TIME:
+            case SchemaType.BTC_TIME:
+            case SchemaType.BTC_DATE:
+            case SchemaType.BTC_G_YEAR_MONTH:
+            case SchemaType.BTC_G_YEAR:
+            case SchemaType.BTC_G_MONTH_DAY:
+            case SchemaType.BTC_G_DAY:
+            case SchemaType.BTC_G_MONTH:
+            case BTC_DAY_TIME_DURATION:
+            case BTC_YEAR_MONTH_DURATION:
+                ordered = SchemaType.PARTIAL_ORDER;
+                break;
+
+            case SchemaType.BTC_LONG:
+            case SchemaType.BTC_INT:
+            case SchemaType.BTC_SHORT:
+            case SchemaType.BTC_BYTE:
+            case SchemaType.BTC_NON_POSITIVE_INTEGER:
+            case SchemaType.BTC_NEGATIVE_INTEGER:
+            case SchemaType.BTC_NON_NEGATIVE_INTEGER:
+            case SchemaType.BTC_POSITIVE_INTEGER:
+            case SchemaType.BTC_UNSIGNED_LONG:
+            case SchemaType.BTC_UNSIGNED_INT:
+            case SchemaType.BTC_UNSIGNED_SHORT:
+            case SchemaType.BTC_UNSIGNED_BYTE:
+                isNumeric = true;
+                ordered = SchemaType.TOTAL_ORDER;
+                isFinite = true;
+                isBounded = true;
+                break;
+        }
+
+        result.setBasicFacets(facets, fixedf);
+        result.setWhiteSpaceRule(wsr);
+        result.setOrdered(ordered);
+        result.setBounded(isBounded);
+        result.setNumeric(isNumeric);
+        result.setFinite(isFinite);
+        result.setDecimalSize(decimalSize);
+        result.setAnonymousTypeRefs(EMPTY_SCHEMATYPEREF_ARRAY);
+
+        String pattern = null;
+        boolean hasPattern = false;
+
+        switch (btc)
+        {
+            case SchemaType.BTC_LANGUAGE:
+                pattern = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"; // we used to have ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*",
but s4s uses the more lenient pattern to the left. 
+                hasPattern = true;
+                break;
+            case SchemaType.BTC_NMTOKEN:
+                pattern = "\\c+"; 
+                hasPattern = true;
+                break;
+            case SchemaType.BTC_NAME:
+                pattern = "\\i\\c*";
+                hasPattern = true;
+                break;
+            case SchemaType.BTC_NCNAME:
+                pattern = "[\\i-[:]][\\c-[:]]*";
+                hasPattern = true;
+                break;
+            case BTC_DAY_TIME_DURATION:
+                pattern = "[^YM]*(DT.*)?";
+                hasPattern = true;
+                break;
+            case BTC_YEAR_MONTH_DURATION:
+                pattern = "[^DT]*";
+                hasPattern = true;
+                break;
+
+            // These types inherit their patterns
+            case SchemaType.BTC_ID:
+            case SchemaType.BTC_IDREF:
+            case SchemaType.BTC_ENTITY:
+                hasPattern = true;
+                break;
+        }
+
+        if (pattern != null)
+        {
+            org.apache.xmlbeans.impl.regex.RegularExpression p = null;
+            try { p = org.apache.xmlbeans.impl.regex.SchemaRegularExpression.forPattern(pattern);
}
+            catch (org.apache.xmlbeans.impl.regex.ParseException e) { assert false; }
+            result.setPatterns(new org.apache.xmlbeans.impl.regex.RegularExpression[] {p});
+        }
+        result.setPatternFacet(hasPattern);
+
+
+
+        // ANY_TYPE has to be able to act like a complex type
+        if (btc == SchemaType.BTC_ANY_TYPE)
+        {
+            SchemaParticleImpl contentModel = new SchemaParticleImpl();
+            contentModel.setParticleType(SchemaParticle.WILDCARD);
+            contentModel.setWildcardSet(QNameSet.ALL);
+            contentModel.setWildcardProcess(SchemaParticle.LAX);
+            contentModel.setMinOccurs(BigInteger.ZERO);
+            contentModel.setMaxOccurs(null);
+            contentModel.setTransitionRules(QNameSet.ALL, true);
+            contentModel.setTransitionNotes(QNameSet.ALL, true);
+
+            SchemaAttributeModelImpl attrModel = new SchemaAttributeModelImpl();
+            attrModel.setWildcardProcess(SchemaAttributeModel.LAX);
+            attrModel.setWildcardSet(QNameSet.ALL);
+
+            result.setComplexTypeVariety(SchemaType.MIXED_CONTENT);
+            result.setContentModel(contentModel, attrModel, Collections.EMPTY_MAP, Collections.EMPTY_MAP,
false);
+            result.setAnonymousTypeRefs(EMPTY_SCHEMATYPEREF_ARRAY);
+            result.setWildcardSummary(QNameSet.ALL, true, QNameSet.ALL, true);
+        }
+        else if (btc == SchemaType.BTC_NOT_BUILTIN)
+        {
+            // so does the no_type : it permits no contents (and even empty contents is invalid,
but that's special-cased)
+            SchemaParticleImpl contentModel = null; // empty
+            SchemaAttributeModelImpl attrModel = new SchemaAttributeModelImpl(); // empty
+            result.setComplexTypeVariety(SchemaType.EMPTY_CONTENT);
+            result.setContentModel(contentModel, attrModel, Collections.EMPTY_MAP, Collections.EMPTY_MAP,
false);
+            result.setAnonymousTypeRefs(EMPTY_SCHEMATYPEREF_ARRAY);
+            result.setWildcardSummary(QNameSet.EMPTY, false, QNameSet.EMPTY, false);
+        }
+
+        result.setOrderSensitive(false);
+    }
+
+    public static SchemaType getNoType()
+    {
+        return ST_NO_TYPE;
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r773699 [2/2] - in /xmlbeans/trunk: src/tools/org/apache/xmlbeans/impl/inst2xsd/util/ src/xmlpublic/org/apache/xmlbeans/ test/cases/xbean/tools/inst2xsd/schema/ test/cases/xbean/tools/inst2xsd/schema/examples/ test/cases/xbean/tools/inst2xs...</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200905.mbox/%3c20090511212218.0453E2388CDF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090511212218-0453E2388CDF@eris-apache-org%3e</id>
<updated>2009-05-11T21:22:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd3.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd3.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd3.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd3.xsd
Mon May 11 21:22:13 2009
@@ -1,5 +1,16 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="e" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="a"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
+        &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
+        &lt;xs:element type="xs:string" name="a" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+        &lt;xs:element ref="a:d" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
+        &lt;xs:element ref="b:e" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
+        &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
+        &lt;xs:element type="xs:string" name="e" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss0.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss0.xsd
Mon May 11 21:22:13 2009
@@ -1,5 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/a"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="b" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss1.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss1.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss1.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss1.xsd
Mon May 11 21:22:13 2009
@@ -1,4 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="e" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss3.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss3.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss3.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss3.xsd
Mon May 11 21:22:13 2009
@@ -1,5 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="e" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb0.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb0.xsd
Mon May 11 21:22:13 2009
@@ -1,5 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/a"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="b" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb1.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb1.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb1.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb1.xsd
Mon May 11 21:22:13 2009
@@ -1,4 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="e" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb2.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb2.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb2.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb2.xsd
Mon May 11 21:22:13 2009
@@ -1,15 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="a" type="ins:aType" xmlns:ins="http://xmlbeans.apache.org/inst2xsd"/&gt;
-  &lt;xs:complexType name="aType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
-      &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
-      &lt;xs:element type="xs:string" name="a" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element ref="a:d" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
-      &lt;xs:element ref="b:e" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
-      &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
-      &lt;xs:element type="xs:string" name="e" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb3.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb3.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb3.xsd
(original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb3.xsd
Mon May 11 21:22:13 2009
@@ -1,5 +1,15 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="e" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="a" type="ins:aType" xmlns:ins="http://xmlbeans.apache.org/inst2xsd"/&gt;
+  &lt;xs:complexType name="aType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
+      &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
+      &lt;xs:element type="xs:string" name="a" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element ref="a:d" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
+      &lt;xs:element ref="b:e" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
+      &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
+      &lt;xs:element type="xs:string" name="e" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/simple_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/simple_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/simple_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/simple_ss0.xsd Mon May
11 21:22:13 2009
@@ -1,8 +1,9 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="b" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="e" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="a"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
@@ -13,5 +14,4 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="e" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/simpleName_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/simpleName_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/simpleName_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/simpleName_ss0.xsd Mon May 11 21:22:13
2009
@@ -1,7 +1,7 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="last" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="first" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="last" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="name"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;

Modified: xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java (original)
+++ xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java Mon May 11 21:22:13
2009
@@ -333,6 +333,4 @@
         runSchemaBuild(inst, common.getSalamiOptions(),
                 XmlObject.Factory.parse(new File(SCHEMA_CASES_DIR + "examples" + P + "sampleRss091_ss0.xsd")));
     }
-
-
 }

Modified: xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java (original)
+++ xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java Mon May 11 21:22:13
2009
@@ -143,7 +143,8 @@
                 "1996-13-28T00:00:00Z", // month
                 "1996-02-00T00:00:00Z", // day
                 "2000-02-30T00:00:00Z", // day
-                "1996-02-29T24:00:00Z", // hr
+                "1996-02-29T25:00:00Z", // hr
+                "1996-02-29T24:00:01Z", // hr
                 "1996-02-29T00:60:00Z", // min
                 "1996-02-29T00:00:60Z", // sec
                 "1996-02-29T00:00:00+14:01", // tz
@@ -164,7 +165,8 @@
                 "--11-31", // day
                 "---00", // day
                 "---32", // day
-                "24:00:00Z", // hr
+                "25:00:00Z", // hr
+                "24:01:00Z", // hr
                 "00:60:00Z", // min
                 "00:00:60Z", // sec
                 "00:00:00+14:01", // tz
@@ -251,6 +253,9 @@
                 "-0004--31T00:00:00+01:30",
                 "2002-04-18T23:59:59Z",
                 "-0423-12-31T00:00:00-05:00",
+                "1996-02-29T24:00:00Z", // 24:00:00 is valid
+                "24:00:00Z",            // 24:00:00 is valid
+
             };
 
     private boolean hasTime(GDuration gd)
@@ -571,8 +576,13 @@
                 Assert.fail("Problem with " + str + ": " + e.getMessage());
             }
 
-            // must round-trip to string
-            Assert.assertEquals(str, gdate.toString());
+            if ( str.contains("24:00:00") &amp;&amp; gdate.hasDay() )   // for 24h if hasDay
must be normalized, else has the same representation
+            {
+                Assert.assertTrue(str + " " + gdate.toString(), gdate.hasDay() &amp;&amp;
gdate.toString().contains("00:00:00"));
+            }
+            else
+                // must round-trip to string
+                Assert.assertEquals(str, gdate.toString());
 
             // must round-trip to GregorianCalendar if fractions-of-seconds &lt;=3 digits
             if (gdate.getFraction() == null || gdate.getFraction().scale() &lt;= 3)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r773699 [1/2] - in /xmlbeans/trunk: src/tools/org/apache/xmlbeans/impl/inst2xsd/util/ src/xmlpublic/org/apache/xmlbeans/ test/cases/xbean/tools/inst2xsd/schema/ test/cases/xbean/tools/inst2xsd/schema/examples/ test/cases/xbean/tools/inst2xs...</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200905.mbox/%3c20090511212217.EEAFC2388ACC@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090511212217-EEAFC2388ACC@eris-apache-org%3e</id>
<updated>2009-05-11T21:22:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Mon May 11 21:22:13 2009
New Revision: 773699

URL: http://svn.apache.org/viewvc?rev=773699&amp;view=rev
Log:
Fix checkintests to pass under jdk 1.6.
Fix time and dateTime types to allow hour 24:00, as per latest XMLSchema spec.

checkintest passes both under jdk 1.5 and jdk 1.6.


Modified:
    xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/inst2xsd/util/TypeSystemHolder.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cd_catalog_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cdcatalog_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_4enum_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_neverenum_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_4enum_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_neverenum_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_neverenum_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_neverenum_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd1.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd2.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd3.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss1.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss2.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss3.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb1.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb2.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb3.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd1.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd2.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd3.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss1.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_ss3.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb1.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb2.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_vb3.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/simple_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/simpleName_ss0.xsd
    xmlbeans/trunk/test/src/tools/inst2xsd/checkin/Inst2XsdCheckinTest.java
    xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java

Modified: xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/inst2xsd/util/TypeSystemHolder.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/inst2xsd/util/TypeSystemHolder.java?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/inst2xsd/util/TypeSystemHolder.java (original)
+++ xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/inst2xsd/util/TypeSystemHolder.java Mon May 11 21:22:13 2009
@@ -22,9 +22,10 @@
 import javax.xml.namespace.QName;
 import java.math.BigInteger;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.LinkedHashMap;
+import java.util.HashMap;
 
 /**
  * @author Cezar Andrei (cezar.andrei at bea.com) Date: Jul 16, 2004
@@ -37,9 +38,9 @@
 
     public TypeSystemHolder()
     {
-        _globalElements = new HashMap();
-        _globalAttributes = new HashMap();
-        _globalTypes = new HashMap();
+        _globalElements = new LinkedHashMap();
+        _globalAttributes = new LinkedHashMap();
+        _globalTypes = new LinkedHashMap();
     }
 
     public void addGlobalElement(Element element)
@@ -96,7 +97,7 @@
     public SchemaDocument[] getSchemaDocuments()
     {
         // recompute everything, should cache it and track changes
-        Map nsToSchemaDocs = new HashMap();
+        Map nsToSchemaDocs = new LinkedHashMap();
 
         for (Iterator iterator = _globalElements.keySet().iterator(); iterator.hasNext();)
         {

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java Mon May 11 21:22:13 2009
@@ -223,7 +223,7 @@
                 throw new IllegalArgumentException();
 
             int h = twoDigit(string, start);
-            if (h &gt;= 24)
+            if (h &gt; 24)
                 throw new IllegalArgumentException("hour must be between 00 and 23");
             int m = twoDigit(string, start + 3);
             if (m &gt;= 60)
@@ -264,6 +264,31 @@
             _fs = fs;
         }
 
+        if ( hasTime() &amp;&amp; _h == 24 )
+        {
+            if ( _m != 0 || _s != 0 || _fs.compareTo(_zero) != 0 )
+                throw new IllegalArgumentException("if hour is 24 minutes, seconds and fraction must be 0");
+            else
+            {   // normalize to next day if it has date or at least has day
+                if ( hasDate() )
+                {
+                    GDateBuilder gdb = new GDateBuilder(_CY, _M, _D, _h, _m, _s, _fs, _tzsign, _tzh, _tzm);
+                    gdb.normalize();
+                    gdb.normalizeToTimeZone(_tzsign, _tzh, _tzm);
+
+                    _D = gdb.getDay();
+                    _M = gdb.getMonth();
+                    _CY = gdb.getYear();
+                    _h = 0;
+                }
+                else if ( hasDay() ) // if no date only days increment
+                {
+                    _D++;
+                    _h = 0;
+                }
+            }
+        }
+        
         if (!isValid())
             throw new IllegalArgumentException("invalid date");
     }

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDateBuilder.java Mon May 11 21:22:13 2009
@@ -561,10 +561,13 @@
               date.getDay() &gt; _maxDayInMonth(date.getMonth()))))
             return false;
 
-        if (date.hasTime() &amp;&amp; (date.getHour() &lt; 0 || date.getHour() &gt; 23 ||
+        if (date.hasTime() &amp;&amp; ((date.getHour() &lt; 0 || date.getHour() &gt; 23 ||
             date.getMinute() &lt; 0 || date.getMinute() &gt; 59 ||
             date.getSecond() &lt; 0 || date.getSecond() &gt; 59 ||
-            date.getFraction().signum() &lt; 0 || date.getFraction().compareTo(GDate._one) &gt;= 0))
+            date.getFraction().signum() &lt; 0 || date.getFraction().compareTo(GDate._one) &gt;= 0)  ) &amp;&amp;
+            // check for 24:00:00 valid format
+            !(date.getHour() == 24 &amp;&amp; date.getMinute() == 0 &amp;&amp; date.getSecond() == 0 &amp;&amp;
+              date.getFraction().compareTo(GDate._zero) == 0 ) )
             return false;
 
         if (date.hasTimeZone() &amp;&amp;

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cd_catalog_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cd_catalog_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cd_catalog_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cd_catalog_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,17 +1,7 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="YEAR" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="TITLE" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="CATALOG"&gt;
-    &lt;xs:annotation&gt;
-      &lt;xs:documentation&gt;Edited with XML Spy v4.2&lt;/xs:documentation&gt;
-    &lt;/xs:annotation&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="CD" maxOccurs="unbounded" minOccurs="0"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
+  &lt;xs:element name="ARTIST" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="COUNTRY"&gt;
     &lt;xs:simpleType&gt;
       &lt;xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -22,7 +12,9 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="ARTIST" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="COMPANY" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="PRICE" type="xs:float" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="YEAR" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="CD"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
@@ -35,6 +27,14 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="PRICE" type="xs:float" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="COMPANY" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="CATALOG"&gt;
+    &lt;xs:annotation&gt;
+      &lt;xs:documentation&gt;Edited with XML Spy v4.2&lt;/xs:documentation&gt;
+    &lt;/xs:annotation&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="CD" maxOccurs="unbounded" minOccurs="0"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cdcatalog_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cdcatalog_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cdcatalog_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/cdcatalog_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,16 +1,11 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="YEAR" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="TITLE" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="CATALOG"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="CD" maxOccurs="unbounded" minOccurs="0"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="COUNTRY" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="ARTIST" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="COUNTRY" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="COMPANY" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="PRICE" type="xs:float" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="YEAR" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="CD"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
@@ -23,6 +18,11 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="PRICE" type="xs:float" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="COMPANY" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="CATALOG"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="CD" maxOccurs="unbounded" minOccurs="0"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,11 +1,14 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="component"&gt;
+  &lt;xs:element name="attach"&gt;
     &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="attach" maxOccurs="unbounded" minOccurs="0"/&gt;
-        &lt;xs:element ref="script"/&gt;
-      &lt;/xs:sequence&gt;
+      &lt;xs:simpleContent&gt;
+        &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+          &lt;xs:attribute type="xs:string" name="for" use="optional"/&gt;
+          &lt;xs:attribute type="xs:string" name="event" use="optional"/&gt;
+          &lt;xs:attribute type="xs:string" name="handler" use="optional"/&gt;
+        &lt;/xs:extension&gt;
+      &lt;/xs:simpleContent&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
   &lt;xs:element name="script"&gt;
@@ -17,15 +20,12 @@
       &lt;/xs:simpleContent&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="attach"&gt;
+  &lt;xs:element name="component"&gt;
     &lt;xs:complexType&gt;
-      &lt;xs:simpleContent&gt;
-        &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-          &lt;xs:attribute type="xs:string" name="for" use="optional"/&gt;
-          &lt;xs:attribute type="xs:string" name="event" use="optional"/&gt;
-          &lt;xs:attribute type="xs:string" name="handler" use="optional"/&gt;
-        &lt;/xs:extension&gt;
-      &lt;/xs:simpleContent&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="attach" maxOccurs="unbounded" minOccurs="0"/&gt;
+        &lt;xs:element ref="script"/&gt;
+      &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/component_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,12 +1,6 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="component" type="componentType"/&gt;
-  &lt;xs:complexType name="componentType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="attachType" name="attach" maxOccurs="unbounded" minOccurs="0"/&gt;
-      &lt;xs:element type="scriptType" name="script"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
   &lt;xs:complexType name="attachType"&gt;
     &lt;xs:simpleContent&gt;
       &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -23,4 +17,10 @@
       &lt;/xs:extension&gt;
     &lt;/xs:simpleContent&gt;
   &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="componentType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="attachType" name="attach" maxOccurs="unbounded" minOccurs="0"/&gt;
+      &lt;xs:element type="scriptType" name="script"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,12 +1,12 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="table"&gt;
+  &lt;xs:element name="span"&gt;
     &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="tr"/&gt;
-      &lt;/xs:sequence&gt;
-      &lt;xs:attribute type="xs:byte" name="border" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:attribute type="xs:string" name="datasrc" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:simpleContent&gt;
+        &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+          &lt;xs:attribute type="xs:string" name="datafld" use="optional"/&gt;
+        &lt;/xs:extension&gt;
+      &lt;/xs:simpleContent&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
   &lt;xs:element name="td"&gt;
@@ -16,10 +16,10 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="html"&gt;
+  &lt;xs:element name="tr"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
-        &lt;xs:element ref="body"/&gt;
+        &lt;xs:element ref="td" maxOccurs="unbounded" minOccurs="0"/&gt;
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
@@ -33,11 +33,13 @@
       &lt;/xs:simpleContent&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="tr"&gt;
+  &lt;xs:element name="table"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
-        &lt;xs:element ref="td" maxOccurs="unbounded" minOccurs="0"/&gt;
+        &lt;xs:element ref="tr"/&gt;
       &lt;/xs:sequence&gt;
+      &lt;xs:attribute type="xs:byte" name="border" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:attribute type="xs:string" name="datasrc" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
   &lt;xs:element name="body"&gt;
@@ -48,13 +50,11 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="span"&gt;
+  &lt;xs:element name="html"&gt;
     &lt;xs:complexType&gt;
-      &lt;xs:simpleContent&gt;
-        &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-          &lt;xs:attribute type="xs:string" name="datafld" use="optional"/&gt;
-        &lt;/xs:extension&gt;
-      &lt;/xs:simpleContent&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="body"/&gt;
+      &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/html_example_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,9 +1,24 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="html" type="htmlType"/&gt;
-  &lt;xs:complexType name="htmlType"&gt;
+  &lt;xs:complexType name="xmlType"&gt;
+    &lt;xs:simpleContent&gt;
+      &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+        &lt;xs:attribute type="xs:string" name="id"/&gt;
+        &lt;xs:attribute type="xs:string" name="src"/&gt;
+      &lt;/xs:extension&gt;
+    &lt;/xs:simpleContent&gt;
+  &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="spanType"&gt;
+    &lt;xs:simpleContent&gt;
+      &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+        &lt;xs:attribute type="xs:string" name="datafld" use="optional"/&gt;
+      &lt;/xs:extension&gt;
+    &lt;/xs:simpleContent&gt;
+  &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="tdType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="bodyType" name="body"/&gt;
+      &lt;xs:element type="spanType" name="span"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name="trType"&gt;
@@ -11,37 +26,22 @@
       &lt;xs:element type="tdType" name="td" maxOccurs="unbounded" minOccurs="0"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="bodyType"&gt;
+  &lt;xs:complexType name="tableType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="xmlType" name="xml"/&gt;
-      &lt;xs:element type="tableType" name="table"/&gt;
+      &lt;xs:element type="trType" name="tr"/&gt;
     &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:byte" name="border" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+    &lt;xs:attribute type="xs:string" name="datasrc" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="tdType"&gt;
+  &lt;xs:complexType name="bodyType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="spanType" name="span"/&gt;
+      &lt;xs:element type="xmlType" name="xml"/&gt;
+      &lt;xs:element type="tableType" name="table"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="spanType"&gt;
-    &lt;xs:simpleContent&gt;
-      &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-        &lt;xs:attribute type="xs:string" name="datafld" use="optional"/&gt;
-      &lt;/xs:extension&gt;
-    &lt;/xs:simpleContent&gt;
-  &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="tableType"&gt;
+  &lt;xs:complexType name="htmlType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="trType" name="tr"/&gt;
+      &lt;xs:element type="bodyType" name="body"/&gt;
     &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:byte" name="border" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-    &lt;xs:attribute type="xs:string" name="datasrc" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="xmlType"&gt;
-    &lt;xs:simpleContent&gt;
-      &lt;xs:extension base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-        &lt;xs:attribute type="xs:string" name="id"/&gt;
-        &lt;xs:attribute type="xs:string" name="src"/&gt;
-      &lt;/xs:extension&gt;
-    &lt;/xs:simpleContent&gt;
   &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_4enum_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_4enum_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_4enum_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_4enum_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,27 +1,6 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
-    &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="channelType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
   &lt;xs:complexType name="itemType"&gt;
     &lt;xs:sequence&gt;
       &lt;xs:element name="title" minOccurs="0"&gt;
@@ -74,4 +53,25 @@
       &lt;/xs:element&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="channelType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="rssType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
+    &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_neverenum_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_neverenum_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_neverenum_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentsmart_neverenum_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,11 +1,14 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
+  &lt;xs:complexType name="itemType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
+      &lt;xs:element type="xs:string" name="title" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="link" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="guid" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
     &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name="channelType"&gt;
     &lt;xs:sequence&gt;
@@ -22,13 +25,10 @@
       &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="itemType"&gt;
+  &lt;xs:complexType name="rssType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="link" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="guid" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
     &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_4enum_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_4enum_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_4enum_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_4enum_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,27 +1,6 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
-    &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:string" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="channelType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
   &lt;xs:complexType name="itemType"&gt;
     &lt;xs:sequence&gt;
       &lt;xs:element name="title" minOccurs="0"&gt;
@@ -74,4 +53,25 @@
       &lt;/xs:element&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="channelType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="rssType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
+    &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:string" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_neverenum_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_neverenum_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_neverenum_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_neverenum_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,11 +1,14 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
+  &lt;xs:complexType name="itemType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
+      &lt;xs:element type="xs:string" name="title" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="link" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="guid" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
     &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:string" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name="channelType"&gt;
     &lt;xs:sequence&gt;
@@ -22,13 +25,10 @@
       &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="itemType"&gt;
+  &lt;xs:complexType name="rssType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="link" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="guid" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
     &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:string" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_contentstring_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,27 +1,6 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
-    &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:string" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="channelType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
   &lt;xs:complexType name="itemType"&gt;
     &lt;xs:sequence&gt;
       &lt;xs:element name="title" minOccurs="0"&gt;
@@ -74,4 +53,25 @@
       &lt;/xs:element&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="channelType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="rssType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
+    &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:string" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_neverenum_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_neverenum_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_neverenum_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_neverenum_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,11 +1,14 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
+  &lt;xs:complexType name="itemType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
+      &lt;xs:element type="xs:string" name="title" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="link" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="guid" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
     &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name="channelType"&gt;
     &lt;xs:sequence&gt;
@@ -22,13 +25,10 @@
       &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="itemType"&gt;
+  &lt;xs:complexType name="rssType"&gt;
     &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="link" minOccurs="0" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="guid" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
     &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,24 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="rss"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="channel"/&gt;
-      &lt;/xs:sequence&gt;
-      &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="item"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="title" minOccurs="0"/&gt;
-        &lt;xs:element ref="link" minOccurs="0"/&gt;
-        &lt;xs:element ref="description"/&gt;
-        &lt;xs:element ref="pubDate"/&gt;
-        &lt;xs:element ref="guid"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
   &lt;xs:element name="title"&gt;
     &lt;xs:simpleType&gt;
       &lt;xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -39,21 +20,6 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="pubDate"&gt;
-    &lt;xs:simpleType&gt;
-      &lt;xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-        &lt;xs:enumeration value="Tue, 03 Jun 2003 09:39:21 GMT"/&gt;
-        &lt;xs:enumeration value="Fri, 30 May 2003 11:06:42 GMT"/&gt;
-        &lt;xs:enumeration value="Tue, 27 May 2003 08:37:32 GMT"/&gt;
-        &lt;xs:enumeration value="Tue, 20 May 2003 08:56:02 GMT"/&gt;
-        &lt;xs:enumeration value="Tue, 10 Jun 2003 04:00:00 GMT"/&gt;
-      &lt;/xs:restriction&gt;
-    &lt;/xs:simpleType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="webMaster" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="language" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="managingEditor" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="docs" type="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="description"&gt;
     &lt;xs:simpleType&gt;
       &lt;xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -65,7 +31,17 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="lastBuildDate" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="pubDate"&gt;
+    &lt;xs:simpleType&gt;
+      &lt;xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+        &lt;xs:enumeration value="Tue, 03 Jun 2003 09:39:21 GMT"/&gt;
+        &lt;xs:enumeration value="Fri, 30 May 2003 11:06:42 GMT"/&gt;
+        &lt;xs:enumeration value="Tue, 27 May 2003 08:37:32 GMT"/&gt;
+        &lt;xs:enumeration value="Tue, 20 May 2003 08:56:02 GMT"/&gt;
+        &lt;xs:enumeration value="Tue, 10 Jun 2003 04:00:00 GMT"/&gt;
+      &lt;/xs:restriction&gt;
+    &lt;/xs:simpleType&gt;
+  &lt;/xs:element&gt;
   &lt;xs:element name="guid"&gt;
     &lt;xs:simpleType&gt;
       &lt;xs:restriction base="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -76,7 +52,23 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
+  &lt;xs:element name="language" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="lastBuildDate" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="docs" type="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="generator" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="managingEditor" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="webMaster" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="item"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="title" minOccurs="0"/&gt;
+        &lt;xs:element ref="link" minOccurs="0"/&gt;
+        &lt;xs:element ref="description"/&gt;
+        &lt;xs:element ref="pubDate"/&gt;
+        &lt;xs:element ref="guid"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
   &lt;xs:element name="channel"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
@@ -94,4 +86,12 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
+  &lt;xs:element name="rss"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="channel"/&gt;
+      &lt;/xs:sequence&gt;
+      &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/rss2sample_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,27 +1,6 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
-    &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="channelType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
   &lt;xs:complexType name="itemType"&gt;
     &lt;xs:sequence&gt;
       &lt;xs:element name="title" minOccurs="0"&gt;
@@ -74,4 +53,25 @@
       &lt;/xs:element&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="channelType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="pubDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="lastBuildDate" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="docs" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="generator" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="rssType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
+    &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,23 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="rss"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="channel"/&gt;
-      &lt;/xs:sequence&gt;
-      &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="item"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="title"/&gt;
-        &lt;xs:element ref="link"/&gt;
-        &lt;xs:element ref="description"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="width" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="title"&gt;
     &lt;xs:simpleType&gt;
       &lt;xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -31,6 +13,7 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
+  &lt;xs:element name="url" type="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="link"&gt;
     &lt;xs:simpleType&gt;
       &lt;xs:restriction base="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -44,9 +27,7 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="webMaster" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="language" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="managingEditor" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="width" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="height" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="description"&gt;
     &lt;xs:simpleType&gt;
@@ -61,6 +42,10 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
+  &lt;xs:element name="language" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="copyright" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="managingEditor" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="webMaster" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="image"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
@@ -73,7 +58,15 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="url" type="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="item"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="title"/&gt;
+        &lt;xs:element ref="link"/&gt;
+        &lt;xs:element ref="description"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
   &lt;xs:element name="channel"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
@@ -89,5 +82,12 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="copyright" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="rss"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="channel"/&gt;
+      &lt;/xs:sequence&gt;
+      &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/sampleRss091_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,25 +1,6 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="rss" type="rssType"/&gt;
-  &lt;xs:complexType name="rssType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="channelType" name="channel"/&gt;
-    &lt;/xs:sequence&gt;
-    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;/xs:complexType&gt;
-  &lt;xs:complexType name="channelType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:anyURI" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="copyright" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;xs:element type="imageType" name="image"/&gt;
-      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
   &lt;xs:complexType name="imageType"&gt;
     &lt;xs:sequence&gt;
       &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
@@ -70,4 +51,23 @@
       &lt;/xs:element&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="channelType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="xs:string" name="title" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:anyURI" name="link" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="description" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="language" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="copyright" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="managingEditor" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="xs:string" name="webMaster" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;xs:element type="imageType" name="image"/&gt;
+      &lt;xs:element type="itemType" name="item" maxOccurs="unbounded" minOccurs="0"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="rssType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="channelType" name="channel"/&gt;
+    &lt;/xs:sequence&gt;
+    &lt;xs:attribute type="xs:float" name="version" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_neverenum_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_neverenum_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_neverenum_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_neverenum_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,17 +1,13 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="comments" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="backslash"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="story" maxOccurs="unbounded" minOccurs="0"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="section" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="title" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="topic" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="url" type="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="time" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="author" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="department" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="topic" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="comments" type="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="section" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="image" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="story"&gt;
     &lt;xs:complexType&gt;
@@ -28,7 +24,11 @@
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="url" type="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="author" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="department" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="backslash"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="story" maxOccurs="unbounded" minOccurs="0"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_ss0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_ss0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_ss0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_ss0.xsd Mon May 11 21:22:13 2009
@@ -1,28 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="comments"&gt;
-    &lt;xs:simpleType&gt;
-      &lt;xs:restriction base="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-        &lt;xs:enumeration value="19"/&gt;
-        &lt;xs:enumeration value="215"/&gt;
-        &lt;xs:enumeration value="178"/&gt;
-        &lt;xs:enumeration value="558"/&gt;
-        &lt;xs:enumeration value="140"/&gt;
-        &lt;xs:enumeration value="193"/&gt;
-        &lt;xs:enumeration value="340"/&gt;
-        &lt;xs:enumeration value="277"/&gt;
-        &lt;xs:enumeration value="312"/&gt;
-      &lt;/xs:restriction&gt;
-    &lt;/xs:simpleType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="backslash"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="story" maxOccurs="unbounded" minOccurs="0"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="section" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="title"&gt;
     &lt;xs:simpleType&gt;
       &lt;xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -39,19 +16,19 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="topic"&gt;
+  &lt;xs:element name="url"&gt;
     &lt;xs:simpleType&gt;
-      &lt;xs:restriction base="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-        &lt;xs:enumeration value="191"/&gt;
-        &lt;xs:enumeration value="172"/&gt;
-        &lt;xs:enumeration value="180"/&gt;
-        &lt;xs:enumeration value="99"/&gt;
-        &lt;xs:enumeration value="141"/&gt;
-        &lt;xs:enumeration value="152"/&gt;
-        &lt;xs:enumeration value="103"/&gt;
-        &lt;xs:enumeration value="111"/&gt;
-        &lt;xs:enumeration value="126"/&gt;
-        &lt;xs:enumeration value="188"/&gt;
+      &lt;xs:restriction base="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1819223"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1621253"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1614232"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1416254"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1353247"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1341237"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1317236"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/132224"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1225238"/&gt;
+        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/128249"/&gt;
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
@@ -71,38 +48,6 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
-  &lt;xs:element name="image" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="story"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="title"/&gt;
-        &lt;xs:element ref="url"/&gt;
-        &lt;xs:element ref="time"/&gt;
-        &lt;xs:element ref="author"/&gt;
-        &lt;xs:element ref="department"/&gt;
-        &lt;xs:element ref="topic"/&gt;
-        &lt;xs:element ref="comments"/&gt;
-        &lt;xs:element ref="section"/&gt;
-        &lt;xs:element ref="image"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
-  &lt;xs:element name="url"&gt;
-    &lt;xs:simpleType&gt;
-      &lt;xs:restriction base="xs:anyURI" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1819223"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1621253"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1614232"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1416254"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1353247"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1341237"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1317236"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/132224"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/1225238"/&gt;
-        &lt;xs:enumeration value="http://slashdot.org/article.pl?sid=04/08/13/128249"/&gt;
-      &lt;/xs:restriction&gt;
-    &lt;/xs:simpleType&gt;
-  &lt;/xs:element&gt;
   &lt;xs:element name="author" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="department"&gt;
     &lt;xs:simpleType&gt;
@@ -120,4 +65,59 @@
       &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
   &lt;/xs:element&gt;
+  &lt;xs:element name="topic"&gt;
+    &lt;xs:simpleType&gt;
+      &lt;xs:restriction base="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+        &lt;xs:enumeration value="191"/&gt;
+        &lt;xs:enumeration value="172"/&gt;
+        &lt;xs:enumeration value="180"/&gt;
+        &lt;xs:enumeration value="99"/&gt;
+        &lt;xs:enumeration value="141"/&gt;
+        &lt;xs:enumeration value="152"/&gt;
+        &lt;xs:enumeration value="103"/&gt;
+        &lt;xs:enumeration value="111"/&gt;
+        &lt;xs:enumeration value="126"/&gt;
+        &lt;xs:enumeration value="188"/&gt;
+      &lt;/xs:restriction&gt;
+    &lt;/xs:simpleType&gt;
+  &lt;/xs:element&gt;
+  &lt;xs:element name="comments"&gt;
+    &lt;xs:simpleType&gt;
+      &lt;xs:restriction base="xs:short" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+        &lt;xs:enumeration value="19"/&gt;
+        &lt;xs:enumeration value="215"/&gt;
+        &lt;xs:enumeration value="178"/&gt;
+        &lt;xs:enumeration value="558"/&gt;
+        &lt;xs:enumeration value="140"/&gt;
+        &lt;xs:enumeration value="193"/&gt;
+        &lt;xs:enumeration value="340"/&gt;
+        &lt;xs:enumeration value="277"/&gt;
+        &lt;xs:enumeration value="312"/&gt;
+      &lt;/xs:restriction&gt;
+    &lt;/xs:simpleType&gt;
+  &lt;/xs:element&gt;
+  &lt;xs:element name="section" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="image" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="story"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="title"/&gt;
+        &lt;xs:element ref="url"/&gt;
+        &lt;xs:element ref="time"/&gt;
+        &lt;xs:element ref="author"/&gt;
+        &lt;xs:element ref="department"/&gt;
+        &lt;xs:element ref="topic"/&gt;
+        &lt;xs:element ref="comments"/&gt;
+        &lt;xs:element ref="section"/&gt;
+        &lt;xs:element ref="image"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
+  &lt;xs:element name="backslash"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="story" maxOccurs="unbounded" minOccurs="0"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_vb0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_vb0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_vb0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/examples/slashdotxml_vb0.xsd Mon May 11 21:22:13 2009
@@ -1,11 +1,6 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="backslash" type="backslashType"/&gt;
-  &lt;xs:complexType name="backslashType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element type="storyType" name="story" maxOccurs="unbounded" minOccurs="0"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
   &lt;xs:complexType name="storyType"&gt;
     &lt;xs:sequence&gt;
       &lt;xs:element name="title"&gt;
@@ -108,4 +103,9 @@
       &lt;xs:element type="xs:string" name="image" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
+  &lt;xs:complexType name="backslashType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="storyType" name="story" maxOccurs="unbounded" minOccurs="0"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd1.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd1.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd1.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd1.xsd Mon May 11 21:22:13 2009
@@ -1,4 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd2.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd2.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd2.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd2.xsd Mon May 11 21:22:13 2009
@@ -1,13 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="a"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
-        &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
-        &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
-        &lt;xs:element type="xs:string" name="d" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd3.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd3.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd3.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_rd3.xsd Mon May 11 21:22:13 2009
@@ -1,4 +1,13 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="a"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
+        &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
+        &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
+        &lt;xs:element type="xs:string" name="d" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss1.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss1.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss1.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss1.xsd Mon May 11 21:22:13 2009
@@ -1,4 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss2.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss2.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss2.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss2.xsd Mon May 11 21:22:13 2009
@@ -1,14 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-  &lt;xs:element name="a"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
-        &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
-        &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
-        &lt;xs:element ref="ins:d" xmlns:ins="http://xmlbeans.apache.org/inst2xsd"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss3.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss3.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss3.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_ss3.xsd Mon May 11 21:22:13 2009
@@ -1,4 +1,14 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="a"&gt;
+    &lt;xs:complexType&gt;
+      &lt;xs:sequence&gt;
+        &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
+        &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
+        &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
+        &lt;xs:element ref="ins:d" xmlns:ins="http://xmlbeans.apache.org/inst2xsd"/&gt;
+      &lt;/xs:sequence&gt;
+    &lt;/xs:complexType&gt;
+  &lt;/xs:element&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb1.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb1.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb1.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb1.xsd Mon May 11 21:22:13 2009
@@ -1,4 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb2.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb2.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb2.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb2.xsd Mon May 11 21:22:13 2009
@@ -1,12 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="a" type="ins:aType" xmlns:ins="http://xmlbeans.apache.org/inst2xsd"/&gt;
-  &lt;xs:complexType name="aType"&gt;
-    &lt;xs:sequence&gt;
-      &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
-      &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
-      &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
-      &lt;xs:element type="xs:string" name="d" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-    &lt;/xs:sequence&gt;
-  &lt;/xs:complexType&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb3.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb3.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb3.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNS_vb3.xsd Mon May 11 21:22:13 2009
@@ -1,4 +1,12 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="a" type="ins:aType" xmlns:ins="http://xmlbeans.apache.org/inst2xsd"/&gt;
+  &lt;xs:complexType name="aType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
+      &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
+      &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
+      &lt;xs:element type="xs:string" name="d" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd0.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd0.xsd Mon May 11 21:22:13 2009
@@ -1,5 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/a" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
   &lt;xs:element name="b" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd1.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd1.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd1.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd1.xsd Mon May 11 21:22:13 2009
@@ -1,4 +1,5 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="c" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
+  &lt;xs:element name="e" type="xs:byte" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd2.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd2.xsd?rev=773699&amp;r1=773698&amp;r2=773699&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd2.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/namespaces/multipleNestedNS_rd2.xsd Mon May 11 21:22:13 2009
@@ -1,16 +1,4 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/inst2xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="a"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element ref="a:b" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
-        &lt;xs:element ref="b:c" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
-        &lt;xs:element type="xs:string" name="a" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-        &lt;xs:element ref="a:d" xmlns:a="http://xmlbeans.apache.org/a"/&gt;
-        &lt;xs:element ref="b:e" xmlns:b="http://xmlbeans.apache.org/b"/&gt;
-        &lt;xs:element ref="c:d" xmlns:c="http://xmlbeans.apache.org/c"/&gt;
-        &lt;xs:element type="xs:string" name="e" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
+&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlbeans.apache.org/c" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;xs:element name="d" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r772792 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200905.mbox/%3c20090507222013.61D2123889C0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090507222013-61D2123889C0@eris-apache-org%3e</id>
<updated>2009-05-07T22:20:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Thu May  7 22:20:12 2009
New Revision: 772792

URL: http://svn.apache.org/viewvc?rev=772792&amp;view=rev
Log:
Add @Deprecated and @Override annotations to the generated methods if 1.5 level is selected.
Contributed by Wesley Leggette.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java?rev=772792&amp;r1=772791&amp;r2=772792&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
Thu May  7 22:20:12 2009
@@ -463,15 +463,21 @@
         }
 
         // Only need newInstance() for non-abstract types
-        if (sType.isAbstract())
+        if (sType.isAbstract()) {
             emit("/** @deprecated No need to be able to create instances of abstract types
*/");
+            if (_useJava15)
+                emit("@Deprecated");
+        }
         emit("public static " + fullName + " newInstance() {");
         emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance(
type, null ); }");
         emit("");
 
         // Only need newInstance() for non-abstract types
-        if (sType.isAbstract())
+        if (sType.isAbstract()) {
             emit("/** @deprecated No need to be able to create instances of abstract types
*/");
+            if (_useJava15)
+                emit("@Deprecated");
+        }
         emit("public static " + fullName + " newInstance(org.apache.xmlbeans.XmlOptions options)
{");
         emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance(
type, options ); }");
         emit("");
@@ -537,23 +543,31 @@
             emit("");
 
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static " + fullName + " parse(org.apache.xmlbeans.xml.stream.XMLInputStream
xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException
{");
             emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse(
xis, type, null ); }");
             emit("");
 
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static " + fullName + " parse(org.apache.xmlbeans.xml.stream.XMLInputStream
xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException
{");
             emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse(
xis, type, options ); }");
             emit("");
 
             // Don't have XMLInputStream anymore
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream
xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException
{");
             emit("  return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream(
xis, type, null ); }");
             emit("");
 
             // Don't have XMLInputStream anymore
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream
xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException
{");
             emit("  return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream(
xis, type, options ); }");
             emit("");
@@ -713,8 +727,12 @@
                     emit("java.math.BigInteger getBigIntegerValue();");
                     emit("void setBigIntegerValue(java.math.BigInteger bi);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("java.math.BigInteger bigIntegerValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(java.math.BigInteger bi);");
                 }
                 else if (bits == SchemaType.SIZE_LONG)
@@ -722,8 +740,12 @@
                     emit("long getLongValue();");
                     emit("void setLongValue(long l);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("long longValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(long l);");
                 }
                 else if (bits == SchemaType.SIZE_INT)
@@ -731,8 +753,12 @@
                     emit("int getIntValue();");
                     emit("void setIntValue(int i);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("int intValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(int i);");
                 }
                 else if (bits == SchemaType.SIZE_SHORT)
@@ -740,8 +766,12 @@
                     emit("short getShortValue();");
                     emit("void setShortValue(short s);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("short shortValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(short s);");
                 }
                 else if (bits == SchemaType.SIZE_BYTE)
@@ -749,8 +779,12 @@
                     emit("byte getByteValue();");
                     emit("void setByteValue(byte b);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("byte byteValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(byte b);");
                 }
             }
@@ -761,8 +795,12 @@
             emit("java.lang.Object getObjectValue();");
             emit("void setObjectValue(java.lang.Object val);");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("java.lang.Object objectValue();");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("void objectSet(java.lang.Object val);");
             emit("org.apache.xmlbeans.SchemaType instanceType();");
             SchemaType ctype = sType.getUnionCommonBaseType();
@@ -776,10 +814,16 @@
             emit("java.util.List xgetListValue();");
             emit("void setListValue(java.util.List list);");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("java.util.List listValue();");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("java.util.List xlistValue();");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("void set(java.util.List list);");
         }
     }
@@ -1149,6 +1193,7 @@
                 emit(" * Gets array of all " + propdesc + "s");
                 emit(" * @deprecated");
                 emit(" */");
+                emit("@Deprecated");
             }
             else
                 printJavaDoc("Gets array of all " + propdesc + "s");
@@ -1172,6 +1217,7 @@
                     emit(" * Gets (as xml) array of all " + propdesc + "s");
                     emit(" * @deprecated");
                     emit(" */");
+                    emit("@Deprecated");
                 }
                 else
                     printJavaDoc("Gets (as xml) array of all " + propdesc + "s");
@@ -1966,11 +2012,15 @@
         startBlock();
 
         // Object get(i)
+        if (_useJava15)
+            emit("@Override");
         emit("public " + wrappedType + " get(int i)");
         emit("    { return " + parentThis + xgetMethod + arrayName + "(i); }");
         emit("");
 
         // Object set(i, o)
+        if (_useJava15)
+            emit("@Override");
         emit("public " + wrappedType + " set(int i, " + wrappedType + " o)");
         startBlock();
         emit(wrappedType + " old = " + parentThis + xgetMethod + arrayName + "(i);");
@@ -1980,6 +2030,8 @@
         emit("");
 
         // void add(i, o)
+        if (_useJava15)
+            emit("@Override");
         emit("public void add(int i, " + wrappedType +" o)");
         if (xmltype || xget)
             emit("    { " + parentThis + "insertNew" + propertyName + "(i).set(o); }");
@@ -1988,6 +2040,8 @@
         emit("");
 
         // Object remove(i)
+        if (_useJava15)
+            emit("@Override");
         emit("public " + wrappedType +" remove(int i)");
         startBlock();
         emit(wrappedType + " old = " + parentThis + xgetMethod + arrayName + "(i);");
@@ -1997,6 +2051,8 @@
         emit("");
 
         // int size()
+        if (_useJava15)
+            emit("@Override");
         emit("public int size()");
         emit("    { return " + parentThis + "sizeOf" + arrayName + "(); }");
         emit("");
@@ -2136,6 +2192,7 @@
                 emit(" * Gets array of all " + propdesc + "s");
                 emit(" * @deprecated");
                 emit(" */");
+                emit("@Deprecated");
             }
             else
                 printJavaDoc("Gets array of all " + propdesc + "s");
@@ -2181,6 +2238,7 @@
                     emit(" * Gets array of all " + propdesc + "s");
                     emit(" * @deprecated");
                     emit(" */");
+                    emit("@Deprecated");
                 }
                 else
                     printJavaDoc("Gets (as xml) array of all " + propdesc + "s");



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r772769 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XmlValueRef.java</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200905.mbox/%3c20090507205207.E6B302388969@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090507205207-E6B302388969@eris-apache-org%3e</id>
<updated>2009-05-07T20:52:07Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Thu May  7 20:52:07 2009
New Revision: 772769

URL: http://svn.apache.org/viewvc?rev=772769&amp;view=rev
Log:
Made XmlValueRef constructor public.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XmlValueRef.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XmlValueRef.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XmlValueRef.java?rev=772769&amp;r1=772768&amp;r2=772769&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XmlValueRef.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/XmlValueRef.java Thu May 
7 20:52:07 2009
@@ -29,7 +29,7 @@
     SchemaType.Ref _typeref;
     Object _initVal;
 
-    XmlValueRef(XmlAnySimpleType xobj)
+    public XmlValueRef(XmlAnySimpleType xobj)
     {
         if (xobj == null)
             throw new IllegalArgumentException();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r772767 - in /xmlbeans/trunk: src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java test/cases/xbean/tools/inst2xsd/options/base0.xsd</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200905.mbox/%3c20090507204750.96B3B2388969@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090507204750-96B3B2388969@eris-apache-org%3e</id>
<updated>2009-05-07T20:47:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Thu May  7 20:47:50 2009
New Revision: 772767

URL: http://svn.apache.org/viewvc?rev=772767&amp;view=rev
Log:
Removed an unnecessary cast from the generated code. Contributed by Wesley Leggette.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java?rev=772767&amp;r1=772766&amp;r2=772767&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
Thu May  7 20:47:50 2009
@@ -2204,7 +2204,7 @@
                 startBlock();
                 emitImplementationPreamble();
                 emitGetTarget(setIdentifier, identifier, isAttr, "i", THROW_EXCEPTION, xtype);
-                emit("return (" + xtype + ")target;");
+                emit("return target;");
                 emitImplementationPostamble();
                 endBlock();
 

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd?rev=772767&amp;r1=772766&amp;r2=772767&amp;view=diff
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd Thu May  7 20:47:50 2009
@@ -1,12 +1,11 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="baseNamespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
-  &lt;xs:element name="a"&gt;
-    &lt;xs:complexType&gt;
-      &lt;xs:sequence&gt;
-        &lt;xs:element type="xs:string" name="b"/&gt;
-        &lt;xs:element type="xs:string" name="c"/&gt;
-        &lt;xs:element type="xs:string" name="d"/&gt;
-      &lt;/xs:sequence&gt;
-    &lt;/xs:complexType&gt;
-  &lt;/xs:element&gt;
+  &lt;xs:element name="a" type="bas:aType" xmlns:bas="baseNamespace"/&gt;
+  &lt;xs:complexType name="aType"&gt;
+    &lt;xs:sequence&gt;
+      &lt;xs:element type="xs:string" name="b"/&gt;
+      &lt;xs:element type="xs:byte" name="c"/&gt;
+      &lt;xs:element type="xs:string" name="d"/&gt;
+    &lt;/xs:sequence&gt;
+  &lt;/xs:complexType&gt;
 &lt;/xs:schema&gt;
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r770399 - in /xmlbeans/trunk: build.xml src/store/org/apache/xmlbeans/impl/store/Saver.java src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java</title>
<author><name>cezar@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200904.mbox/%3c20090430190548.346692388B68@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090430190548-346692388B68@eris-apache-org%3e</id>
<updated>2009-04-30T19:05:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: cezar
Date: Thu Apr 30 19:05:47 2009
New Revision: 770399

URL: http://svn.apache.org/viewvc?rev=770399&amp;view=rev
Log:
Fix DocType bug when the root element gets changed.


Modified:
    xmlbeans/trunk/build.xml
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java

Modified: xmlbeans/trunk/build.xml
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/build.xml?rev=770399&amp;r1=770398&amp;r2=770399&amp;view=diff
==============================================================================
--- xmlbeans/trunk/build.xml (original)
+++ xmlbeans/trunk/build.xml Thu Apr 30 19:05:47 2009
@@ -905,6 +905,8 @@
     &lt;target name="repackage" depends="repackage.classes"&gt;
 
         &lt;echo message="Re-packaging XmlBeans"/&gt;
+	&lt;echo message="   from: ${rp_source_dir}"/&gt;
+	&lt;echo message="   to:   ${rp_target_dir}"/&gt;
 
         &lt;property
             name="new_repackage_arg"

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=770399&amp;r1=770398&amp;r2=770399&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Thu Apr 30 19:05:47
2009
@@ -363,8 +363,12 @@
 
             if (docTypeName != null)
             {
-                emitDocType( docTypeName, publicId, systemId );
-                return;
+                QName rootElemName = _cur.getName();
+                if ( rootElemName!=null &amp;&amp; docTypeName.equals(rootElemName.getLocalPart())
)
+                {
+                    emitDocType( docTypeName, publicId, systemId );
+                    return;
+                }
             }
         }
 

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java?rev=770399&amp;r1=770398&amp;r2=770399&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaQNameHolder.java Thu Apr
30 19:05:47 2009
@@ -178,7 +178,10 @@
     // setters, getters (setter already handled via set_text)
 
     public QName getQNameValue()
-        { check_dated(); return _value; }
+    {
+        check_dated();
+        return _value;
+    }
 
     // comparators
     protected boolean equal_to(XmlObject obj)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r769119 - in /xmlbeans/trunk: ./ src/configschema/schema/ src/typeimpl/org/apache/xmlbeans/impl/schema/ src/typeimpl/org/apache/xmlbeans/impl/values/ src/xmlconfig/org/apache/xmlbeans/impl/config/ src/xmlpublic/org/apache/xmlbeans/ test/cas...</title>
<author><name>radup@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200904.mbox/%3c20090427193115.6A3F72388A46@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090427193115-6A3F72388A46@eris-apache-org%3e</id>
<updated>2009-04-27T19:31:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: radup
Date: Mon Apr 27 19:31:13 2009
New Revision: 769119

URL: http://svn.apache.org/viewvc?rev=769119&amp;view=rev
Log:
Added "User Types" feature - allows mapping of Schema simple types to custom user Java classes (http://wiki.apache.org/xmlbeans/UserTypes).
Contributed by Wesley Leggette.

Added:
    xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/UserTypeImpl.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/UserType.java
    xmlbeans/trunk/test/cases/xbean/usertype/
    xmlbeans/trunk/test/cases/xbean/usertype/averageCase/
    xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsd
    xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsdconfig
    xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/
    xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsd
    xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsdconfig
    xmlbeans/trunk/test/src/xmlobject/usertype/
    xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/
    xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/checkin/
    xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/checkin/AverageTest.java
    xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/
    xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKU.java
    xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKUHandler.java
    xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/
    xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/checkin/
    xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/checkin/AverageTest.java
    xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/
    xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/Room.java
    xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/RoomHandler.java
Modified:
    xmlbeans/trunk/src/configschema/schema/xmlconfig.xsd
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscJavaizer.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java
    xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/BindingConfigImpl.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/BindingConfig.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaProperty.java
    xmlbeans/trunk/testbuild.xml

Modified: xmlbeans/trunk/src/configschema/schema/xmlconfig.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/configschema/schema/xmlconfig.xsd?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/configschema/schema/xmlconfig.xsd (original)
+++ xmlbeans/trunk/src/configschema/schema/xmlconfig.xsd Mon Apr 27 19:31:13 2009
@@ -58,6 +58,15 @@
           &lt;/xs:annotation&gt;
         &lt;/xs:element&gt;
 
+        &lt;xs:element name="usertype" type="xb:usertypeconfig"&gt;
+          &lt;xs:annotation&gt;
+              &lt;xs:documentation&gt;
+                  Specifies a custom java type mapping for a derived simple type.
+                  A static handler must be specified that converts between the
+                  custom java type and the built-in simple type it derives from.
+              &lt;/xs:documentation&gt;
+          &lt;/xs:annotation&gt;
+        &lt;/xs:element&gt;
       &lt;/xs:choice&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
@@ -172,6 +181,30 @@
     &lt;/xs:union&gt;
    &lt;/xs:simpleType&gt;
 
+    &lt;xs:complexType name="usertypeconfig"&gt;
+       &lt;xs:sequence&gt;
+           &lt;xs:choice&gt;
+               &lt;xs:element name="staticHandler" type="xs:string"&gt;
+                   &lt;xs:annotation&gt;
+                       &lt;xs:documentation&gt;
+                           The name of the handler class for this user type.
+                           The handler must contain public static methods for
+                           translating the user type to and from the derived simple type.
+                           Example:
+                           - qname example:uuid restricts xs:string
+                           - javaname is java.util.UUID
+                           - handler interface must have signatures:
+                                public void encodeUuid(UUID obj, SimpleValue target)
+                                public UUID decodeUuid(SimpleValue obj)
+                       &lt;/xs:documentation&gt;
+                   &lt;/xs:annotation&gt;
+               &lt;/xs:element&gt;
+           &lt;/xs:choice&gt;
+       &lt;/xs:sequence&gt;
+       &lt;xs:attribute name="name" type="xs:QName"/&gt;
+       &lt;xs:attribute name="javaname" type="xs:string"/&gt;
+    &lt;/xs:complexType&gt;
+
     &lt;xs:complexType name="extensionconfig"&gt;
        &lt;xs:sequence&gt;
           &lt;xs:element name="interface" minOccurs="0" maxOccurs="unbounded" &gt;

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java Mon Apr 27 19:31:13 2009
@@ -323,6 +323,20 @@
         }
         return ret;
     }
+    
+    private String getUserTypeStaticHandlerMethod(boolean encode, SchemaTypeImpl stype)
+    {
+        String unqualifiedName = stype.getName().getLocalPart();
+        if (unqualifiedName.length() &lt; 2)
+            unqualifiedName = unqualifiedName.toUpperCase();
+        else
+            unqualifiedName = unqualifiedName.substring(0, 1).toUpperCase() + unqualifiedName.substring(1);
+        
+        if (encode)
+            return stype.getUserTypeHandlerName() + ".encode" + unqualifiedName;
+        else
+            return stype.getUserTypeHandlerName() + ".decode" + unqualifiedName;
+    }
 
 
     public static String indexClassForSystem(SchemaTypeSystem system)
@@ -1017,6 +1031,11 @@
             SchemaType sType = sProp.javaBasedOnType();
             return findJavaType(sType).replace('$', '.');
         }
+        
+        if (sProp.getJavaTypeCode() == SchemaProperty.JAVA_USER)
+        {
+               return ((SchemaTypeImpl)sProp.getType()).getUserTypeName();
+        }
 
         switch (sProp.getJavaTypeCode())
         {
@@ -1446,7 +1465,7 @@
         }
     }
 
-    void printJGetArrayValue(int javaType, String type) throws IOException {
+    void printJGetArrayValue(int javaType, String type, SchemaTypeImpl stype) throws IOException {
         switch (javaType)
         {
             case SchemaProperty.XML_OBJECT:
@@ -1568,10 +1587,19 @@
                 emit("    result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getObjectValue();");
                 break;
 
+            case SchemaProperty.JAVA_USER:
+                emit(stype.getUserTypeName() + "[] result = new " + stype.getUserTypeName() + "[targetList.size()];");
+                emit("for (int i = 0, len = targetList.size() ; i &lt; len ; i++)");
+                emit("    result[i] = " + getUserTypeStaticHandlerMethod(false, stype)
+                        + "((org.apache.xmlbeans.SimpleValue)targetList.get(i));");
+                break;
+                
+            default:
+                throw new IllegalStateException();
         }
         emit("return result;");
     }
-    void printJGetValue(int javaType, String type) throws IOException {
+    void printJGetValue(int javaType, String type, SchemaTypeImpl stype) throws IOException {
         switch (javaType)
         {
         case SchemaProperty.XML_OBJECT:
@@ -1633,72 +1661,83 @@
 
         case SchemaProperty.JAVA_OBJECT:
             emit("return target.getObjectValue();"); break;
+            
+        case SchemaProperty.JAVA_USER:
+            emit("return " + getUserTypeStaticHandlerMethod(false, stype)
+                    + "(target);");
+            break;
+            
+        default:
+            throw new IllegalStateException();
         }
     }
-
-    String jsetMethod(int javaType) throws IOException
-    {
+    void printJSetValue(int javaType, String safeVarName, SchemaTypeImpl stype) throws IOException {
         switch (javaType)
         {
             case SchemaProperty.XML_OBJECT:
-                return "target.set";
+                emit("target.set(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_BOOLEAN:
-                return "target.setBooleanValue";
+                emit("target.setBooleanValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_FLOAT:
-                return "target.setFloatValue";
+                emit("target.setFloatValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_DOUBLE:
-                return "target.setDoubleValue";
+                emit("target.setDoubleValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_BYTE:
-                return "target.setByteValue";
+                emit("target.setByteValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_SHORT:
-                return "target.setShortValue";
+                emit("target.setShortValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_INT:
-                return "target.setIntValue";
+                emit("target.setIntValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_LONG:
-                return "target.setLongValue";
+                emit("target.setLongValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_BIG_DECIMAL:
-                return "target.setBigDecimalValue";
+                emit("target.setBigDecimalValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_BIG_INTEGER:
-                return "target.setBigIntegerValue";
+                emit("target.setBigIntegerValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_STRING:
-                return "target.setStringValue";
+                emit("target.setStringValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_BYTE_ARRAY:
-                return "target.setByteArrayValue";
+                emit("target.setByteArrayValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_GDATE:
-                return "target.setGDateValue";
+                emit("target.setGDateValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_GDURATION:
-                return "target.setGDurationValue";
+                emit("target.setGDurationValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_CALENDAR:
-                return "target.setCalendarValue";
+                emit("target.setCalendarValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_DATE:
-                return "target.setDateValue";
+                emit("target.setDateValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_QNAME:
-                return "target.setQNameValue";
+                emit("target.setQNameValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_LIST:
-                return "target.setListValue";
+                emit("target.setListValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_ENUM:
-                return "target.setEnumValue";
+                emit("target.setEnumValue(" + safeVarName + ");"); break;
 
             case SchemaProperty.JAVA_OBJECT:
-                return "target.setObjectValue";
+                emit("target.setObjectValue(" + safeVarName + ");"); break;
+                
+            case SchemaProperty.JAVA_USER:
+                emit(getUserTypeStaticHandlerMethod(true, stype)
+                        + "(" + safeVarName + ", target);");
+                break;
 
             default:
                 throw new IllegalStateException();
@@ -2009,8 +2048,9 @@
             makeMissingValue(javaType);
             endBlock();
 
-
-            printJGetValue(javaType, type);
+            
+            printJGetValue(javaType, type, (SchemaTypeImpl)prop.getType());    
+            
 
             emitImplementationPostamble();
 
@@ -2109,7 +2149,7 @@
                 emit("java.util.List targetList = new java.util.ArrayList();");
             emit("get_store().find_all_element_users(" + setIdentifier + ", targetList);");
 
-            printJGetArrayValue(javaType, type);
+            printJGetArrayValue(javaType, type, (SchemaTypeImpl)prop.getType());
 
             emitImplementationPostamble();
             endBlock();
@@ -2121,7 +2161,7 @@
             emitImplementationPreamble();
 
             emitGetTarget(setIdentifier, identifier, isAttr, "i", THROW_EXCEPTION, jtargetType);
-            printJGetValue(javaType, type);
+            printJGetValue(javaType, type, (SchemaTypeImpl)prop.getType());
 
             emitImplementationPostamble();
             endBlock();
@@ -2194,7 +2234,7 @@
         }
     }
 
-    void printSetterImpls(QName qName, boolean isAttr,
+       void printSetterImpls(QName qName, SchemaProperty prop, boolean isAttr,
                        String propertyName, int javaType, String type, String xtype,
                        boolean nillable, boolean optional, boolean several, boolean singleton,
                        boolean isunion, String identifier, String setIdentifier, SchemaType sType)
@@ -2209,7 +2249,6 @@
         boolean xmltype = (javaType == SchemaProperty.XML_OBJECT);
         boolean isobj = (javaType == SchemaProperty.JAVA_OBJECT);
         boolean isSubstGroup = identifier != setIdentifier;
-        String jSet = jsetMethod(javaType);
         String jtargetType = (isunion || !xmltype) ? "org.apache.xmlbeans.SimpleValue" : xtype;
 
         String propdesc = "\"" + qName.getLocalPart() + "\"" + (isAttr ? " attribute" : " element");
@@ -2232,7 +2271,7 @@
                 emitImplementationPreamble();
                 emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1");
                 emitGetTarget(setIdentifier, identifier, isAttr, "0", ADD_NEW_VALUE, jtargetType);
-                emit(jSet + "(" + safeVarName + ");");
+                printJSetValue(javaType, safeVarName, (SchemaTypeImpl)prop.getType());
                 emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1");
                 emitImplementationPostamble();
             }
@@ -2349,6 +2388,25 @@
                     else
                         emit("unionArraySetterHelper(" + safeVarName + "Array" + ", " + identifier + ", " + setIdentifier + ");" );
                 }
+                else if (prop.getJavaTypeCode() == SchemaProperty.JAVA_USER)
+                {
+                    if (!isSubstGroup)
+                    {
+                        emit("org.apache.xmlbeans.SimpleValue[] dests = arraySetterHelper(" + safeVarName + "Array.length" + ", " + identifier + ");" );
+                        emit("for ( int i = 0 ; i &lt; dests.length ; i++ ) {");
+                        emit("    " + getUserTypeStaticHandlerMethod(true, (SchemaTypeImpl)prop.getType())
+                                + "(" + safeVarName + "Array[i], dests[i]);");
+                        emit("}");
+                    }
+                    else
+                    {
+                        emit("org.apache.xmlbeans.SimpleValue[] dests = arraySetterHelper(" + safeVarName + "Array.length" + ", " + identifier + ", " + setIdentifier + ");" );
+                        emit("for ( int i = 0 ; i &lt; dests.length ; i++ ) {");
+                        emit("    " + getUserTypeStaticHandlerMethod(true, (SchemaTypeImpl)prop.getType())
+                                + "(" + safeVarName + "Array[i], dests[i]);");
+                        emit("}");
+                    }
+                }
                 else
                 {
                     if (!isSubstGroup)
@@ -2377,7 +2435,7 @@
                 emitImplementationPreamble();
                 emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i");
                 emitGetTarget(setIdentifier, identifier, isAttr, "i", THROW_EXCEPTION, jtargetType);
-                emit(jSet + "(" + safeVarName + ");");
+                printJSetValue(javaType, safeVarName, (SchemaTypeImpl)prop.getType());
                 emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i");
                 emitImplementationPostamble();
             }
@@ -2436,7 +2494,7 @@
                     emit ("(" + jtargetType +")get_store().insert_element_user(" + setIdentifier + ", " +
                             identifier + ", i);");
                 outdent();
-                emit(jSet + "(" + safeVarName + ");");
+                printJSetValue(javaType, safeVarName, (SchemaTypeImpl)prop.getType());
                 emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr, "i");
                 emitImplementationPostamble();
                 endBlock();
@@ -2448,7 +2506,7 @@
                 emitDeclareTarget(true, jtargetType);
   	            emitPre(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr);
                 emitAddTarget(identifier, isAttr, true, jtargetType);
-                emit(jSet + "(" + safeVarName + ");");
+                printJSetValue(javaType, safeVarName, (SchemaTypeImpl)prop.getType());
                 emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr);
                 emitImplementationPostamble();
                 endBlock();
@@ -2602,6 +2660,7 @@
                 {
                     printSetterImpls(
                         name,
+                        prop,
                         prop.isAttribute(),
                         prop.getJavaPropertyName(),
                         prop.getJavaTypeCode(),

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java Mon Apr 27 19:31:13 2009
@@ -100,6 +100,8 @@
     private volatile Constructor _javaImplConstructor;
     private volatile Constructor _javaImplConstructor2;
     private volatile boolean _implNotAvailable;
+    private volatile Class _userTypeClass;
+    private volatile Class _userTypeHandlerClass;
 
     // user data objects not persisted
     private volatile Object _userData;
@@ -140,6 +142,10 @@
     private int _baseDepth; // how many inheritance steps to AnyType
     private int _derivationType;
 
+    // user type support
+    private String _userTypeName;
+    private String _userTypeHandler;
+    
     // for complex types with simple content
     private SchemaType.Ref _contentBasedOnTyperef;
 
@@ -577,6 +583,26 @@
     public String getFullJavaImplName() { return _fullJavaImplName;}
     public String getShortJavaImplName() { return _shortJavaImplName;}
 
+    public String getUserTypeName() 
+    {
+        return _userTypeName;
+    }
+    
+    public void setUserTypeName(String userTypeName)
+    {
+        _userTypeName = userTypeName;
+    }
+
+    public String getUserTypeHandlerName() 
+    {
+        return _userTypeHandler;
+    }
+
+    public void setUserTypeHandlerName(String typeHandler) 
+    {
+        _userTypeHandler = typeHandler;
+    }
+
     public void setInterfaceExtensions(InterfaceExtension[] interfaces)
     {
         assertResolved();
@@ -1718,6 +1744,44 @@
         return _javaImplClass;
     }
 
+    public Class getUserTypeClass() 
+    {
+        // This field is declared volatile and Class is immutable so this is allowed.
+        if (_userTypeClass == null &amp;&amp; getUserTypeName() != null) 
+        {
+            try 
+            {
+                _userTypeClass = Class.forName(_userTypeName, false,
+                    getTypeSystem().getClassLoader());
+            } 
+            catch (ClassNotFoundException e) 
+            {
+                _userTypeClass = null;
+            }
+        }
+
+        return _userTypeClass;
+    }
+
+    public Class getUserTypeHandlerClass() 
+    {
+        // This field is declared volatile and Class is immutable so this is allowed.
+        if (_userTypeHandlerClass == null &amp;&amp; getUserTypeHandlerName() != null) 
+        {
+            try 
+            {
+                _userTypeHandlerClass = Class.forName(_userTypeHandler, false,
+                    getTypeSystem().getClassLoader());
+            } 
+            catch (ClassNotFoundException e) 
+            {
+                _userTypeHandlerClass = null;
+            }
+        }
+
+        return _userTypeHandlerClass;
+    }
+
     public Constructor getJavaImplConstructor()
     {
         if (_javaImplConstructor == null &amp;&amp; !_implNotAvailable)

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscJavaizer.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscJavaizer.java?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscJavaizer.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscJavaizer.java Mon Apr 27 19:31:13 2009
@@ -22,6 +22,7 @@
 import org.apache.xmlbeans.SchemaParticle;
 import org.apache.xmlbeans.SchemaProperty;
 import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.UserType;
 import org.apache.xmlbeans.XmlAnySimpleType;
 import org.apache.xmlbeans.SchemaStringEnumEntry;
 import org.apache.xmlbeans.XmlByte;
@@ -98,6 +99,9 @@
             {
                 sImpl.setFullJavaName(pickFullJavaClassName(usedNames, findTopName(sImpl), pickedName, sImpl.isDocumentType(), sImpl.isAttributeType()));
                 sImpl.setFullJavaImplName(pickFullJavaImplName(usedNames, sImpl.getFullJavaName()));
+
+                setUserTypes(sImpl, state);
+
                 setExtensions(sImpl, state);
             }
         }
@@ -131,6 +135,21 @@
         }
     }
 
+    private static void setUserTypes(SchemaTypeImpl sImpl, StscState state)
+    {
+        BindingConfig config = state.getBindingConfig();
+
+        if (config != null)
+        {
+            UserType utype = config.lookupUserTypeForQName(sImpl.getName());
+            if (utype != null)
+            {
+                sImpl.setUserTypeName(utype.getJavaName());
+                sImpl.setUserTypeHandlerName(utype.getStaticHandler());
+            }
+        }
+    }
+
     private static void setExtensions(SchemaTypeImpl sImpl, StscState state)
     {
         String javaName = sImpl.getFullJavaName();
@@ -531,6 +550,9 @@
         if (!sType.isSimpleType())
             return SchemaProperty.XML_OBJECT;
 
+        if (((SchemaTypeImpl)sType).getUserTypeHandlerName() != null)
+            return SchemaProperty.JAVA_USER;
+
         if (sType.getSimpleVariety() == SchemaType.UNION)
         {
             // see if we can find an interesting common base type, e.g., for string enums

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlComplexContentImpl.java Mon Apr 27 19:31:13 2009
@@ -161,6 +161,58 @@
         }
     }
 
+    protected SimpleValue[] arraySetterHelper ( int sourcesLength, QName elemName )
+    {
+        SimpleValue[] dests = new SimpleValue[sourcesLength];
+
+        TypeStore store = get_store();
+
+        int m = store.count_elements( elemName );
+
+        for ( ; m &gt; sourcesLength ; m-- )
+            store.remove_element( elemName, m - 1 );
+
+        for ( int i = 0 ; i &lt; sourcesLength ; i++ )
+        {
+            TypeStoreUser user;
+
+            if (i &gt;= m)
+                user = store.add_element_user( elemName );
+            else
+                user = store.find_element_user( elemName, i );
+
+            dests[i] = (SimpleValue) user;
+        }
+
+        return dests;
+    }
+
+    protected SimpleValue[] arraySetterHelper ( int sourcesLength, QName elemName, QNameSet set )
+    {
+        SimpleValue[] dests = new SimpleValue[sourcesLength];
+
+        TypeStore store = get_store();
+
+        int m = store.count_elements( set );
+
+        for ( ; m &gt; sourcesLength ; m-- )
+            store.remove_element( set, m - 1 );
+
+        for ( int i = 0 ; i &lt; sourcesLength ; i++ )
+        {
+            TypeStoreUser user;
+
+            if (i &gt;= m)
+                user = store.add_element_user( elemName );
+            else
+                user = store.find_element_user( set, i );
+
+            dests[i] = (SimpleValue) user;
+        }
+
+        return dests;
+    }
+
     protected void arraySetterHelper ( boolean[] sources, QName elemName )
     {
         int n = sources == null ? 0 : sources.length;

Modified: xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/BindingConfigImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/BindingConfigImpl.java?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/BindingConfigImpl.java (original)
+++ xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/BindingConfigImpl.java Mon Apr 27 19:31:13 2009
@@ -20,7 +20,9 @@
 import org.apache.xmlbeans.impl.xb.xmlconfig.Nsconfig;
 import org.apache.xmlbeans.impl.xb.xmlconfig.Qnameconfig;
 import org.apache.xmlbeans.impl.xb.xmlconfig.Qnametargetenum;
+import org.apache.xmlbeans.impl.xb.xmlconfig.Usertypeconfig;
 import org.apache.xmlbeans.BindingConfig;
+import org.apache.xmlbeans.UserType;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlError;
 import org.apache.xmlbeans.InterfaceExtension;
@@ -54,6 +56,7 @@
 
     private List _interfaceExtensions;
     private List _prePostExtensions;
+    private Map _userTypes;
 
     private BindingConfigImpl()
     {
@@ -69,6 +72,7 @@
         _qnameAttMap = Collections.EMPTY_MAP;
         _interfaceExtensions = new ArrayList();
         _prePostExtensions = new ArrayList();
+        _userTypes = Collections.EMPTY_MAP;
     }
 
     public static BindingConfig forConfigDocuments(Config[] configs, File[] javaFiles, File[] classpath)
@@ -90,6 +94,7 @@
         _qnameAttMap = new LinkedHashMap();
         _interfaceExtensions = new ArrayList();
         _prePostExtensions = new ArrayList();
+        _userTypes = new LinkedHashMap();
 
         for (int i = 0; i &lt; configs.length; i++)
         {
@@ -137,6 +142,12 @@
             {
                 recordExtensionSetting(javaFiles, classpath, ext[j]);
             }
+            
+            Usertypeconfig[] utypes = config.getUsertypeArray();
+            for (int j = 0; j &lt; utypes.length; j++)
+            {
+                recordUserTypeSetting(javaFiles, classpath, utypes[j]);
+            }
         }
 
         secondPhaseValidation();
@@ -274,6 +285,14 @@
         }
     }
 
+    private void recordUserTypeSetting(File[] javaFiles, File[] classpath,
+            Usertypeconfig usertypeconfig)
+    {
+        JamClassLoader jamLoader = getJamLoader(javaFiles, classpath);
+        UserTypeImpl userType = UserTypeImpl.newInstance(jamLoader, usertypeconfig);
+        _userTypes.put(userType.getName(), userType);
+    }
+
 
     private String lookup(Map map, Map mapByUriPrefix, String uri)
     {
@@ -368,6 +387,14 @@
         return null;
     }
 
+    public UserType lookupUserTypeForQName(QName qname)
+    {
+        if (qname == null)
+            return null;
+
+        return (UserType) _userTypes.get(qname);
+    }
+
     public InterfaceExtension[] getInterfaceExtensions()
     {
         return (InterfaceExtension[])_interfaceExtensions.toArray(new InterfaceExtension[_interfaceExtensions.size()]);

Added: xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/UserTypeImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/UserTypeImpl.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/UserTypeImpl.java (added)
+++ xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/UserTypeImpl.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,46 @@
+package org.apache.xmlbeans.impl.config;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xmlbeans.UserType;
+import org.apache.xmlbeans.impl.jam.JamClassLoader;
+import org.apache.xmlbeans.impl.xb.xmlconfig.Usertypeconfig;
+
+public class UserTypeImpl implements UserType
+{
+    private QName _name;
+    private String _javaName;
+    private String _staticHandler;
+
+
+    static UserTypeImpl newInstance(JamClassLoader loader, Usertypeconfig cfgXO)
+    {
+        UserTypeImpl result = new UserTypeImpl();
+
+        result._name = cfgXO.getName();
+        result._javaName = cfgXO.getJavaname();
+        result._staticHandler = cfgXO.getStaticHandler();
+
+        // We don't validate here because we're just using reflection in
+        // the implementation. However, in the future we might want to add
+        // the option of directly using the static handler in generated code
+
+        return result;
+    }
+
+
+    public String getJavaName() 
+    {
+        return _javaName;
+    }
+
+    public QName getName()
+    {
+        return _name;
+    }
+
+    public String getStaticHandler()
+    {
+        return _staticHandler;
+    }
+}

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/BindingConfig.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/BindingConfig.java?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/BindingConfig.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/BindingConfig.java Mon Apr 27 19:31:13 2009
@@ -27,6 +27,7 @@
 {
     private static final InterfaceExtension[] EMPTY_INTERFACE_EXT_ARRAY = new InterfaceExtension[0];
     private static final PrePostExtension[] EMPTY_PREPOST_EXT_ARRAY = new PrePostExtension[0];
+    private static final UserType[] EMPTY_USER_TYPE_ARRY = new UserType[0];
 
     public static final int QNAME_TYPE = 1;
     public static final int QNAME_DOCUMENT_TYPE = 2;
@@ -85,4 +86,14 @@
      */
     public PrePostExtension getPrePostExtension(String fullJavaName) { return null; }
 
+    /**
+     * Returns all defined user types.
+     */
+    public UserType[] getUserTypes() { return EMPTY_USER_TYPE_ARRY; }
+
+    /**
+     * Returns a user defined Java type for a given QName.
+     */
+    public UserType lookupUserTypeForQName(QName qname) { return null; }
+
 }

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaProperty.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaProperty.java?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaProperty.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SchemaProperty.java Mon Apr 27 19:31:13 2009
@@ -211,6 +211,9 @@
     /** A {@link java.lang.Object}, used for some simple type unions. See {@link #getJavaTypeCode}. */
     static final int JAVA_OBJECT = 19; // for some unions
 
+    /** A user specified type. */
+    static final int JAVA_USER = 20;
+
     /**
      * Returns the default or fixed value,
      * if it is consistent. If it is not consistent,

Added: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/UserType.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/UserType.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/UserType.java (added)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/UserType.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,27 @@
+package org.apache.xmlbeans;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The UserType class represents a mapping between an XML Schema QName and
+ * a custom Java class type. It is used during code generation to determine
+ * how to convert user-defined simple types to user defined Java classes.
+ */
+public interface UserType
+{
+    /**
+     * The QName of the simple value that will be converted to a Java class.
+     */
+    QName getName();
+
+    /**
+     * The class name the simple value will be converted to.
+     */
+    String getJavaName();
+
+    /**
+     * A class which provides public static methods to convert {@link SimpleValue}
+     * objects to and from the Java type specified by {@link #getJavaName()}.
+     */
+    String getStaticHandler();
+}

Added: xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsd?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsd (added)
+++ xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsd Mon Apr 27 19:31:13 2009
@@ -0,0 +1,62 @@
+&lt;!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by Michael Kintzer (BEA Systems) --&gt;
+&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:po="http://xbean.usertype/averageCase/PurchaseOrder"
+targetNamespace="http://xbean.usertype/averageCase/PurchaseOrder"
+elementFormDefault="qualified"
+&gt;
+       &lt;xsd:annotation&gt;
+               &lt;xsd:documentation xml:lang="en"&gt;
+   Purchase order schema for Example.com.
+   Copyright 2000 Example.com. All rights reserved.
+  &lt;/xsd:documentation&gt;
+       &lt;/xsd:annotation&gt;
+       &lt;xsd:element name="purchaseOrder" type="po:PurchaseOrderType"/&gt;
+       &lt;xsd:element name="comment" type="xsd:string"/&gt;
+       &lt;xsd:complexType name="PurchaseOrderType"&gt;
+               &lt;xsd:sequence&gt;
+                       &lt;xsd:element name="shipTo" type="po:USAddress"/&gt;
+                       &lt;xsd:element name="billTo" type="po:USAddress"/&gt;
+                       &lt;xsd:element ref="po:comment" minOccurs="0"/&gt;
+                       &lt;xsd:element name="items" type="po:Items"/&gt;
+               &lt;/xsd:sequence&gt;
+               &lt;xsd:attribute name="orderDate" type="xsd:date"/&gt;
+       &lt;/xsd:complexType&gt;
+       &lt;xsd:complexType name="USAddress"&gt;
+               &lt;xsd:sequence&gt;
+                       &lt;xsd:element name="name" type="xsd:string" nillable="true"/&gt;
+                       &lt;xsd:element name="street" type="xsd:string"/&gt;
+                       &lt;xsd:element name="city" type="xsd:string"/&gt;
+                       &lt;xsd:element name="state" type="xsd:string"/&gt;
+                       &lt;xsd:element name="zip" type="xsd:decimal"/&gt;
+               &lt;/xsd:sequence&gt;
+               &lt;xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/&gt;
+       &lt;/xsd:complexType&gt;
+       &lt;xsd:complexType name="Items"&gt;
+               &lt;xsd:sequence&gt;
+                       &lt;xsd:element name="item" minOccurs="0" maxOccurs="unbounded"&gt;
+                               &lt;xsd:complexType&gt;
+                                       &lt;xsd:sequence&gt;
+                                               &lt;xsd:element name="productName" type="xsd:string"/&gt;
+                                               &lt;xsd:element name="quantity"&gt;
+                                                       &lt;xsd:simpleType&gt;
+                                                               &lt;xsd:restriction base="xsd:positiveInteger"&gt;
+                                                                       &lt;xsd:maxExclusive value="100"/&gt;
+                                                               &lt;/xsd:restriction&gt;
+                                                       &lt;/xsd:simpleType&gt;
+                                               &lt;/xsd:element&gt;
+                                               &lt;xsd:element name="USPrice" type="xsd:decimal"/&gt;
+                                               &lt;xsd:element ref="po:comment" minOccurs="0"/&gt;
+                                               &lt;xsd:element name="shipDate" type="xsd:date" minOccurs="0"/&gt;
+                                       &lt;/xsd:sequence&gt;
+                                       &lt;xsd:attribute name="partNum" type="po:SKU" use="required"/&gt;
+                               &lt;/xsd:complexType&gt;
+                       &lt;/xsd:element&gt;
+               &lt;/xsd:sequence&gt;
+       &lt;/xsd:complexType&gt;
+       &lt;!-- Stock Keeping Unit, a code for identifying products --&gt;
+       &lt;xsd:simpleType name="SKU"&gt;
+               &lt;xsd:restriction base="xsd:string"&gt;
+                       &lt;xsd:pattern value="\d{3}-[A-Z]{2}"/&gt;
+               &lt;/xsd:restriction&gt;
+       &lt;/xsd:simpleType&gt;
+&lt;/xsd:schema&gt;

Added: xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsdconfig
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsdconfig?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsdconfig (added)
+++ xmlbeans/trunk/test/cases/xbean/usertype/averageCase/po.xsdconfig Mon Apr 27 19:31:13 2009
@@ -0,0 +1,21 @@
+&lt;!-- Copyright 2004 The Apache Software Foundation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. --&gt;
+&lt;xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config"
+xmlns:po="http://xbean.usertype/averageCase/PurchaseOrder"&gt;
+
+    &lt;xb:usertype name="po:SKU" javaname="xmlobject.usertype.averageCase.existing.SKU"&gt;
+        &lt;xb:staticHandler&gt;xmlobject.usertype.averageCase.existing.SKUHandler&lt;/xb:staticHandler&gt;
+    &lt;/xb:usertype&gt;
+
+&lt;/xb:config&gt;

Added: xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsd
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsd?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsd (added)
+++ xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsd Mon Apr 27 19:31:13 2009
@@ -0,0 +1,40 @@
+&lt;xsd:schema targetNamespace="http://xbean.usertype/multipleItems/company"
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:company="http://xbean.usertype/multipleItems/company"&gt;
+       &lt;xsd:element name="company" type="company:CompanyType" /&gt;
+       &lt;xsd:complexType name="CompanyType"&gt;
+               &lt;xsd:sequence&gt;
+                       &lt;xsd:element name="departments" type="company:DepartmentType"
+                               maxOccurs="unbounded" /&gt;
+               &lt;/xsd:sequence&gt;
+
+               &lt;xsd:anyAttribute namespace="http://www.omg.org/XMI"
+                       processContents="lax" /&gt;
+       &lt;/xsd:complexType&gt;
+       &lt;xsd:element name="department" type="company:DepartmentType" /&gt;
+       &lt;xsd:complexType name="DepartmentType"&gt;
+               &lt;xsd:sequence&gt;
+                       &lt;xsd:element name="consultant" type="company:ConsultantType"
+                               maxOccurs="unbounded" /&gt;
+               &lt;/xsd:sequence&gt;
+               &lt;xsd:anyAttribute namespace="http://www.omg.org/XMI"
+                       processContents="lax" /&gt;
+       &lt;/xsd:complexType&gt;
+       &lt;xsd:complexType name="ConsultantType"&gt;
+               &lt;xsd:sequence&gt;
+                       &lt;xsd:element name="room" type="company:Room" maxOccurs="unbounded" /&gt;
+               &lt;/xsd:sequence&gt;
+               &lt;xsd:attribute name="name" type="xsd:string" /&gt;
+               &lt;xsd:attribute name="age" type="xsd:integer" /&gt;
+               &lt;xsd:anyAttribute namespace="http://www.omg.org/XMI"
+                       processContents="lax" /&gt;
+
+
+       &lt;/xsd:complexType&gt;
+
+
+       &lt;xsd:simpleType name="Room"&gt;
+               &lt;xsd:restriction base="xsd:string"&gt;
+                       &lt;xsd:pattern value="\d{3}-[A-Z]{2}" /&gt;
+               &lt;/xsd:restriction&gt;
+       &lt;/xsd:simpleType&gt;
+&lt;/xsd:schema&gt;

Added: xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsdconfig
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsdconfig?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsdconfig (added)
+++ xmlbeans/trunk/test/cases/xbean/usertype/multipleItems/company.xsdconfig Mon Apr 27 19:31:13 2009
@@ -0,0 +1,21 @@
+&lt;!-- Copyright 2004 The Apache Software Foundation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. --&gt;
+&lt;xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config"
+xmlns:company="http://xbean.usertype/multipleItems/company"&gt;
+
+    &lt;xb:usertype name="company:Room" javaname="xmlobject.usertype.multipleItems.existing.Room"&gt;
+        &lt;xb:staticHandler&gt;xmlobject.usertype.multipleItems.existing.RoomHandler&lt;/xb:staticHandler&gt;
+    &lt;/xb:usertype&gt;
+
+&lt;/xb:config&gt;

Added: xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/checkin/AverageTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/checkin/AverageTest.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/checkin/AverageTest.java (added)
+++ xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/checkin/AverageTest.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,100 @@
+/*   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package xmlobject.usertype.averageCase.checkin;
+
+import java.math.BigDecimal;
+
+import javax.xml.stream.XMLOutputFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
+
+import usertype.xbean.averageCase.purchaseOrder.Items;
+import usertype.xbean.averageCase.purchaseOrder.PurchaseOrderDocument;
+import usertype.xbean.averageCase.purchaseOrder.PurchaseOrderType;
+import xmlobject.usertype.averageCase.existing.SKU;
+
+
+public class AverageTest extends TestCase
+{
+
+    public  AverageTest(String s){
+        super(s);
+    }
+
+    public void test(){
+
+        PurchaseOrderDocument poDoc ;
+
+        poDoc= PurchaseOrderDocument.Factory.newInstance();
+        PurchaseOrderType po=poDoc.addNewPurchaseOrder();
+        int LEN=20;
+
+        Items.Item[] it= new Items.Item[LEN];
+        for (int i=0; i&lt; LEN; i++){
+            it[i]=Items.Item.Factory.newInstance();
+            it[i].setUSPrice(new BigDecimal(""+ 2 ));
+            it[i].setPartNum(new SKU(i, "AB"));
+        }
+        Items items= Items.Factory.newInstance();
+        items.setItemArray(it);
+        po.setItems(items);
+        //  System.out.println("poDoc: " + poDoc);
+
+        for (int i=0; i&lt; LEN; i++){
+            assertEquals(i, it[i].getPartNum().getDigits());
+            assertEquals("AB", it[i].getPartNum().getLetters());
+        }
+
+
+    }
+
+    public void testBadInput() throws XmlException{
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("&lt;purchaseOrder xmlns=\"http://xbean.usertype/averageCase/PurchaseOrder\"&gt;");
+        sb.append("&lt;items&gt;&lt;item partNum=\"000-AB\"&gt;&lt;USPrice&gt;2&lt;/USPrice&gt;&lt;/item&gt;");
+        sb.append("&lt;item partNum=\"0013-AB\"&gt;&lt;USPrice&gt;2&lt;/USPrice&gt;&lt;/item&gt;");
+        sb.append("&lt;/items&gt;&lt;/purchaseOrder&gt;");
+
+        PurchaseOrderDocument poDocument = PurchaseOrderDocument.Factory.parse(sb.toString());
+
+        PurchaseOrderType po = poDocument.getPurchaseOrder();
+
+        Items.Item[] it = po.getItems().getItemArray();
+        assertEquals(2, it.length);
+
+
+        SKU sku = it[0].getPartNum();
+
+        assertEquals(0, sku.getDigits());
+        assertEquals("AB", sku.getLetters());
+
+        try {
+
+            sku = it[1].getPartNum();
+            fail("Invalid SKU format should have failed");
+
+        } catch (XmlValueOutOfRangeException e) {
+
+            // test passed
+        }
+
+
+    }
+}

Added: xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKU.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKU.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKU.java (added)
+++ xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKU.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,42 @@
+package xmlobject.usertype.averageCase.existing;
+
+public class SKU
+{
+    private int digits;
+    private String letters;
+
+    
+    public SKU()
+    {
+    }
+
+    public SKU(int digits, String letters)
+    {
+        setDigits(digits);
+        setLetters(letters);
+    }
+
+    public int getDigits()
+    {
+        return digits;
+    }
+
+    public void setDigits(int digits)
+    {
+        if (digits &gt; 999 || digits &lt; 0)
+            throw new IllegalArgumentException("bad digits");
+        this.digits = digits;
+    }
+
+    public String getLetters()
+    {
+        return letters;
+    }
+
+    public void setLetters(String letters)
+    {
+        if (letters == null || letters.length() != 2)
+            throw new IllegalArgumentException("bad letters");
+        this.letters = letters;
+    }
+}

Added: xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKUHandler.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKUHandler.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKUHandler.java (added)
+++ xmlbeans/trunk/test/src/xmlobject/usertype/averageCase/existing/SKUHandler.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,40 @@
+package xmlobject.usertype.averageCase.existing;
+
+import org.apache.xmlbeans.SimpleValue;
+import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
+
+public class SKUHandler
+{
+
+    public static void encodeSKU(SKU obj, SimpleValue target)
+    {
+        String digits;
+        if (obj.getDigits() &lt; 10)
+            digits = "00" + Integer.toString(obj.getDigits());
+        else if (obj.getDigits() &lt; 100)
+            digits = "0" + Integer.toString(obj.getDigits());
+        else
+            digits = Integer.toString(obj.getDigits());
+        target.setStringValue(digits + "-" + obj.getLetters());
+    }
+
+    public static SKU decodeSKU(SimpleValue obj) throws XmlValueOutOfRangeException
+    {
+        String encoded = obj.getStringValue();
+        if (encoded.length() != 6)
+            throw new XmlValueOutOfRangeException("Invalid SKU format: " + encoded);
+
+        SKU sku = new SKU();
+        try
+        {
+            sku.setDigits(Integer.parseInt(encoded.substring(0,3)));
+        } catch (NumberFormatException e) {
+            throw new XmlValueOutOfRangeException("Invalid SKU format: " + encoded);
+        } catch (IllegalArgumentException e) {
+            throw new XmlValueOutOfRangeException("Invalid SKU format: " + encoded);
+        }
+
+        sku.setLetters(encoded.substring(4,6));
+        return sku;
+    }
+}

Added: xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/checkin/AverageTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/checkin/AverageTest.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/checkin/AverageTest.java (added)
+++ xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/checkin/AverageTest.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,222 @@
+/*   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package xmlobject.usertype.multipleItems.checkin;
+
+
+import java.math.BigInteger;
+
+import junit.framework.TestCase;
+
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
+
+import usertype.xbean.multipleItems.company.CompanyDocument;
+import usertype.xbean.multipleItems.company.CompanyType;
+import usertype.xbean.multipleItems.company.ConsultantType;
+import usertype.xbean.multipleItems.company.DepartmentType;
+import xmlobject.usertype.multipleItems.existing.Room;
+
+
+public class AverageTest extends TestCase{
+
+    public  AverageTest(String s){
+        super(s);
+    }
+
+    public void test() {
+
+        CompanyDocument doc;
+
+        doc = CompanyDocument.Factory.newInstance();
+
+        CompanyType company = doc.addNewCompany();
+
+        DepartmentType dept = company.addNewDepartments();
+
+
+        ConsultantType cons = dept.addNewConsultant();
+
+        cons.setName("Joe Smith");
+        cons.setAge(BigInteger.valueOf(100));
+
+        int LEN=20;
+
+        for (int i=0; i &lt; LEN; i++) {
+            cons.addRoom(new Room(i, "AB"));
+        }
+
+        System.out.println(doc.xmlText());
+
+        Room[] rooms = cons.getRoomArray();
+
+        for (int i=0; i &lt; LEN; i++) {
+            assertEquals(i, rooms[i].getDigits());
+            assertEquals("AB", rooms[i].getLetters());
+        }
+    }
+
+
+    public void testArrayGetSet() {
+
+        CompanyDocument doc;
+
+        doc = CompanyDocument.Factory.newInstance();
+
+        CompanyType company = doc.addNewCompany();
+
+        DepartmentType dept = company.addNewDepartments();
+
+
+        ConsultantType cons = dept.addNewConsultant();
+
+        cons.setName("Joe Smith");
+        cons.setAge(BigInteger.valueOf(100));
+
+        int LEN=20;
+
+        Room[] rooms = new Room[LEN];
+
+        for (int i=0; i &lt; LEN; i++) {
+            rooms[i] = new Room(i, "AB");
+        }
+
+        cons.setRoomArray(rooms);
+
+        rooms = cons.getRoomArray();
+        for (int i=0; i &lt; LEN; i++) {
+            assertEquals(i, rooms[i].getDigits());
+            assertEquals("AB", rooms[i].getLetters());
+        }
+
+
+    }
+
+    public void testIthGetSet() {
+
+        CompanyDocument doc;
+
+        doc = CompanyDocument.Factory.newInstance();
+
+        CompanyType company = doc.addNewCompany();
+
+        DepartmentType dept = company.addNewDepartments();
+
+
+        ConsultantType cons = dept.addNewConsultant();
+
+        cons.setName("Joe Smith");
+        cons.setAge(BigInteger.valueOf(100));
+
+
+        int LEN=20;
+
+        for (int i=0; i &lt; LEN; i++) {
+            cons.addNewRoom();
+        }
+
+
+        for (int i=0; i &lt; LEN; i++) {
+            cons.setRoomArray(i, new Room(i, "AB"));
+        }
+
+        for (int i=0; i &lt; LEN; i++) {
+            assertEquals(i, cons.getRoomArray(i).getDigits());
+            assertEquals("AB", cons.getRoomArray(i).getLetters());
+        }
+
+
+    }
+
+
+    public void testBadInput() throws XmlException{
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("&lt;com:company xmlns:com=\"http://xbean.usertype/multipleItems/company\"&gt;");
+        sb.append("&lt;departments&gt;&lt;consultant name=\"Joe Smith\" age=\"100\"&gt;");
+        sb.append("&lt;room&gt;000-AB&lt;/room&gt;&lt;room&gt;0001-AB&lt;/room&gt;&lt;room&gt;002-AB&lt;/room&gt;");
+        sb.append("&lt;/consultant&gt;&lt;/departments&gt;&lt;/com:company&gt;");
+
+        CompanyDocument doc = CompanyDocument.Factory.parse(sb.toString());
+
+        CompanyType company = doc.getCompany();
+
+        ConsultantType cons = company.getDepartmentsArray(0).getConsultantArray(0);
+        assertEquals(3, cons.xgetRoomArray().length);
+
+        try
+        {
+            cons.getRoomArray();
+            fail("Invalid Room format should have failed");
+
+        } catch (XmlValueOutOfRangeException e) {
+
+            // test passed
+        }
+
+    }
+
+
+
+    public void testBadInputGetIthBad() throws XmlException{
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("&lt;com:company xmlns:com=\"http://xbean.usertype/multipleItems/company\"&gt;");
+        sb.append("&lt;departments&gt;&lt;consultant name=\"Joe Smith\" age=\"100\"&gt;");
+        sb.append("&lt;room&gt;000-AB&lt;/room&gt;&lt;room&gt;0001-AB&lt;/room&gt;&lt;room&gt;002-AB&lt;/room&gt;");
+        sb.append("&lt;/consultant&gt;&lt;/departments&gt;&lt;/com:company&gt;");
+
+        CompanyDocument doc = CompanyDocument.Factory.parse(sb.toString());
+
+        CompanyType company = doc.getCompany();
+
+        ConsultantType cons = company.getDepartmentsArray(0).getConsultantArray(0);
+        assertEquals(3, cons.xgetRoomArray().length);
+
+        try
+        {
+            cons.getRoomArray(1);
+            fail("Invalid Room format should have failed");
+        } catch (XmlValueOutOfRangeException e) {
+
+            // test passed
+        }
+
+    }
+
+
+    public void testBadInputGetIthGood() throws XmlException{
+
+        StringBuffer sb = new StringBuffer();
+        sb.append("&lt;com:company xmlns:com=\"http://xbean.usertype/multipleItems/company\"&gt;");
+        sb.append("&lt;departments&gt;&lt;consultant name=\"Joe Smith\" age=\"100\"&gt;");
+        sb.append("&lt;room&gt;000-AB&lt;/room&gt;&lt;room&gt;0001-AB&lt;/room&gt;&lt;room&gt;002-AB&lt;/room&gt;");
+        sb.append("&lt;/consultant&gt;&lt;/departments&gt;&lt;/com:company&gt;");
+
+        CompanyDocument doc = CompanyDocument.Factory.parse(sb.toString());
+
+        CompanyType company = doc.getCompany();
+
+        ConsultantType cons = company.getDepartmentsArray(0).getConsultantArray(0);
+        assertEquals(3, cons.xgetRoomArray().length);
+
+        assertEquals(0, cons.getRoomArray(0).getDigits());
+        assertEquals("AB", cons.getRoomArray(0).getLetters());
+        assertEquals(2, cons.getRoomArray(2).getDigits());
+        assertEquals("AB", cons.getRoomArray(2).getLetters());
+
+    }
+
+}

Added: xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/Room.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/Room.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/Room.java (added)
+++ xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/Room.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,42 @@
+package xmlobject.usertype.multipleItems.existing;
+
+public class Room
+{
+    private int digits;
+    private String letters;
+
+
+    public Room()
+    {
+    }
+
+    public Room(int digits, String letters)
+    {
+        setDigits(digits);
+        setLetters(letters);
+    }
+
+    public int getDigits()
+    {
+        return digits;
+    }
+
+    public void setDigits(int digits)
+    {
+        if (digits &gt; 999 || digits &lt; 0)
+            throw new IllegalArgumentException("bad digits");
+        this.digits = digits;
+    }
+
+    public String getLetters()
+    {
+        return letters;
+    }
+
+    public void setLetters(String letters)
+    {
+        if (letters == null || letters.length() != 2)
+            throw new IllegalArgumentException("bad letters");
+        this.letters = letters;
+    }
+}

Added: xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/RoomHandler.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/RoomHandler.java?rev=769119&amp;view=auto
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/RoomHandler.java (added)
+++ xmlbeans/trunk/test/src/xmlobject/usertype/multipleItems/existing/RoomHandler.java Mon Apr 27 19:31:13 2009
@@ -0,0 +1,41 @@
+package xmlobject.usertype.multipleItems.existing;
+
+import org.apache.xmlbeans.SimpleValue;
+import org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException;
+
+public class RoomHandler
+{
+
+    public static void encodeRoom(Room obj, SimpleValue target)
+    {
+        String digits;
+        if (obj.getDigits() &lt; 10)
+            digits = "00" + Integer.toString(obj.getDigits());
+        else if (obj.getDigits() &lt; 100)
+            digits = "0" + Integer.toString(obj.getDigits());
+        else
+            digits = Integer.toString(obj.getDigits());
+        target.setStringValue(digits + "-" + obj.getLetters());
+    }
+
+
+    public static Room decodeRoom(SimpleValue obj) throws XmlValueOutOfRangeException
+    {
+        String encoded = obj.getStringValue();
+        if (encoded.length() != 6)
+            throw new XmlValueOutOfRangeException("Invalid Room format: " + encoded);
+
+        Room sku = new Room();
+        try
+        {
+            sku.setDigits(Integer.parseInt(encoded.substring(0,3)));
+        } catch (NumberFormatException e) {
+            throw new XmlValueOutOfRangeException("Invalid Room format: " + encoded);
+        } catch (IllegalArgumentException e) {
+            throw new XmlValueOutOfRangeException("Invalid Room format: " + encoded);
+        }
+
+        sku.setLetters(encoded.substring(4,6));
+        return sku;
+    }
+}

Modified: xmlbeans/trunk/testbuild.xml
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/testbuild.xml?rev=769119&amp;r1=769118&amp;r2=769119&amp;view=diff
==============================================================================
--- xmlbeans/trunk/testbuild.xml (original)
+++ xmlbeans/trunk/testbuild.xml Mon Apr 27 19:31:13 2009
@@ -256,7 +256,8 @@
         ${build.dir.test.schemas}/xbean/xmlobject/store,
         ${build.dir.test.schemas}/xbean/xmltokensource,
         ${build.dir.test.schemas}/xbean/ValidatingStream,
-        ${build.dir.test.schemas}/xbean/scomp"/&gt;
+        ${build.dir.test.schemas}/xbean/scomp,
+        ${build.dir.test.schemas}/xbean/usertype"/&gt;
     &lt;!-- comma separated list of directories containing schemas that *must* be separately
          compiled --&gt;
     &lt;property name="schema.standalone"
@@ -571,7 +572,7 @@
     &lt;!-- NOTE: This target depends on build.schemas, but we do not
                explicitly put it on the depends list. --&gt;
 
-    &lt;target name="build.tests" depends="init, build.test.tools, build.xpath,extensions.build"
+    &lt;target name="build.tests" depends="init, build.test.tools, build.xpath,extensions.build,usertype.build"
         description="Build the tests"&gt;
 
         &lt;javac srcdir="${xbeans.test.src}"
@@ -646,6 +647,12 @@
                 &lt;antcall target="extensions.build"/&gt;
             &lt;/then&gt;
         &lt;/if&gt;
+        &lt;if&gt;
+            &lt;isset property="compile.usertype"/&gt;
+            &lt;then&gt;
+                &lt;antcall target="usertype.build"/&gt;
+            &lt;/then&gt;
+        &lt;/if&gt;
         &lt;antcall target="build.xmlcases"/&gt;
         &lt;antcall target="build.xsdcases"/&gt;
 
@@ -708,6 +715,37 @@
 
         &lt;/foreachloop&gt;
     &lt;/target&gt;
+    &lt;!--User type feature--&gt;
+    &lt;target name="usertype.build" depends="init"&gt;
+        &lt;echo message="Building user types"/&gt;
+        &lt;foreachloop
+            param="case" trim="true"&gt;
+            &lt;path&gt;
+                &lt;dirset dir="${xbeans.test.src}/xmlobject/usertype/"&gt;
+                    &lt;include name="*"/&gt;
+                &lt;/dirset&gt;
+            &lt;/path&gt;
+            &lt;loop&gt;
+                &lt;basename property="testcase" path="${case}"/&gt;
+                
+                &lt;available file="${build.dir.test.schemas.lib}/usertype_${testcase}.jar" property="usertypejar.exists"/&gt;
+                &lt;echo message="JAR ${build.dir.test.schemas.lib}/usertype_${testcase}.jar, Exists: ${usertypejar.exists}"/&gt;
+                &lt;if&gt;
+                    &lt;isfalse value="${usertypejar.exists}"/&gt;
+                    &lt;then&gt;
+                        &lt;java classname="${schema.compiler}"
+                            classpathref="build.classpath"
+                            fork="true"&gt;
+                            &lt;arg line="-out ${build.dir.test.schemas.lib}/usertype_${testcase}.jar
+                            ${case}/existing
+                            ${xbeans.test.cases}/xbean/usertype/${testcase}"
+                                /&gt;
+                        &lt;/java&gt;
+                    &lt;/then&gt;
+                &lt;/if&gt;
+            &lt;/loop&gt;
+        &lt;/foreachloop&gt;
+    &lt;/target&gt;
 
     &lt;!--test xmlbeans task--&gt;
     &lt;target name="xmlbean-test" depends="init"&gt;
@@ -733,6 +771,7 @@
             ${schema.standalone}/SimpleRailCarrierWaybillInterchange_V40_LX.xsd,
             ${schema.standalone}/TerminalOperationsAndIntermodalRampActivity_V40_LX.xsd,"/&gt;
         &lt;property name="compile.extensions" value="true"/&gt;
+        &lt;property name="compile.usertype" value="true"/&gt;
 
         &lt;property name="includes.for.compile"
             value="**/xmlobject/**/*.java"/&gt;
@@ -830,7 +869,7 @@
     &lt;/target&gt;
 
     &lt;!-- FREQ Target --&gt;
-    &lt;target name="build.area.checkin" depends="clean.tests,extensions.build"&gt;
+    &lt;target name="build.area.checkin" depends="clean.tests,extensions.build,usertype.build"&gt;
         &lt;property name="includes.for.compile"
             value="**/checkin/**/*.java,
                    **/common/**/*.java"/&gt;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[Xmlbeans Wiki] Update of &quot;V2Features&quot; by WesleyLeggette</title>
<author><name>Apache Wiki &lt;wikidiffs@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200904.mbox/%3c20090424050943.3682.11941@eos.apache.org%3e"/>
<id>urn:uuid:%3c20090424050943-3682-11941@eos-apache-org%3e</id>
<updated>2009-04-24T05:09:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlbeans Wiki" for change notification.

The following page has been changed by WesleyLeggette:
http://wiki.apache.org/xmlbeans/V2Features

------------------------------------------------------------------------------
  
   * '''Pre and Post methods''' -  In addition to being able to extend XMLBeans generated
Java classes there have been many requests for event type methods.  In Version 2 (may be implemented
in Version 1 also) you will be able to specify ''Pre''' and '''Post''' methods that will be
called before and after changes to the XMLBeans properties.  '''7/14/04 - Note the first version
of this feature has been implemented see this wiki page http://wiki.apache.org/xmlbeans/PrePostSetFeature
for specifics''. 
  
-  * '''User Types''' - Custom user types for simple values {{{UserTypes}}}. 
+  * '''User Types''' - Custom user types for simple values. See http://wiki.apache.org/xmlbeans/UserTypes
for specifics. 
  
   * '''Performance''' - As in XMLBeans V1 performance is paramount V2.  Since XMLBeans always
loads an XML Store and then provides a binding view on to the store some amount of additional
overhead, compared to other Java/XML binding frameworks that unmarshal directly to Java objects
(but throw away XML Infoset info that doesn't fit into the Java objects).  This makes the
performance bar all the higher for XMLBeans so that the tradeoff for additional functionality
and information is minimal.  The primary focus for runtime performance is in the area of the
XML Store although there are other factors to consider as well (for example parsing).  Every
effort will be made to make the XML Store as highly performant as possible.  Benchmarks against
related technologies need to be created (with source for the benchmarks available of course)
and performance tests included in the test suite to assure that performance regressions do
not occur in the development process. 
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[Xmlbeans Wiki] Update of &quot;V2Features&quot; by WesleyLeggette</title>
<author><name>Apache Wiki &lt;wikidiffs@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200904.mbox/%3c20090424050819.3394.39897@eos.apache.org%3e"/>
<id>urn:uuid:%3c20090424050819-3394-39897@eos-apache-org%3e</id>
<updated>2009-04-24T05:08:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlbeans Wiki" for change notification.

The following page has been changed by WesleyLeggette:
http://wiki.apache.org/xmlbeans/V2Features

------------------------------------------------------------------------------
  
   * '''Extensions''' -  In general XMLBeans generated interfaces have been pretty static,
in large part due to the XMLBeans overall objective to correctly support the XML Schema type
system (including the custome types defined in the schema) in Java.  You can map target namespace/package
and element/property names but that was about it.  In Version 2 (this may be ported to Version
1 as well) you will be able to add custom functionality to generated XMLBeans interfaces/classes.
 To accomplish this you will be able to pass the Schema Compiler two things 1) an interface
that defines the set of methods to implement and 2) a static handler which implements this
functionality (it is debatable whether this should be static or instance based, there are
arguments both ways).  The underlying XMLBeans generated classes will implement the interface
and for each method call out to the static handler.  Note that this capability allows XMLBeans
classes to ''be'' your interface, this could 
 allow certain binding type strategies to sit on top of XMLBeans.  For example, you could
imagine an SDO ([http://dev2dev.bea.com/technologies/commonj/sdo/index.jsp Service Data Objects])
implementation on top of XMLBeans such that the SDO {{{DataObject}}} interface could be implemented
by corresponding XMLBean(s).  ''7/14/04 - Note this feature has been implemented see this
wiki page http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature for more information''.
  
-  * '''Pre and Post methods''' -  In addition to being able to extend XMLBeans generated
Java classes there have been many requests for event type methods.  In Version 2 (may be implemented
in Version 1 also) you will be able to specify ''Pre''' and '''Post''' methods that will be
called before and after changes to the XMLBeans properties.  '''7/14/04 - Note the first version
of this feature has been implemented see this wiki page http://wiki.apache.org/xmlbeans/PrePostSetFeature
for specifics''.  
+  * '''Pre and Post methods''' -  In addition to being able to extend XMLBeans generated
Java classes there have been many requests for event type methods.  In Version 2 (may be implemented
in Version 1 also) you will be able to specify ''Pre''' and '''Post''' methods that will be
called before and after changes to the XMLBeans properties.  '''7/14/04 - Note the first version
of this feature has been implemented see this wiki page http://wiki.apache.org/xmlbeans/PrePostSetFeature
for specifics''. 
+ 
+  * '''User Types''' - Custom user types for simple values {{{UserTypes}}}. 
  
   * '''Performance''' - As in XMLBeans V1 performance is paramount V2.  Since XMLBeans always
loads an XML Store and then provides a binding view on to the store some amount of additional
overhead, compared to other Java/XML binding frameworks that unmarshal directly to Java objects
(but throw away XML Infoset info that doesn't fit into the Java objects).  This makes the
performance bar all the higher for XMLBeans so that the tradeoff for additional functionality
and information is minimal.  The primary focus for runtime performance is in the area of the
XML Store although there are other factors to consider as well (for example parsing).  Every
effort will be made to make the XML Store as highly performant as possible.  Benchmarks against
related technologies need to be created (with source for the benchmarks available of course)
and performance tests included in the test suite to assure that performance regressions do
not occur in the development process. 
  
@@ -44, +46 @@

  
   * '''DOM Eventing''' - DOM Eventing is challenging with the XML Store architecture and
may not be feasible.  XMLBeans will not address it in V2.
  
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[Xmlbeans Wiki] Update of &quot;UserTypes&quot; by WesleyLeggette</title>
<author><name>Apache Wiki &lt;wikidiffs@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200903.mbox/%3c20090329053827.7637.45504@aurora.apache.org%3e"/>
<id>urn:uuid:%3c20090329053827-7637-45504@aurora-apache-org%3e</id>
<updated>2009-03-29T05:38:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlbeans Wiki" for change notification.

The following page has been changed by WesleyLeggette:
http://wiki.apache.org/xmlbeans/UserTypes

------------------------------------------------------------------------------
  Assuming the user type is named {{{common:uuid}}} and maps to the Java type {{{java.util.UUID}}}
the method signatures must be:
  
  {{{
- public static void encodeUuid(java.util.UUID obj, org.apache.xmlbeans.SimpleValue target);
+ public static void encodeUuid(java.util.UUID obj, org.apache.xmlbeans.SimpleValue target)
+     throws XmlValueNotSupportedException, XmlValueOutOfRangeException;
  
- public static java.util.UUID decodeUuid(org.apache.xmlbeans.SimpleValue obj);
+ public static java.util.UUID decodeUuid(org.apache.xmlbeans.SimpleValue obj)
+     throws XmlValueNotSupportedException, XmlValueOutOfRangeException;
  }}}
  
  Assuming the user type is {{{myns:foobar}}} and maps to the Java type {{{com.example.Foobar}}}
the method signatures must be:
  
  {{{
- public static void encodeFoobar(com.example.Foobar obj, org.apache.xmlbeans.SimpleValue
target);
+ public static void encodeFoobar(com.example.Foobar obj, org.apache.xmlbeans.SimpleValue
target)
+     throws XmlValueNotSupportedException, XmlValueOutOfRangeException;
  
- public static com.example.Foobar decodeFoobar(org.apache.xmlbeans.SimpleValue obj);
+ public static com.example.Foobar decodeFoobar(org.apache.xmlbeans.SimpleValue obj)
+     throws XmlValueNotSupportedException, XmlValueOutOfRangeException;
  }}}
  
- The XML Schema should be written in a way to ensure that all possible validated {{{SimpleValue}}}
input is acceptable. As such, the static handler methods should not throw checked or runtime
exceptions if schema validation was successful. In the case where XML validation was not successful
it is expected that a runtime exception may be thrown from the static handler method. If callers
of the generated code do not validate input before using the convenience methods they should
be prepared to handle undefined runtime exceptions.
+ As XMLBeans is designed around a "start-from-Schema" use case, the encode and decode methods
must be written such that they are able to handle any value that is valid against the schema.
Because validation is an optional operation when loading XML there may be cases when a decoder
would be called with invalid input. In such cases either {{{org.apache.xmlbeans.impl.values.XmlValueNotSupportedException}}}
or {{{XmlValueOutOfRangeException}}} should be
+ thrown from the decode method. Such exceptions should not be thrown in cases where the XML
input has been successfully validated against the schema (this is just another way of stressing
that the decoder must accept all valid input according to the XML Schema). The encoder should
never throw such an exception.
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[Xmlbeans Wiki] Update of &quot;UserTypes&quot; by WesleyLeggette</title>
<author><name>Apache Wiki &lt;wikidiffs@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200903.mbox/%3c20090322160645.76.36416@aurora.apache.org%3e"/>
<id>urn:uuid:%3c20090322160645-76-36416@aurora-apache-org%3e</id>
<updated>2009-03-22T16:06:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlbeans Wiki" for change notification.

The following page has been changed by WesleyLeggette:
http://wiki.apache.org/xmlbeans/UserTypes

------------------------------------------------------------------------------
  public static com.example.Foobar decodeFoobar(org.apache.xmlbeans.SimpleValue obj);
  }}}
  
+ The XML Schema should be written in a way to ensure that all possible validated {{{SimpleValue}}}
input is acceptable. As such, the static handler methods should not throw checked or runtime
exceptions if schema validation was successful. In the case where XML validation was not successful
it is expected that a runtime exception may be thrown from the static handler method. If callers
of the generated code do not validate input before using the convenience methods they should
be prepared to handle undefined runtime exceptions.
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[Xmlbeans Wiki] Update of &quot;UserTypes&quot; by WesleyLeggette</title>
<author><name>Apache Wiki &lt;wikidiffs@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/xmlbeans-commits/200903.mbox/%3c20090322160018.28682.30230@aurora.apache.org%3e"/>
<id>urn:uuid:%3c20090322160018-28682-30230@aurora-apache-org%3e</id>
<updated>2009-03-22T16:00:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlbeans Wiki" for change notification.

The following page has been changed by WesleyLeggette:
http://wiki.apache.org/xmlbeans/UserTypes

------------------------------------------------------------------------------
  
  In the initial implementation, the generated code would use the Java reflect API to find
and invoke the static handler. This option allows users to build the schema separately from
the code that contains the static handler. However, because the use of reflection incurs a
performance penalty an option to generate code that calls the static handler directly would
likely be necessary for many library users.
  
+ == Static Handler Methods ==
+ 
+ The expected method signature on the static handler indicated for a specific type must be
public, static, and have a method name of "encode"/"decode" plus the unqualified name of the
user type. The unqualified name is required to allow multiple user types to be handled by
the same static handler class.
+ 
+ Assuming the user type is named {{{common:uuid}}} and maps to the Java type {{{java.util.UUID}}}
the method signatures must be:
+ 
+ {{{
+ public static void encodeUuid(java.util.UUID obj, org.apache.xmlbeans.SimpleValue target);
+ 
+ public static java.util.UUID decodeUuid(org.apache.xmlbeans.SimpleValue obj);
+ }}}
+ 
+ Assuming the user type is {{{myns:foobar}}} and maps to the Java type {{{com.example.Foobar}}}
the method signatures must be:
+ 
+ {{{
+ public static void encodeFoobar(com.example.Foobar obj, org.apache.xmlbeans.SimpleValue
target);
+ 
+ public static com.example.Foobar decodeFoobar(org.apache.xmlbeans.SimpleValue obj);
+ }}}
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org



</pre>
</div>
</content>
</entry>
</feed>
