xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From el...@apache.org
Subject cvs commit: xml-xerces/java/src/org/apache/xerces/validators/schema TraverseSchema.java
Date Mon, 19 Feb 2001 22:52:13 GMT
elena       01/02/19 14:52:13

  Modified:    java/src/org/apache/xerces/validators/schema
                        TraverseSchema.java
  Log:
  Fix for multiple <pattern> that appear as  [children] of a simpleType
  
  Revision  Changes    Path
  1.104     +15 -1     xml-xerces/java/src/org/apache/xerces/validators/schema/TraverseSchema.java
  
  Index: TraverseSchema.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/schema/TraverseSchema.java,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- TraverseSchema.java	2001/02/19 06:43:26	1.103
  +++ TraverseSchema.java	2001/02/19 22:52:13	1.104
  @@ -124,7 +124,7 @@
    *  
    * @see org.apache.xerces.validators.common.Grammar
    *
  - * @version $Id: TraverseSchema.java,v 1.103 2001/02/19 06:43:26 andyc Exp $
  + * @version $Id: TraverseSchema.java,v 1.104 2001/02/19 22:52:13 elena Exp $
    */
   public class TraverseSchema implements 
                               NamespacesScope.NamespacesHandler{
  @@ -1423,6 +1423,7 @@
               int numEnumerationLiterals = 0;
               Vector enumData  = new Vector();
               content = checkContent(simpleTypeDecl, content , true);
  +            StringBuffer pattern = null;
               String facet;
               while (content != null) { 
                   if (content.getNodeType() == Node.ELEMENT_NODE) {
  @@ -1438,6 +1439,16 @@
                                     reportSchemaError(SchemaMessageProvider.ContentError,
                                                       new Object [] { simpleTypeDecl.getAttribute(
SchemaSymbols.ATT_NAME )});
                           }
  +                        else if (facet.equals(SchemaSymbols.ELT_PATTERN)) {
  +                            if (pattern == null) {                                
  +                                pattern = new StringBuffer (content.getAttribute( SchemaSymbols.ATT_VALUE
));
  +                            }
  +                            else { //datatypes: 5.2.4 pattern 
  +                                pattern.append("|");
  +                                pattern.append(content.getAttribute( SchemaSymbols.ATT_VALUE
));
  +                                checkContent(simpleTypeDecl, XUtil.getFirstChildElement(
content ), true);
  +                            }
  +                        }
                           else {
                                facetData.put(facet,content.getAttribute( SchemaSymbols.ATT_VALUE
));
                                checkContent(simpleTypeDecl, XUtil.getFirstChildElement( content
), true);
  @@ -1447,6 +1458,9 @@
               }
               if (numEnumerationLiterals > 0) {
                     facetData.put(SchemaSymbols.ELT_ENUMERATION, enumData);
  +            }
  +            if (pattern !=null) {
  +                facetData.put(SchemaSymbols.ELT_PATTERN, pattern.toString());
               }
           }
   
  
  
  

Mime
View raw message