You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ce...@apache.org on 2005/03/22 19:42:41 UTC

svn commit: r158637 - in xmlbeans/trunk: src/xmlcomp/org/apache/xmlbeans/impl/tool/ test/cases/xbean/misc/jira/ test/cases/xbean/tools/inst2xsd/options/ test/cases/xbean/tools/inst2xsd/schema/types/ test/cases/xbean/xmlobject/ test/src/misc/detailed/ test/src/tools/inst2xsd/common/ test/src/tools/inst2xsd/detailed/ test/src/xmlobject/detailed/

Author: cezar
Date: Tue Mar 22 10:42:37 2005
New Revision: 158637

URL: http://svn.apache.org/viewcvs?view=rev&rev=158637
Log:
Contributed by Jacob Danner. XMLBEANS-130 - Almost Completed fix for issue (did not verify unix line ending issue). Updated usage text to suggested and took care of noArg usage statements. dded missing files for inst2xsd tests as well as modifications to make tests run with correct expected result

Added:
    xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsd
    xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsdconfig
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_rd0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_ss0.xsd
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_vb0.xsd
Modified:
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/FactorImports.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCopy.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XsbDumper.java
    xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd
    xmlbeans/trunk/test/cases/xbean/xmlobject/SimpleXmlObject.java.txt
    xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java
    xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java
    xmlbeans/trunk/test/src/tools/inst2xsd/detailed/Inst2XsdDetailedOptionsTest.java
    xmlbeans/trunk/test/src/xmlobject/detailed/SubstGroupTests.java
    xmlbeans/trunk/test/src/xmlobject/detailed/TestsFromBugs.java
    xmlbeans/trunk/test/src/xmlobject/detailed/XmlObjectAbstractClassTest.java

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/FactorImports.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/FactorImports.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/FactorImports.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/FactorImports.java Tue Mar 22 10:42:37 2005
@@ -46,18 +46,23 @@
  * name definitions, and factors out the first instance of each of those into
  * a common.xsd file, adding an appropriate <import> statement in the original
  * xsd file.
- */ 
+ */
 public class FactorImports
 {
     public static void printUsage()
     {
-        System.out.println("Refactors a directory of .xsd files to remove name conflicts");
-        System.out.println("Usage:");
-        System.out.println("sfactor [-import common.xsd] [-out outputdir] inputdir");
-        System.out.println(" where inputdir is a directory containing .xsd files");
-        System.out.println(" and outputdir is a directory into which new xsd files,");
-        System.out.println(" plus a commonly imported common.xsd, is placed.");
-        System.out.println(" -license prints license information");
+        System.out.println("Refactors a directory of XSD files to remove name conflicts.");
+        System.out.println("Usage: sfactor [-import common.xsd] [-out outputdir] inputdir");
+        System.out.println("    -import common.xsd - The XSD file to contain redundant ");
+        System.out.println("                         definitions for importing.");
+        System.out.println("    -out outputdir - The directory into which to place XSD ");
+        System.out.println("                     files resulting from refactoring, ");
+        System.out.println("                     plus a commonly imported common.xsd.");
+        System.out.println("    inputdir - The directory containing the XSD files with");
+        System.out.println("               redundant definitions.");
+        System.out.println("    -license - Print license information.");
+        System.out.println();
+
     }
 
     public static void main(String[] args) throws Exception
@@ -70,7 +75,7 @@
         flags.add("version");
 
         CommandLine cl = new CommandLine(args, flags, Arrays.asList(new String[] {"import", "out"}));
-        if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null)
+        if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null || args.length < 1)
         {
             printUsage();
             System.exit(0);
@@ -107,11 +112,11 @@
             System.exit(0);
             return;
         }
-        
+
         String commonName = cl.getOpt("import");
         if (commonName == null)
             commonName = "common.xsd";
-        
+
         String out = cl.getOpt("out");
         if (out == null)
         {
@@ -120,7 +125,7 @@
         }
         File outdir = new File(out);
         File basedir = new File(args[0]);
-        
+
         // first, parse all the schema files
         File[] files = cl.getFiles();
         Map schemaDocs = new HashMap();
@@ -129,14 +134,14 @@
         Set typeNames = new HashSet();
         Set modelGroupNames = new HashSet();
         Set attrGroupNames = new HashSet();
-        
+
         Set dupeElementNames = new HashSet();
         Set dupeAttributeNames = new HashSet();
         Set dupeTypeNames = new HashSet();
         Set dupeModelGroupNames = new HashSet();
         Set dupeAttrGroupNames = new HashSet();
         Set dupeNamespaces = new HashSet();
-        
+
         for (int i = 0; i < files.length; i++)
         {
             try
@@ -144,16 +149,16 @@
                 // load schema
                 SchemaDocument doc = SchemaDocument.Factory.parse(files[i]);
                 schemaDocs.put(doc, files[i]);
-                
+
                 // warn about for imports, includes
                 if (doc.getSchema().sizeOfImportArray() > 0 || doc.getSchema().sizeOfIncludeArray() > 0)
                     System.out.println("warning: " + files[i] + " contains imports or includes that are being ignored.");
-                
+
                 // collect together names
                 String targetNamespace = doc.getSchema().getTargetNamespace();
                 if (targetNamespace == null)
                     targetNamespace = "";
-                
+
                 TopLevelComplexType ct[] = doc.getSchema().getComplexTypeArray();
                 for (int j = 0; j < ct.length; j++)
                     noteName(ct[j].getName(), targetNamespace, typeNames, dupeTypeNames, dupeNamespaces);
@@ -169,15 +174,15 @@
                 TopLevelAttribute at[] = doc.getSchema().getAttributeArray();
                 for (int j = 0; j < at.length; j++)
                     noteName(at[j].getName(), targetNamespace, attributeNames, dupeAttributeNames, dupeNamespaces);
-                
+
                 NamedGroup gr[] = doc.getSchema().getGroupArray();
                 for (int j = 0; j < gr.length; j++)
                     noteName(gr[j].getName(), targetNamespace, modelGroupNames, dupeModelGroupNames, dupeNamespaces);
-                
+
                 NamedAttributeGroup ag[] = doc.getSchema().getAttributeGroupArray();
                 for (int j = 0; j < ag.length; j++)
                     noteName(ag[j].getName(), targetNamespace, attrGroupNames, dupeAttrGroupNames, dupeNamespaces);
-                
+
             }
             catch (XmlException e)
             {
@@ -190,14 +195,14 @@
                 return;
             }
         }
