You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2004/07/08 19:38:28 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs XSModelGroupImpl.java XSParticleDecl.java XSElementDecl.java

mrglavas    2004/07/08 10:38:28

  Modified:    java/src/org/apache/xerces/impl/xs XSModelGroupImpl.java
                        XSParticleDecl.java XSElementDecl.java
  Log:
  Improve formatting of content model representation
  reported in schema messages. For instance when
  there's no namespace, report foo instead of "":foo.
  
  Patch [1] thanks to Jonathan Au.
  
  [1] http://nagoya.apache.org/eyebrowse/ReadMsg?listName=xerces-j-dev@xml.apache.org&msgNo=4420
  
  Revision  Changes    Path
  1.9       +5 -3      xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelGroupImpl.java
  
  Index: XSModelGroupImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelGroupImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XSModelGroupImpl.java	12 Jun 2004 01:03:52 -0000	1.8
  +++ XSModelGroupImpl.java	8 Jul 2004 17:38:28 -0000	1.9
  @@ -137,11 +137,12 @@
        */
       private String fDescription = null;
       public String toString() {
  +    	// REVISIT: Commented code may help to eliminate redundant parentheses (test first before committing)
           if (fDescription == null) {
               StringBuffer buffer = new StringBuffer();
               if (fCompositor == MODELGROUP_ALL)
                   buffer.append("all(");
  -            else
  +            else  //if (fMinOccurs != 1 || fMaxOccurs != 1)
                   buffer.append('(');
               if (fParticleCount > 0)
                   buffer.append(fParticles[0].toString());
  @@ -152,7 +153,8 @@
                       buffer.append(',');
                   buffer.append(fParticles[i].toString());
               }
  -            buffer.append(')');
  +            //if (fCompositor == MODELGROUP_ALL || fMinOccurs != 1 || fMaxOccurs != 1)
  +                  buffer.append(')');
               fDescription = buffer.toString();
           }
           return fDescription;
  
  
  
  1.14      +3 -1      xml-xerces/java/src/org/apache/xerces/impl/xs/XSParticleDecl.java
  
  Index: XSParticleDecl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSParticleDecl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XSParticleDecl.java	24 Feb 2004 22:59:12 -0000	1.13
  +++ XSParticleDecl.java	8 Jul 2004 17:38:28 -0000	1.14
  @@ -146,6 +146,8 @@
               buffer.append("EMPTY");
               break;
           case PARTICLE_ELEMENT:
  +            buffer.append(fValue.toString());
  +            break;
           case PARTICLE_WILDCARD:
               buffer.append('(');
               buffer.append(fValue.toString());
  
  
  
  1.16      +6 -5      xml-xerces/java/src/org/apache/xerces/impl/xs/XSElementDecl.java
  
  Index: XSElementDecl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSElementDecl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- XSElementDecl.java	24 Feb 2004 22:59:12 -0000	1.15
  +++ XSElementDecl.java	8 Jul 2004 17:38:28 -0000	1.16
  @@ -124,11 +124,12 @@
       public String toString() {
           if (fDescription == null) {
               StringBuffer buffer = new StringBuffer();
  -            buffer.append("\"");
  -            if (fTargetNamespace != null)
  +            if (fTargetNamespace != null) {
  +                buffer.append("\"");
                   buffer.append(fTargetNamespace);
  -            buffer.append("\"");
  -            buffer.append(":");
  +                buffer.append("\"");
  +                buffer.append(":");
  +            }
               buffer.append(fName);
               fDescription = buffer.toString();
           }
  
  
  

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