elena       2003/05/27 15:09:22

  Modified:    java/src/org/apache/xerces/parsers DOMBuilderImpl.java
  Log:
  The DOM schema-location property was not mapped correctly to the JAXP schemaSource
  we should use array of Objects if more than one schema is specified.
  See: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19106
  
  Revision  Changes    Path
  1.35      +26 -6     
xml-xerces/java/src/org/apache/xerces/parsers/DOMBuilderImpl.java
  
  Index: DOMBuilderImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMBuilderImpl.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- DOMBuilderImpl.java       8 May 2003 20:11:58 -0000       1.34
  +++ DOMBuilderImpl.java       27 May 2003 22:09:21 -0000      1.35
  @@ -59,6 +59,8 @@
   
   import java.io.StringReader;
   import java.util.Stack;
  +import java.util.StringTokenizer;
  +import java.util.Vector;
   
   import org.apache.xerces.dom.DOMErrorImpl;
   import org.apache.xerces.dom.DOMMessageFormatter;
  @@ -143,6 +145,9 @@
       protected boolean fBusy = false;
   
       protected final static boolean DEBUG = false;
  +    
  +     private Vector fSchemaLocations = new Vector();
  +     private String fSchemaLocation = null;
   
       //
       // Constructors
  @@ -257,6 +262,7 @@
           if (fSkippedElemStack!=null) {        
               fSkippedElemStack.removeAllElements();
           }
  +             fSchemaLocations.clear();
           fRejectedElement.clear();
           fFilterReject = false;
           fSchemaType = null;
  @@ -431,10 +437,25 @@
                                if (value instanceof String) {
                                        try {
                                                if (fSchemaType == 
Constants.NS_XMLSCHEMA) {
  +                                                     fSchemaLocation = 
(String)value;
                                                        // map DOM schema-location to 
JAXP schemaSource property
  -                                                     fConfiguration.setProperty(
  -                                                             
Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
  -                                                             value);
  +                                                     // tokenize location string
  +                                                     StringTokenizer t = new 
StringTokenizer(fSchemaLocation, " \n\t\r");                                           
         
  +                                                     if (t.hasMoreTokens()){ 
  +                                                             
fSchemaLocations.clear();
  +                                                             
fSchemaLocations.add(t.nextToken ());                                           
  +                                                             while 
(t.hasMoreTokens()) {
  +                                                                     
fSchemaLocations.add(t.nextToken ());
  +                                                             }
  +                                                             
fConfiguration.setProperty(
  +                                                                     
Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
  +                                                                 
fSchemaLocations.toArray());
  +                                                     }
  +                                                     else {
  +                                                             
fConfiguration.setProperty(
  +                                                                     
Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
  +                                                                     value);        
                                         
  +                                                     }
                                                }
                                                else {
                                                        // REVISIT: allow pre-parsing 
DTD grammars
  @@ -587,8 +608,7 @@
                                Constants.JAXP_PROPERTY_PREFIX + 
Constants.SCHEMA_LANGUAGE);
                }
                else if (name.equals(Constants.DOM_SCHEMA_LOCATION)) {
  -                     return fConfiguration.getProperty(
  -                             Constants.JAXP_PROPERTY_PREFIX + 
Constants.SCHEMA_SOURCE);
  +                     return fSchemaLocation;
                }
           else if (name.equals(SYMBOL_TABLE)){
               return fConfiguration.getProperty(SYMBOL_TABLE);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to