-        
+
         if (schemaDocs.size() == 0)
         {
             System.out.println("No schema files found.");
             System.exit(0);
             return;
         }
-        
+
         if (dupeTypeNames.size() + dupeElementNames.size() + dupeAttributeNames.size() +
                 dupeModelGroupNames.size() + dupeAttrGroupNames.size() == 0)
         {
@@ -205,7 +210,7 @@
             System.exit(0);
             return;
         }
-        
+
         // create a schema doc for each namespace to be imported
         Map commonDocs = new HashMap();
         Map commonFiles = new HashMap();
@@ -222,23 +227,23 @@
             commonDocs.put(namespace, commonDoc);
             commonFiles.put(commonDoc, commonFileFor(commonName, namespace, count++, outdir));
         }
-        
+
         // pull out all the duplicate definitions and drop them into the file
         // we reuse the elementNames (etc) sets to keep track of which definitions
         // we have already inserted.
         for (Iterator i = schemaDocs.keySet().iterator(); i.hasNext(); )
         {
             SchemaDocument doc = (SchemaDocument)i.next();
-            
+
             // collect together names
             String targetNamespace = doc.getSchema().getTargetNamespace();
             if (targetNamespace == null)
                 targetNamespace = "";
-            
+
             SchemaDocument commonDoc = (SchemaDocument)commonDocs.get(targetNamespace);
-            
+
             boolean needImport = false;
-                
+
             TopLevelComplexType ct[] = doc.getSchema().getComplexTypeArray();
             for (int j = ct.length - 1; j >= 0; j--)
             {
@@ -293,7 +298,7 @@
                 needImport = true;
                 doc.getSchema().removeElement(j);
             }
-                
+
             NamedAttributeGroup ag[] = doc.getSchema().getAttributeGroupArray();
             for (int j = 0; j < ag.length; j++)
             {
@@ -304,7 +309,7 @@
                 needImport = true;
                 doc.getSchema().removeElement(j);
             }
-            
+
             if (needImport)
             {
                 IncludeDocument.Include newInclude = doc.getSchema().addNewInclude();
@@ -315,7 +320,7 @@
                     newInclude.setSchemaLocation(relativeURIFor(outputFile, commonFile));
             }
         }
-        
+
         // make the directory for output
         if (!outdir.isDirectory() && !outdir.mkdirs())
         {
@@ -323,7 +328,7 @@
             System.exit(1);
             return;
         }
-        
+
         // now write all those docs back out.
         for (Iterator i = schemaDocs.keySet().iterator(); i.hasNext(); )
         {
@@ -335,16 +340,16 @@
             else
                 doc.save(outputFile, new XmlOptions().setSavePrettyPrint().setSaveAggresiveNamespaces());
         }
-        
+
         for (Iterator i = commonFiles.keySet().iterator(); i.hasNext(); )
         {
             SchemaDocument doc = (SchemaDocument)i.next();
             File outputFile = (File)commonFiles.get(doc);
             doc.save(outputFile, new XmlOptions().setSavePrettyPrint().setSaveAggresiveNamespaces());
         }
-        
+
     }
-    
+
     private static File outputFileFor(File file, File baseDir, File outdir)
     {
         URI base = baseDir.getAbsoluteFile().toURI();
@@ -355,12 +360,12 @@
             System.out.println("Cannot relativize " + file);
             return null;
         }
-        
+
         URI outbase = outdir.toURI();
         URI out = CodeGenUtil.resolve(outbase, rel);
         return new File(out);
     }
-    
+
     private static URI commonAncestor(URI first, URI second)
     {
         String firstStr = first.toString();
@@ -388,8 +393,8 @@
             return null;
         }
     }
-    
-    
+
+
     private static String relativeURIFor(File source, File target)
     {
         URI base = source.getAbsoluteFile().toURI();
@@ -398,7 +403,7 @@
         URI commonBase = commonAncestor(base, abs);
         if (commonBase == null)
             return abs.toString();
-        
+
         URI baserel = commonBase.relativize(base);
         URI targetrel = commonBase.relativize(abs);
         if (baserel.isAbsolute() || targetrel.isAbsolute())
@@ -415,7 +420,7 @@
         }
         return prefix + targetrel.toString();
     }
-    
+
     private static File commonFileFor(String commonName, String namespace, int i, File outdir)
     {
         String name = commonName;
@@ -428,8 +433,8 @@
         }
         return new File(outdir, name);
     }
-    
-    
+
+
     private static void noteName(String name, String targetNamespace, Set seen, Set dupes, Set dupeNamespaces)
     {
         if (name == null)
@@ -442,9 +447,9 @@
         }
         else
             seen.add(qName);
-        
+
     }
-        
+
     private static boolean isFirstDuplicate(String name, String targetNamespace, Set notseen, Set dupes)
     {
         if (name == null)
@@ -457,7 +462,7 @@
         }
         return false;
     }
-    
+
     private static boolean isDuplicate(String name, String targetNamespace, Set dupes)
     {
         if (name == null)
@@ -465,6 +470,6 @@
         QName qName = new QName(targetNamespace, name);
         return (dupes.contains(qName));
     }
