xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/configschema/schema binding-config.xsd
Date Fri, 31 Oct 2003 21:07:33 GMT
pcal        2003/10/31 13:07:33

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/bts
                        SimpleDocumentBinding.java
               v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        ExplodedTylarBuilder.java Java2Schema.java
                        Java2SchemaTask.java JavaToSchemaInput.java
                        SchemaGenerator.java TylarBuilder.java
               v2/src/configschema/schema binding-config.xsd
  Added:       v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        JavaToSchemaResultImpl.java
  Log:
  java2schema: use new input/result interfaces
  
  Revision  Changes    Path
  1.2       +56 -5     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/SimpleDocumentBinding.java
  
  Index: SimpleDocumentBinding.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/SimpleDocumentBinding.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleDocumentBinding.java	30 Oct 2003 01:10:47 -0000	1.1
  +++ SimpleDocumentBinding.java	31 Oct 2003 21:07:32 -0000	1.2
  @@ -1,14 +1,65 @@
  +/*
  +* The Apache Software License, Version 1.1
  +*
  +*
  +* Copyright (c) 2003 The Apache Software Foundation.  All rights
  +* reserved.
  +*
  +* Redistribution and use in source and binary forms, with or without
  +* modification, are permitted provided that the following conditions
  +* are met:
  +*
  +* 1. Redistributions of source code must retain the above copyright
  +*    notice, this list of conditions and the following disclaimer.
  +*
  +* 2. Redistributions in binary form must reproduce the above copyright
  +*    notice, this list of conditions and the following disclaimer in
  +*    the documentation and/or other materials provided with the
  +*    distribution.
  +*
  +* 3. The end-user documentation included with the redistribution,
  +*    if any, must include the following acknowledgment:
  +*       "This product includes software developed by the
  +*        Apache Software Foundation (http://www.apache.org/)."
  +*    Alternately, this acknowledgment may appear in the software itself,
  +*    if and wherever such third-party acknowledgments normally appear.
  +*
  +* 4. The names "Apache" and "Apache Software Foundation" must
  +*    not be used to endorse or promote products derived from this
  +*    software without prior written permission. For written
  +*    permission, please contact apache@apache.org.
  +*
  +* 5. Products derived from this software may not be called "Apache
  +*    XMLBeans", nor may "Apache" appear in their name, without prior
  +*    written permission of the Apache Software Foundation.
  +*
  +* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  +* DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  +* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  +* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  +* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  +* SUCH DAMAGE.
  +* ====================================================================
  +*
  +* This software consists of voluntary contributions made by many
  +* individuals on behalf of the Apache Software Foundation and was
  +* originally based on software copyright (c) 2003 BEA Systems
  +* Inc., <http://www.bea.com/>. For more information on the Apache Software
  +* Foundation, please see <http://www.apache.org/>.
  +*/
   package org.apache.xmlbeans.impl.binding.bts;
   
   import java.util.*;
   import javax.xml.namespace.QName;
   
   /**
  - * Created by IntelliJ IDEA.
  - * User: pcal
  - * Date: Oct 28, 2003
  - * Time: 10:44:54 AM
  - * To change this template use Options | File Templates.
  + * BindingType for root elements.
    */
   public class SimpleDocumentBinding extends BindingType
   {
  
  
  
  1.2       +29 -58    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/ExplodedTylarBuilder.java
  
  Index: ExplodedTylarBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/ExplodedTylarBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExplodedTylarBuilder.java	22 Oct 2003 02:32:43 -0000	1.1
  +++ ExplodedTylarBuilder.java	31 Oct 2003 21:07:32 -0000	1.2
  @@ -93,80 +93,51 @@
   
     public ExplodedTylarBuilder(File dir) {
       if (dir == null) throw new IllegalArgumentException("null dir");
  -    if (!dir.exists()) {
  -      if (!dir.mkdirs()) {
  -        throw new IllegalArgumentException("failed to create dir "+dir);
  -      }
  -    } else {
  -      if (!dir.isDirectory())
  -        throw new IllegalArgumentException("not a directory: "+dir);
  -    }
       mDir = dir;
     }
   
     // =========================================================================
     // TylarBuilder implementation
   
  -  public void addSchema(SchemaDocument sd) {
  -    mSchemas.add(sd);
  -  }
  -
  -  public void addBindingFile(BindingFile bf) {
  -    mBindings.add(bf);
  -  }
  -
  -  public void complete() throws IOException {
  -    writeBindingFiles();
  -    writeSchemas();
  -  }
  -
  -  // =========================================================================
  -  // Private methods
  -
  -  private void writeBindingFiles() throws IOException {
  -    int num = 0; // FIXME need real naming rules
  -    for(Iterator i = mBindings.iterator(); i.hasNext(); num++) {
  -      BindingFile bf = (BindingFile)i.next();
  -      BindingConfigDocument doc = bf.write();
  -      File file = new File(mDir,"binding-file"+(num != 0 ? ""+num : "")+".xml");
  -      FileOutputStream out;
  -      out = new FileOutputStream(file);
  +  public void buildTylar(JavaToSchemaResult result) throws IOException {
  +    if (!mDir.exists()) {
  +      if (!mDir.mkdirs()) {
  +        throw new IllegalArgumentException("failed to create dir "+mDir);
  +      }
  +    } else {
  +      if (!mDir.isDirectory())
  +        throw new IllegalArgumentException("not a directory: "+mDir);
  +    }
  +    // print the schemas
  +    String[] tns = result.getSchemaGenerator().getTargetNamespaces();
  +    for(int i=0; i<tns.length; i++) {
  +      File file = new File(mDir,"schema-"+i+".xsd");//FIXME naming
  +      FileOutputStream out = null;
         try {
  -        doc.save(out,
  -                 new XmlOptions().setSavePrettyPrint().
  -                 setSavePrettyPrintIndent(XML_INDENT));
  -      } catch(IOException e) {
  -        throw e;
  +        out = new FileOutputStream(file);
  +        result.getSchemaGenerator().printSchema(tns[i],out);
  +      } catch(IOException ioe) {
  +        throw ioe;
         } finally {
           try {
             out.close();
  -        } catch(IOException ioe) {
  -          ioe.printStackTrace();
  -        }
  +        } catch(Exception ohwell) { ohwell.printStackTrace(); }
         }
       }
  -  }
  -
  -  private void writeSchemas() throws IOException {
  -    int num = 0; // FIXME need real naming rules
  -    for(Iterator i = mSchemas.iterator(); i.hasNext(); num++) {
  -      SchemaDocument sd = (SchemaDocument)i.next();
  -      File file = new File(mDir,"schema"+(num != 0 ? ""+num : "")+".xsd");
  -      FileOutputStream out;
  -      out = new FileOutputStream(file);
  +    // print the binding file
  +    {
  +      File file = new File(mDir,"binding-file.xml"); //FIXME naming
  +      FileOutputStream out = null;
         try {
  -        sd.save(out,
  -                new XmlOptions().setSavePrettyPrint().
  -                setSavePrettyPrintIndent(XML_INDENT));
  -      } catch(IOException e) {
  -        throw e;
  +        out = new FileOutputStream(file);
  +        result.getBindingFileGenerator().printBindingFile(out);
  +      } catch(IOException ioe) {
  +        throw ioe;
         } finally {
           try {
             out.close();
  -        } catch(IOException ioe) {
  -          ioe.printStackTrace();
  -        }
  +        } catch(IOException ohwell) { ohwell.printStackTrace(); }
         }
       }
     }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.5       +39 -10    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema.java
  
  Index: Java2Schema.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Java2Schema.java	30 Oct 2003 01:10:47 -0000	1.4
  +++ Java2Schema.java	31 Oct 2003 21:07:32 -0000	1.5
  @@ -67,6 +67,8 @@
   /**
    * Transforms a set of JClasses into a BTS and a schema.  This is really just
    * a sketch at this point.
  + *
  + * @author Patrick Calahan <pcal@bea.com>
    */
   public class Java2Schema {
   
  @@ -92,29 +94,53 @@
     // =========================================================================
     // Variables
   
  -  private BindingFile mBindingFile;
  -  private BindingLoader mLoader;
  -  private SchemaDocument mSchemaDocument;
  -  private SchemaDocument.Schema mSchema;
  +  private BindingFile mBindingFile;      //KILLME
  +  private BindingLoader mLoader;         //KILLME
  +  private SchemaDocument mSchemaDocument;//KILLME
  +  private SchemaDocument.Schema mSchema; //KILLME
  +  //
  +  private JavaToSchemaInput mInput;
   
     // =========================================================================
     // Constructors
   
  -  public Java2Schema() {}
  +  public Java2Schema(JavaToSchemaInput jtsi) {
  +    if (jtsi == null) {
  +      throw new IllegalArgumentException("null JavaToSchemaInput");
  +    }
  +    mInput = jtsi;
  +  }
   
     // =========================================================================
     // Public methods
   
  -  public void bind(JClass[] classes, TylarBuilder tb) {
  +  /**
  +   * Does the binding work and returns the result.
  +   */
  +  public JavaToSchemaResult bind() {
  +    final JavaToSchemaResultImpl out = new JavaToSchemaResultImpl();
  +    bind(mInput.getJClasses(),out);
  +    return new JavaToSchemaResult() {
  +      public BindingFileGenerator getBindingFileGenerator() { return out; }
  +      public SchemaGenerator getSchemaGenerator() { return out; }
  +    };
  +  }
  +
  +  // ========================================================================
  +  // Private methods
  +
  +  /**
  +   *
  +   */
  +  private void bind(JClass[] classes, JavaToSchemaResultImpl tb) {
       tb.addBindingFile(mBindingFile = new BindingFile());
       mLoader = PathBindingLoader.forPath
               (new BindingLoader[] {mBindingFile,
                                     BuiltinBindingLoader.getInstance()});
  -    tb.addSchema(mSchemaDocument = SchemaDocument.Factory.newInstance());
  +    mSchemaDocument = SchemaDocument.Factory.newInstance();
       mSchema = mSchemaDocument.addNewSchema();
  -    for(int i=0; i<classes.length; i++) {
  -      getBindingTypeFor(classes[i]);
  -    }
  +    for(int i=0; i<classes.length; i++) getBindingTypeFor(classes[i]);
  +    tb.addSchema(mSchemaDocument);
     }
   
     // =========================================================================
  @@ -232,6 +258,8 @@
       return JAVA_URI_SCHEME + pkg_name;
     }
   
  +  /*
  +
     private static boolean isXmlObj(JClass clazz) {
       try {
         JClass xmlObj = clazz.forName("org.apache.xmlbeans.XmlObject");
  @@ -241,4 +269,5 @@
         return false;
       }
     }
  +  */
   }
  
  
  
  1.2       +8 -4      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2SchemaTask.java
  
  Index: Java2SchemaTask.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2SchemaTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Java2SchemaTask.java	22 Oct 2003 02:32:43 -0000	1.1
  +++ Java2SchemaTask.java	31 Oct 2003 21:07:32 -0000	1.2
  @@ -163,18 +163,22 @@
         System.out.println(mClasspath.toString()+"  set classpath");
         fs.setClasspath(mClasspath.toString());
       }
  -    JClass[] classes;
  +    final JClass[] classes;
       try {
         classes = jf.loadSources(fs);
       } catch(IOException ioe) {
         ioe.printStackTrace();
         throw new BuildException(ioe);
       }
  -    Java2Schema j2b = new Java2Schema();
  +    JavaToSchemaInput input = new JavaToSchemaInput() {
  +      public JClass[] getJClasses() { return classes; }
  +      public TylarLoader getTylarLoader() { return null; }
  +    };
  +    Java2Schema j2b = new Java2Schema(input);
       TylarBuilder tb = new ExplodedTylarBuilder(mDestDir);
  -    j2b.bind(classes,tb);
  +    JavaToSchemaResult result = j2b.bind();
       try {
  -      tb.complete();
  +      tb.buildTylar(result);
       } catch(IOException ioe) {
         ioe.printStackTrace();
         throw new BuildException(ioe);
  
  
  
  1.2       +6 -5      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaInput.java
  
  Index: JavaToSchemaInput.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaInput.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavaToSchemaInput.java	29 Oct 2003 20:32:03 -0000	1.1
  +++ JavaToSchemaInput.java	31 Oct 2003 21:07:32 -0000	1.2
  @@ -56,14 +56,15 @@
   
   package org.apache.xmlbeans.impl.binding.compile;
   
  +import org.apache.xmlbeans.impl.jam.JClass;
  +
   public interface JavaToSchemaInput
   {
       /**
  -     * Returns a something that represents a set of JClasses that
  -     * are to be processed for binding. (??)
  -     */ 
  -    // JClassSet getJClassSet();
  -    
  +     * Returns the JClasses to be processed for binding.
  +     */
  +    JClass[] getJClasses();
  +
       /**
        * Returns the path used for resolving already-known bindings
        */
  
  
  
  1.2       +1 -1      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaGenerator.java
  
  Index: SchemaGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/SchemaGenerator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SchemaGenerator.java	29 Oct 2003 20:32:03 -0000	1.1
  +++ SchemaGenerator.java	31 Oct 2003 21:07:32 -0000	1.2
  @@ -65,7 +65,7 @@
       /**
        * Returns a collection of targetNamespace URIs as Strings.
        */
  -    Collection getTargetNamespaces();
  +    String[] getTargetNamespaces();
       
       /**
        * Prints the .xsd source code for the given target namespace.
  
  
  
  1.2       +9 -24     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/TylarBuilder.java
  
  Index: TylarBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/TylarBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TylarBuilder.java	22 Oct 2003 02:32:43 -0000	1.1
  +++ TylarBuilder.java	31 Oct 2003 21:07:32 -0000	1.2
  @@ -61,38 +61,23 @@
   import java.io.IOException;
   
   /**
  - * Isolates binding compilation tasks from details of how their outputs are
  - * actually written out to disk.  There will probably be at least two
  - * implementations of this interface: one that outputs a jarred 'tylar' and
  - * another which outputs a directory.
  + * This interface encapsultes knowledge about how to take the results
  + * of a binding compilation and package them into some kind of deployment unit.
  + * There will probably be at least two implementations of this interface: one
  + * that outputs a jarred 'tylar' and another which outputs a directory.
    *
    * We may want to change the name of this class; I'm still a little uneasy
    * about 'tylar,' but for the moment, at least everyone will understand what
  - * this is.
  + * this is.  Also, maybe it would be more clear to call it a 'packager' rather
  + * than a 'builder.'
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
   public interface TylarBuilder {
   
  -/**
  - * Adds the given schema document to the type library.
  - */
  -  public void addSchema(SchemaDocument sd);
  -
  -  /**
  -   * Adds the given binding config to the type library.
  -   */
  -  public void addBindingFile(BindingFile bf);
  +  public void buildTylar(JavaToSchemaResult result) throws IOException;
   
  -  /**
  -   * This should be called to inform the builder that work is complete and
  -   * that it should write all of its output to disk (or whatever it wants
  -   * to do).  This method can be called at most once for a given instance
  -   * of TylarBuilder; any subsequent method calls on that instance will result
  -   * in an IllegalStateException.
  -   *
  -   * @throws IOException if an error occurs while performing output. REVIEW
  -   */
  -  public void complete() throws IOException;
  +  //NYI
  +  //public void buildTylar(SchemaToJavaResult result) throws IOException;
   
   }
  
  
  
  1.1                  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/JavaToSchemaResultImpl.java
  
  Index: JavaToSchemaResultImpl.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2003 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Apache" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache
  *    XMLBeans", nor may "Apache" appear in their name, without prior
  *    written permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation and was
  * originally based on software copyright (c) 2003 BEA Systems
  * Inc., <http://www.bea.com/>. For more information on the Apache Software
  * Foundation, please see <http://www.apache.org/>.
  */
  package org.apache.xmlbeans.impl.binding.compile;
  
  import org.w3.x2001.xmlSchema.SchemaDocument;
  import org.apache.xmlbeans.impl.binding.bts.BindingFile;
  import org.apache.xmlbeans.XmlOptions;
  import org.apache.xmlbeans.x2003.x09.bindingConfig.BindingConfigDocument;
  import java.io.IOException;
  import java.io.OutputStream;
  import java.io.File;
  import java.io.FileOutputStream;
  import java.util.*;
  
  /**
   * This class addresses the impedence mismatch between Java2Schema's
   * desire to push it's results out and the public API's desire to
   * present them as a generator.  When asked, we just push the results in here
   * and return ('generate') them on demand.
   */
  /*package*/ class JavaToSchemaResultImpl implements SchemaGenerator,
          BindingFileGenerator
   {
    // =========================================================================
    // Constants
  
    private static final int XML_INDENT = 2;
  
    // ========================================================================
    // Variables
  
    private Map mTNS2Schema = new HashMap();
    private List mBindingFiles = new ArrayList();
  
    // ========================================================================
    // Package methods - called by Java2Schema
  
    /*package*/ void addSchema(SchemaDocument sd) {
      //REVIEW should we throw if they try to add to schemas for same tns?
      if (sd == null) throw new IllegalArgumentException("null SchemaDocument");
      mTNS2Schema.put(sd.getSchema().getTargetNamespace(),sd);
    }
  
    // REVIEW is there really any reason to allow more than one?
    /*package*/ void addBindingFile(BindingFile bf) { mBindingFiles.add(bf); }
  
    // ========================================================================
    // SchemaGenerator implementation
  
    public String[] getTargetNamespaces() {
      String[] out = new String[mTNS2Schema.keySet().size()];
      int n=0;
      for(Iterator i = mTNS2Schema.keySet().iterator(); i.hasNext(); n++) {
        out[n] = (String)i.next();
      }
      return out;
    }
  
    public void printSchema(String targetNamespace, OutputStream out)
            throws IOException
    {
      SchemaDocument sd = getSchemaFor(targetNamespace);
      if (sd == null) {
        //REVIEW what is the right thing to do?
      } else {
        sd.save(out,
                new XmlOptions().setSavePrettyPrint().
                setSavePrettyPrintIndent(XML_INDENT));
      }
    }
  
    // REVIEW do we really think that SchemaGenerator clients are never going to
    // want a method like this? i.e. is forcing them to dump stream right?
    private SchemaDocument getSchemaFor(String targetNamespace) {
      return (SchemaDocument)mTNS2Schema.get(targetNamespace);
    }
  
    // ========================================================================
    // BindingFileGenerator implementation
  
    public void printBindingFile(OutputStream out) throws IOException {
      if (mBindingFiles.size() > 0) {
        BindingFile bf = (BindingFile)mBindingFiles.get(0);
        BindingConfigDocument doc = bf.write();
        doc.save(out,
                 new XmlOptions().setSavePrettyPrint().
                 setSavePrettyPrintIndent(XML_INDENT));
      }
    }
  }
  
  
  1.7       +1 -1      xml-xmlbeans/v2/src/configschema/schema/binding-config.xsd
  
  Index: binding-config.xsd
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/configschema/schema/binding-config.xsd,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- binding-config.xsd	30 Oct 2003 01:10:47 -0000	1.6
  +++ binding-config.xsd	31 Oct 2003 21:07:33 -0000	1.7
  @@ -58,7 +58,7 @@
       <xs:complexContent>
         <xs:extension base="tns:binding-type">
           <xs:sequence>
  -          <xs:element name="element-name" type="xs:string"/>
  +          <xs:element name="element-name" type="xs:NCName"/>
           </xs:sequence>
         </xs:extension>
       </xs:complexContent>
  
  
  

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


Mime
View raw message