-        
-    
+
+
 }

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java Tue Mar 22 10:42:37 2005
@@ -34,14 +34,15 @@
 {
     public static void printUsage()
     {
-        System.out.println("Validates a schema defintion and instances within the schema.");
-        System.out.println("Usage: validate [switches] schema.jar schema.xsd instance.xml");
-        System.out.println("Switches:");
-        System.out.println("    -dl    enable network downloads for imports and includes");
-        System.out.println("    -nopvr disable particle valid (restriction) rule");
-        System.out.println("    -noupa diable unique particle attributeion rule");
-        System.out.println("    -partial allow partial schema type system");
-        System.out.println("    -license prints license information");
+        System.out.println("Validates the specified instance against the specified schema.");
+        System.out.println("Contrast with the svalidate tool, which validates using a stream.");
+        System.out.println("Usage: validate [-dl] [-nopvr] [-noupa] [-license] schema.xsd instance.xml");
+        System.out.println("Options:");
+        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("    -partial - allow partial schema type system");
+        System.out.println("    -license - prints license information");
     }
 
     public static void main(String[] args)
@@ -59,7 +60,7 @@
 
         CommandLine cl = new CommandLine(args, flags, Collections.EMPTY_SET);
 
-        if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null)
+        if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null || args.length < 1)
         {
             printUsage();
             System.exit(0);
@@ -94,19 +95,19 @@
         {
             return;
         }
-        
+
         boolean dl = (cl.getOpt("dl") != null);
         boolean nopvr = (cl.getOpt("nopvr") != null);
         boolean noupa = (cl.getOpt("noupa") != null);
         boolean partial = (cl.getOpt("partial") != null);
-        
+
         File[] schemaFiles = cl.filesEndingWith(".xsd");
         File[] instanceFiles = cl.filesEndingWith(".xml");
         File[] jarFiles = cl.filesEndingWith(".jar");
-        
+
         List sdocs = new ArrayList();
-        
-        
+
+
         for (int i = 0; i < schemaFiles.length; i++)
         {
             try
@@ -135,10 +136,10 @@
             schemaOptions.setCompileNoUpaRule();
         if (partial)
             schemaOptions.put("COMPILE_PARTIAL_TYPESYSTEM");
-        
+
         if (jarFiles != null && jarFiles.length > 0)
             sLoader = XmlBeans.typeLoaderForResource(XmlBeans.resourceLoaderForPath(jarFiles));
-        
+
         try
         {
             if (schemas != null && schemas.length > 0)
@@ -155,7 +156,7 @@
                 System.out.println(i.next());
             return;
         }
-        
+
         // recovered from errors, print out errors
         if (partial && !compErrors.isEmpty())
         {
@@ -166,11 +167,11 @@
 
         if (sLoader == null)
             sLoader = XmlBeans.getContextTypeLoader();
-        
+
         for (int i = 0; i < instanceFiles.length; i++)
         {
             XmlObject xobj;
-            
+
             try
             {
                 xobj =

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCopy.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCopy.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCopy.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCopy.java Tue Mar 22 10:42:37 2005
@@ -38,12 +38,21 @@
 
 public class SchemaCopy
 {
+    public static void printUsage()
+    {
+        System.out.println("Copies the XML schema at the specified URL to the specified file.");
+        System.out.println("Usage: scopy sourceurl [targetfile]");
+        System.out.println("    sourceurl - The URL at which the schema is located.");
+        System.out.println("    targetfile - The file to which the schema should be copied.");
+        System.out.println();
+
+    }
 
     public static void main(String[] args)
     {
         if (args.length < 1 || args.length > 2)
         {
-            System.out.println("Usage: schemacopy sourceurl [targetfile]");
+            printUsage();
             return;
         }
 
@@ -52,6 +61,11 @@
 
         try
         {
+            if(args[0].compareToIgnoreCase("-usage") == 0){
+                printUsage();
+                return;
+            }
+
             source = new URI(args[0]);
             source.toURL(); // to trigger exception
         }
@@ -167,10 +181,10 @@
 
         return result;
     }
-    
+
     private static final XmlOptions loadOptions = new XmlOptions().
             setLoadSubstituteNamespaces(Collections.singletonMap(
-                    "http://schemas.xmlsoap.org/wsdl/", "http://www.apache.org/internal/xmlbeans/wsdlsubst" 
+                    "http://schemas.xmlsoap.org/wsdl/", "http://www.apache.org/internal/xmlbeans/wsdlsubst"
             ));
 
     private static Map findRelativeInOne(URI source, URI target)

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java Tue Mar 22 10:42:37 2005
@@ -43,13 +43,15 @@
 
     public static void printUsage()
     {
-        System.out.println("Validates a schema defintion and instances within the schema.");
-        System.out.println("Usage: validate [switches] schema.xsd instance.xml");
-        System.out.println("Switches:");
-        System.out.println("    -dl    enable network downloads for imports and includes");
-        System.out.println("    -nopvr disable particle valid (restriction) rule");
-        System.out.println("    -noupa diable unique particle attributeion rule");
-        System.out.println("    -license prints license information");
+        System.out.println("Validates the specified instance against the specified schema.");
+        System.out.println("A streaming validation useful for validating very large instance ");
+        System.out.println("documents with less memory. Contrast with the validate tool.");
+        System.out.println("Usage: svalidate [-dl] [-nopvr] [-noupa] [-license] schema.xsd instance.xml");
+        System.out.println("Options:");
+        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("    -license - prints license information");
     }
 
     public static void main(String[] args)
@@ -65,7 +67,7 @@
         flags.add("noupa");
 
         CommandLine cl = new CommandLine(args, flags, Collections.EMPTY_SET);
-        if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null)
+        if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null || args.length < 1)
         {
             printUsage();
             System.exit(0);
@@ -137,7 +139,7 @@
 
         if (jarFiles != null && jarFiles.length > 0)
             sLoader = XmlBeans.typeLoaderForResource(XmlBeans.resourceLoaderForPath(jarFiles));
-        
+
         try {
             if (schemas != null && schemas.length > 0)
                 sLoader = XmlBeans.compileXsd(schemas, sLoader, schemaOptions);
@@ -182,7 +184,7 @@
 
                 time = System.currentTimeMillis();
                 vsr.init(rdr, true, null, sLoader, options, errors);
-                
+
                 while (vsr.hasNext()) {
                     vsr.next();
                 }

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java Tue Mar 22 10:42:37 2005
@@ -42,8 +42,15 @@
 {
     public static void printUsage()
     {
-        System.out.println("Prints inheritance hierarchy of types defined in a schema.");
-        System.out.println("Usage: xsdtree [-noanon] [-nopvr] [-noupa] [-partial] [-license] file1.xsd file2.xsd ...");
+        System.out.println("Prints the inheritance hierarchy of types defined in a schema.\n");
+        System.out.println("Usage: xsdtree [-noanon] [-nopvr] [-noupa] [-partial] [-license] schemafile.xsd*");
+        System.out.println("    -noanon - Don't include anonymous types in the tree.");
+        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("    -partial - Print only part of the hierarchy.");
+        System.out.println("    -license - prints license information");
+        System.out.println("    schemafile.xsd - File containing the schema for which to print a tree.");
+        System.out.println();
     }
 
     public static void main(String[] args) throws Exception
@@ -96,15 +103,15 @@
             printUsage();
             return;
         }
-        
+
         boolean noanon = (cl.getOpt("noanon") != null);
         boolean nopvr = (cl.getOpt("nopvr") != null);
         boolean noupa = (cl.getOpt("noupa") != null);
         boolean partial = (cl.getOpt("partial") != null);
-        
+
         File[] schemaFiles = cl.filesEndingWith(".xsd");
         File[] jarFiles = cl.filesEndingWith(".jar");
-        
+
         // step 1: load all the files
         List sdocs = new ArrayList();
         for (int i = 0; i < schemaFiles.length; i++)
@@ -120,10 +127,10 @@
                 System.err.println( schemaFiles[i] + " not loadable: " + e );
             }
         }
-        
+
 
         XmlObject[] schemas = (XmlObject[])sdocs.toArray(new XmlObject[0]);
-        
+
         // step 2: compile all the schemas
         SchemaTypeLoader linkTo = null;
         SchemaTypeSystem typeSystem;
@@ -137,10 +144,10 @@
             schemaOptions.setCompileNoUpaRule();
         if (partial)
             schemaOptions.put("COMPILE_PARTIAL_TYPESYSTEM");
-        
+
         if (jarFiles != null && jarFiles.length > 0)
             linkTo = XmlBeans.typeLoaderForResource(XmlBeans.resourceLoaderForPath(jarFiles));
-        
+
         try
         {
             typeSystem = XmlBeans.compileXsd(schemas, linkTo, schemaOptions);
@@ -154,7 +161,7 @@
                 System.out.println(i.next());
             return;
         }
-        
+
         // step 2.5: recovered from errors, print out errors
         if (partial && !compErrors.isEmpty())
         {
@@ -162,16 +169,16 @@
             for (Iterator i = compErrors.iterator(); i.hasNext(); )
                 System.out.println(i.next());
         }
-        
+
         // step 3: go through all the types, and note their base types and namespaces
         Map prefixes = new HashMap();
         prefixes.put("http://www.w3.org/XML/1998/namespace", "xml");
         prefixes.put("http://www.w3.org/2001/XMLSchema", "xs");
         System.out.println("xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"");
-        
+
         // This will be a map of (base SchemaType -> Collection of directly dervied types)
         Map childTypes = new HashMap();
-        
+
         // breadthfirst traversal of the type containment tree
         List allSeenTypes = new ArrayList();
         allSeenTypes.addAll(Arrays.asList(typeSystem.documentTypes()));
@@ -181,32 +188,32 @@
         for (int i = 0; i < allSeenTypes.size(); i++)
         {
             SchemaType sType = (SchemaType)allSeenTypes.get(i);
-            
+
             // recurse through nested anonymous types as well
             if (!noanon)
                 allSeenTypes.addAll(Arrays.asList(sType.getAnonymousTypes()));
-            
+
             // we're not interested in document types, attribute types, or chasing the base type of anyType
             if (sType.isDocumentType() || sType.isAttributeType() || sType == XmlObject.type)
                 continue;
-            
+
             // assign a prefix to the namespace of this type if needed
             noteNamespace(prefixes, sType);
-            
+
             // enter this type in the list of children of its base type
             Collection children = (Collection)childTypes.get(sType.getBaseType());
             if (children == null)
             {
                 children = new ArrayList();
                 childTypes.put(sType.getBaseType(), children);
-                
+
                 // the first time a builtin type is seen, add it too (to get a complete tree up to anyType)
                 if (sType.getBaseType().isBuiltinType())
                     allSeenTypes.add(sType.getBaseType());
             }
             children.add(sType);
         }
-        
+
         // step 4: print the tree, starting from xs:anyType (i.e., XmlObject.type)
         List typesToPrint = new ArrayList();
         typesToPrint.add(XmlObject.type);
@@ -229,12 +236,12 @@
             }
         }
     }
-    
+
     private static String notes(SchemaType sType)
     {
         if (sType.isBuiltinType())
             return " (builtin)";
-        
+
         if (sType.isSimpleType())
         {
             switch (sType.getSimpleVariety())
@@ -249,7 +256,7 @@
                     return "";
             }
         }
-        
+
         switch (sType.getContentType())
         {
             case SchemaType.MIXED_CONTENT:
@@ -260,20 +267,20 @@
                 return "";
         }
     }
-    
+
     private static void noteNamespace(Map prefixes, SchemaType sType)
     {
         String namespace = QNameHelper.namespace(sType);
         if (namespace.equals("") || prefixes.containsKey(namespace))
             return;
-        
+
         String base = QNameHelper.suggestPrefix(namespace);
         String result = base;
         for (int n = 0; prefixes.containsValue(result); n += 1)
         {
             result = base + n;
         }
-        
+
         prefixes.put(namespace, result);
         System.out.println("xmlns:" + result + "=\"" + namespace + "\"");
     }

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XsbDumper.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XsbDumper.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XsbDumper.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XsbDumper.java Tue Mar 22 10:42:37 2005
@@ -37,8 +37,24 @@
 
 public class XsbDumper
 {
+    public static void printUsage()
+    {
+        System.out.println("Prints the contents of an XSB file in human-readable form.");
+        System.out.println("An XSB file contains schema meta information needed to ");
+        System.out.println("perform tasks such as binding and validation.");
+        System.out.println("Usage: dumpxsb myfile.xsb");
+        System.out.println("    myfile.xsb - Path to an XSB file.");
+        System.out.println();
+    }
+
     public static void main(String[] args)
     {
+        if (args.length == 0) {
+            printUsage();
+            System.exit(0);
+            return;
+        }
+
         for (int i = 0; i < args.length; i++)
         {
             dump(new File(args[i]), true);
@@ -377,7 +393,7 @@
 
         // qname map of document types, by the qname of the contained element
         dumpQNameMap("Document types");
-        
+
         // qname map of attribute types, by the qname of the contained attribute
         dumpQNameMap("Attribute types");
 
@@ -386,7 +402,7 @@
 
         // all the namespaces
         dumpStringArray("Defined namespaces");
-        
+
         // version 15 stuff for redefines
         if (atLeast(2, 15, 0))
         {
@@ -680,7 +696,7 @@
     {
         int n = readInt();
         if (n > 0)
-        {             
+        {
             emit("Top-level annotations (" + n + "):");
             indent();
             for (int i = 0; i < n; i++)
@@ -1018,7 +1034,7 @@
 
     private static final XmlOptions prettyOptions =
         new XmlOptions().setSavePrettyPrint();
-    
+
     void dumpXml()
     {
         String xml = readString();
@@ -1032,7 +1048,7 @@
             emit( xml );
         }
     }
-    
+
     void dumpModelGroupData()
     {
         emit("Name: " + qnameString(readQName()));
@@ -1148,7 +1164,7 @@
         String type = readType();
         if (type == null)
             return "null";
-        
+
         int btc = readShort();
         String value;
         switch (btc)

Added: xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsd
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsd?view=auto&rev=158637
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsd (added)
+++ xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsd Tue Mar 22 10:42:37 2005
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns="http://jira/xmlbeans98"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://jira/xmlbeans98"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified">
+
+    <xs:element name="childElement" type="childType"/>
+
+    <xs:complexType name="childType">
+		<xs:attribute name="qualified-data" type="xs:QName" use="required"/>
+	</xs:complexType>
+
+    <xs:element name="a-root">
+        <xs:complexType>
+			<xs:sequence>
+				<xs:element name="a-child" type="childType" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>

Added: xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsdconfig
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsdconfig?view=auto&rev=158637
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsdconfig (added)
+++ xmlbeans/trunk/test/cases/xbean/misc/jira/xmlbeans_97.xsdconfig Tue Mar 22 10:42:37 2005
@@ -0,0 +1,21 @@
+<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config"
+           xmlns:jira="http://jira/xmlbeans98">
+
+<xb:namespace uri="http://jira/xmlbeans98">
+    <xb:package>org.apache.jira.xmlbeans98</xb:package>
+</xb:namespace>
+
+
+
+<xb:namespace uri="http://jira/xmlbeans98">
+    <xb:prefix>Xml</xb:prefix>
+    <xb:suffix>Bean</xb:suffix>
+</xb:namespace>
+
+
+<!--<qname> specifies a Java class name for a Qualified name -->
+<xb:qname name="jira:childElement" javaname="QNameChanged"/>
+<xb:qname name="jira:a-root" javaname="TheRoot"/>
+
+
+</xb:config>

Modified: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd (original)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/options/base0.xsd Tue Mar 22 10:42:37 2005
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="baseNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-  <xs:element name="a" type="bas:aType" xmlns:bas="baseNamespace"/>
-  <xs:complexType name="aType">
-    <xs:sequence>
-      <xs:element type="xs:string" name="b" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
-      <xs:element type="xs:byte" name="c" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
-      <xs:element type="xs:string" name="d" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
-    </xs:sequence>
-  </xs:complexType>
+  <xs:element name="a">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element type="xs:string" name="b"/>
+        <xs:element type="xs:string" name="c"/>
+        <xs:element type="xs:string" name="d"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
 </xs:schema>

Added: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_rd0.xsd
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_rd0.xsd?view=auto&rev=158637
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_rd0.xsd (added)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_rd0.xsd Tue Mar 22 10:42:37 2005
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="comments" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>final comment</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element type="xs:string" name="b">
+          <xs:annotation>
+            <xs:documentation>this is a comment 1</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element type="xs:int" name="c">
+          <xs:annotation>
+            <xs:documentation>this is a comment 2</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element type="xs:string" name="d">
+          <xs:annotation>
+            <xs:documentation>this is a comment 4  this is a comment 5</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element type="xs:short" name="e">
+          <xs:annotation>
+            <xs:documentation>this is a comment 6</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element type="xs:string" name="f">
+          <xs:annotation>
+            <xs:documentation>this is a comment 7  this is a comment 8</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file

Added: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_ss0.xsd
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_ss0.xsd?view=auto&rev=158637
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_ss0.xsd (added)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_ss0.xsd Tue Mar 22 10:42:37 2005
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="comments" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="e" type="xs:short"/>
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>final comment</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="com:b" xmlns:com="comments">
+          <xs:annotation>
+            <xs:documentation>this is a comment 1</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="com:c" xmlns:com="comments">
+          <xs:annotation>
+            <xs:documentation>this is a comment 2</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="com:d" xmlns:com="comments">
+          <xs:annotation>
+            <xs:documentation>this is a comment 4  this is a comment 5</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="com:e" xmlns:com="comments">
+          <xs:annotation>
+            <xs:documentation>this is a comment 6</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+        <xs:element ref="com:f" xmlns:com="comments">
+          <xs:annotation>
+            <xs:documentation>this is a comment 7  this is a comment 8</xs:documentation>
+          </xs:annotation>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="d" type="xs:string"/>
+  <xs:element name="c" type="xs:int"/>
+  <xs:element name="f" type="xs:string"/>
+  <xs:element name="b" type="xs:string"/>
+</xs:schema>
\ No newline at end of file

Added: xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_vb0.xsd
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_vb0.xsd?view=auto&rev=158637
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_vb0.xsd (added)
+++ xmlbeans/trunk/test/cases/xbean/tools/inst2xsd/schema/types/comments_vb0.xsd Tue Mar 22 10:42:37 2005
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="comments" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="a" type="com:aType" xmlns:com="comments">
+    <xs:annotation>
+      <xs:documentation>final comment</xs:documentation>
+    </xs:annotation>
+  </xs:element>
+  <xs:complexType name="aType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="b">
+        <xs:annotation>
+          <xs:documentation>this is a comment 1</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element type="xs:int" name="c">
+        <xs:annotation>
+          <xs:documentation>this is a comment 2</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element type="xs:string" name="d">
+        <xs:annotation>
+          <xs:documentation>this is a comment 4  this is a comment 5</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element type="xs:short" name="e">
+        <xs:annotation>
+          <xs:documentation>this is a comment 6</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element type="xs:string" name="f">
+        <xs:annotation>
+          <xs:documentation>this is a comment 7  this is a comment 8</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file

Modified: xmlbeans/trunk/test/cases/xbean/xmlobject/SimpleXmlObject.java.txt
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/cases/xbean/xmlobject/SimpleXmlObject.java.txt?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/cases/xbean/xmlobject/SimpleXmlObject.java.txt (original)
+++ xmlbeans/trunk/test/cases/xbean/xmlobject/SimpleXmlObject.java.txt Tue Mar 22 10:42:37 2005
@@ -1,6 +1,6 @@
 
 import javax.xml.namespace.QName;
-import com.bea.xml.*;
+import org.apache.xmlbeans.*;
 
 import dumbNS.RootDocument;
 
@@ -29,8 +29,8 @@
             throws Exception
     {
         try {
-            String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
-                         "<root xmlns=\"dumbNS\" xmlns:bar=\"barNS\" b=\"3\" bar:b=\"4\"/>";
+            String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"+
+                         "<root xmlns=\"dumbNS:::\" xmlns:bar=\"barNS\" b=\"3\" bar:b=\"4\"/>";
             RootDocument rootDoc = (RootDocument)XmlObject.Factory.parse(xml);
             // Set the underlying XmlObject
             _under = (XmlObject) rootDoc;
@@ -47,6 +47,14 @@
     public XmlObject underlyingXmlObject()
     {
         return _under;
+    }
+
+    public XmlObject substitute(javax.xml.namespace.QName qName,org.apache.xmlbeans.SchemaType schemaType){
+        return underlyingXmlObject().substitute(qName, schemaType);
+    }
+
+    public void dump(){
+        System.out.println( _under.xmlText());
     }
 
     /**

Modified: xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java (original)
+++ xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java Tue Mar 22 10:42:37 2005
@@ -40,6 +40,7 @@
 import testDateAttribute.TestDatewTZone;
 import misc.common.JiraTestBase;
 import dufourrault.DummyDocument;
+import dufourrault.Father;
 import net.orthogony.xml.sample.structure.ARootDocument;
 import net.orthogony.xml.sample.structure.ChildType;
 
@@ -603,9 +604,8 @@
 
     }
 
-    /*
+    /**
     * [XMLBEANS-96]:XmlDocumentProperties missing version and encoding
-    *
     */
     public void test_jira_xmlbeans96() throws Exception {
         StringBuffer xmlstringbuf = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
@@ -620,8 +620,6 @@
 
     }
 
-
-
     /**
      * [XMLBEANS-98]   setSaveSuggestedPrefixes doesn't
      * work for QName attribute values
@@ -714,10 +712,35 @@
         xmlstringbuf.append("              </x:dummy>");
 
         try {
+            //From empty instance
+            DummyDocument newDoc = DummyDocument.Factory.newInstance();
+            DummyDocument.Dummy newDummy = newDoc.addNewDummy();
+            Node newNode = newDummy.newDomNode();
+            System.out.println("New Node = " + newNode);
+
+            //set Item
+            DummyDocument new2Doc = DummyDocument.Factory.newInstance();
+            DummyDocument.Dummy new2Dummy = new2Doc.addNewDummy();
+            Father newFather= Father.Factory.newInstance();
+            newFather.setSon("son");
+            new2Dummy.setFather(newFather);
+            Node new2Node = new2Dummy.newDomNode();
+            System.out.println("SetFather Node = " + new2Node);
+
+            //With Loaded instance Document
             DummyDocument doc = DummyDocument.Factory.parse(xmlstringbuf.toString());
-            //Node node = doc.getDummy().getFather().newDomNode();
             Node node = doc.newDomNode();
             System.out.println("node = " + node);
+            //Just Element Type Node
+            dufourrault.DummyDocument.Dummy dummy = doc.addNewDummy();
+            Node typeNode = dummy.newDomNode();
+            System.out.println("TypeNode = "+typeNode);
+
+            dufourrault.Father fatherType = Father.Factory.newInstance();
+            fatherType.setSon("son");
+            Node fatherTypeNode = fatherType.newDomNode();
+            System.out.println("New Father Type Node: "+ fatherTypeNode);
+
         } catch (NullPointerException npe) {
             Assert.fail("test_jira_xmlbeans99() : Null Pointer Exception when create Dom Node");
         } catch (Exception e) {

Modified: xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java (original)
+++ xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java Tue Mar 22 10:42:37 2005
@@ -65,20 +65,22 @@
             "</a>";
     public static String base_expected_russian = "<xs:schema attributeFormDefault=\"unqualified\" elementFormDefault=\"qualified\" " +
             "targetNamespace=\"baseNamespace\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
-            "<xs:element name=\"a\" type=\"bas:aType\" xmlns:bas=\"baseNamespace\"/>" +
-            "<xs:complexType name=\"aType\" mixed=\"true\">" +
+            "<xs:element name=\"a\">" +
+            "<xs:complexType>" +
             "<xs:sequence>" +
-            "<xs:element type=\"xs:string\" name=\"b\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
-            "<xs:element type=\"xs:byte\" name=\"c\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
-            "<xs:element type=\"xs:string\" name=\"d\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
+            "<xs:element type=\"xs:string\" name=\"b\" />" +
+            "<xs:element type=\"xs:byte\" name=\"c\" />" +
+            "<xs:element type=\"xs:string\" name=\"d\" />" +
             "</xs:sequence>" +
             "</xs:complexType>" +
+            "</xs:element>" +
             "</xs:schema>";
 
     public static String base_expected_salami = "<xs:schema attributeFormDefault=\"unqualified\" elementFormDefault=\"qualified\" " +
             "targetNamespace=\"baseNamespace\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
+            "<xs:element name=\"c\" type=\"xs:byte\" />" +
             "<xs:element name=\"a\">" +
-            "<xs:complexType mixed=\"true\">" +
+            "<xs:complexType>" +
             "<xs:sequence>" +
             "<xs:element ref=\"bas:b\" xmlns:bas=\"baseNamespace\"/>" +
             "<xs:element ref=\"bas:c\" xmlns:bas=\"baseNamespace\"/>" +
@@ -86,15 +88,14 @@
             "</xs:sequence>" +
             "</xs:complexType>" +
             "</xs:element>" +
-            "<xs:element name=\"b\" type=\"xs:string\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
-            "<xs:element name=\"c\" type=\"xs:byte\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>"+
-            "<xs:element name=\"d\" type=\"xs:string\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
+            "<xs:element name=\"b\" type=\"xs:string\" />" +
+            "<xs:element name=\"d\" type=\"xs:string\" />" +
             "</xs:schema>";
 
     public static String base_expected_venetian = "<xs:schema attributeFormDefault=\"unqualified\" elementFormDefault=\"qualified\" " +
             "targetNamespace=\"baseNamespace\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
             "<xs:element name=\"a\" type=\"bas:aType\" xmlns:bas=\"baseNamespace\"/>" +
-            "<xs:complexType name=\"aType\" mixed=\"true\">" +
+            "<xs:complexType name=\"aType\" >" +
             "<xs:sequence>" +
             "<xs:element type=\"xs:string\" name=\"b\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
             "<xs:element type=\"xs:byte\" name=\"c\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +

Modified: xmlbeans/trunk/test/src/tools/inst2xsd/detailed/Inst2XsdDetailedOptionsTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/tools/inst2xsd/detailed/Inst2XsdDetailedOptionsTest.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/src/tools/inst2xsd/detailed/Inst2XsdDetailedOptionsTest.java (original)
+++ xmlbeans/trunk/test/src/tools/inst2xsd/detailed/Inst2XsdDetailedOptionsTest.java Tue Mar 22 10:42:37 2005
@@ -349,7 +349,7 @@
         String stringContent = "<xs:schema attributeFormDefault =\"unqualified\" elementFormDefault=\"qualified\" " +
                 "targetNamespace=\"baseNamespace\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
                 "<xs:element name=\"a\" type=\"bas:aType\" xmlns:bas=\"baseNamespace\"/>" +
-                "<xs:complexType name=\"aType\" mixed=\"true\">" +
+                "<xs:complexType name=\"aType\">" +
                 "<xs:sequence>" +
                 "<xs:element type=\"xs:string\" name=\"b\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
                 "<xs:element type=\"xs:string\" name=\"c\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"/>" +
@@ -397,7 +397,7 @@
 
         XmlObject exp = XmlObject.Factory.parse(common.base_expected_salami, common.getXmlOptions());
         Inst2Xsd.main(new String[]{"-validate", "-verbose",
-                                   "-design", "rd",
+                                   "-design", "ss",
                                    "-outDir", OPTION_CASES_DIR,
                                    "-outPrefix", "base",
                                    BASEXML});

Modified: xmlbeans/trunk/test/src/xmlobject/detailed/SubstGroupTests.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlobject/detailed/SubstGroupTests.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/detailed/SubstGroupTests.java (original)
+++ xmlbeans/trunk/test/src/xmlobject/detailed/SubstGroupTests.java Tue Mar 22 10:42:37 2005
@@ -270,9 +270,30 @@
         System.out.println("QNAme:" + ItemDocument.type.getName());
         System.out.println("QNAme:" + name);
         System.out.println("BEAN: " + item.xmlText());
-        ItemType xm = (ItemType) item.getItem().substitute(name, ItemType.type);
-        System.out.println(xm == item.getItem());
-        //ItemDocument xm_opts = (ItemDocument) bean.substitute(name, ItemDocument.type);
+        ItemType xm = null;
+
+
+        try{
+
+            XmlObject xObj = (ItemType) item.getItem().substitute(name, ItemType.type);
+            System.out.println("XObj: "+xObj.xmlText());
+        }catch(NullPointerException npe){
+            System.out.println("NPE Thrown: "+npe.getMessage());
+            npe.printStackTrace();
+        }
+            System.out.println("");
+        boolean npeThrown = false;
+        try{
+            System.out.println(xm == item.getItem());
+        }catch(XmlValueDisconnectedException xvdEx){
+            npeThrown = true;
+        }
+
+        if( !npeThrown ){
+            Assert.fail("Referencing Item  after " +
+                    "substitute did not throw the expected NPE");
+        }
+            //ItemDocument xm_opts = (ItemDocument) bean.substitute(name, ItemDocument.type);
         //Assert.assertTrue("Invalid substitute should result in null object);
         ArrayList err = new ArrayList();
         XmlOptions opts = new XmlOptions();

Modified: xmlbeans/trunk/test/src/xmlobject/detailed/TestsFromBugs.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlobject/detailed/TestsFromBugs.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/detailed/TestsFromBugs.java (original)
+++ xmlbeans/trunk/test/src/xmlobject/detailed/TestsFromBugs.java Tue Mar 22 10:42:37 2005
@@ -114,7 +114,8 @@
     }
 
     /**
-     * Simple Compilation Tests.
+     * Simple Compilation Tests - If the methods are not present,
+     *                          - this class won't compile
      * Ensures method getSourceName is on SchemaComponent and
      * can be called from SchemaGlobalElement and SchemaGlobalAttribute
      * @throws Exception
@@ -128,42 +129,24 @@
                 "    xmlns:pre=\"noResolutionNamespace\"\n" +
                 "    elementFormDefault=\"qualified\"\n" +
                 "    attributeFormDefault=\"unqualified\">\n" +
-                "    <xs:element name=\"ItemRequest\" type=\"tns:ItemRequestType\"/>\n" +
-                "    <xs:complexType name=\"ItemRequestType\">\n" +
-                "        <xs:annotation>\n" +
-                "            <xs:documentation>\n" +
-                "                Ensure that XML content is allowed and not validated when the novdoc option is set\n" +
-                "                provided content is XHTML compliant and no elements use the schema namespaces\n" +
-                "                        <tns:ItemRequest>\n" +
-                "                            foobaz\n" +
-                "                        </tns:ItemRequest>\n" +
-                "                <xs:complexType name=\"foobar\">\n" +
-                "                    <xs:sequence>\n" +
-                "                        <xs:element name=\"foobaz\" type=\"pre:String\"/>\n" +
-                "                    </xs:sequence>\n" +
-                "                </xs:complexType>\n" +
-                "                provided content is XHTML compliant and no elements use the schema namespaces\n" +
-                "            </xs:documentation>\n" +
-                "        </xs:annotation>\n" +
-                "                <xs:sequence>\n" +
-                "                    <xs:element name=\"foobaz\" type=\"xs:string\">\n" +
-                "                        <xs:annotation>\n" +
-                "                            <xs:documentation>\n" +
-                "                   Ensure that XML content is allowed and not validated when the novdoc option is set\n" +
-                "                provided content is XHTML compliant and no elements use the schema namespaces\n" +
-                "                            </xs:documentation>\n" +
-                "                        </xs:annotation>\n" +
-                "                    </xs:element>\n" +
-                "                </xs:sequence>\n" +
-                "        <xs:attribute name=\"baz\" use=\"required\"/>\n" +
-                "    </xs:complexType>\n" +
+                "   <xs:element name=\"QuantityElement\" type=\"tns:quantity\" />"+
+                "   <xs:simpleType name=\"quantity\">\n" +
+                "    <xs:restriction base=\"xs:NMTOKEN\">\n" +
+                "      <xs:enumeration value=\"all\"/>\n" +
+                "      <xs:enumeration value=\"most\"/>\n" +
+                "      <xs:enumeration value=\"some\"/>\n" +
+                "      <xs:enumeration value=\"few\"/>\n" +
+                "      <xs:enumeration value=\"none\"/>\n" +
+                "    </xs:restriction>\n" +
+                "  </xs:simpleType>" +
                 "</xs:schema>";
 
         XmlObject[] schemas = new XmlObject[]{
             XmlObject.Factory.parse(str)};
+        XmlOptions xOpt = new XmlOptions().setValidateTreatLaxAsSkip();
 
         SchemaTypeSystem sts = XmlBeans.compileXmlBeans(null, null, schemas,
-                null, null, null, null);
+                null, XmlBeans.getBuiltinTypeSystem(), null, xOpt);
 
         //ensure SchemaGlobalElement has getSourceName Method
         SchemaGlobalElement[] sge = sts.globalElements();

Modified: xmlbeans/trunk/test/src/xmlobject/detailed/XmlObjectAbstractClassTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlobject/detailed/XmlObjectAbstractClassTest.java?view=diff&r1=158636&r2=158637
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/detailed/XmlObjectAbstractClassTest.java (original)
+++ xmlbeans/trunk/test/src/xmlobject/detailed/XmlObjectAbstractClassTest.java Tue Mar 22 10:42:37 2005
@@ -52,6 +52,7 @@
                 copyTo(r , to));
         assertTrue("Could not compile SimpleXmlObject.java",
                 compileFile(to));
+        to.deleteOnExit();
     }
 
 



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