You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "K. Venugopal" <k....@sun.com> on 2003/05/02 15:24:09 UTC

Patch for bug 19107

Hi ,

            Please find patch for bug19107 attached .

Regards
venu



Re: Patch for bug 19107

Posted by Neeraj Bajaj <ne...@sun.com>.
Hi Venu,


>
>             Please find patch for bug19107 attached .
>

Patch looks good. I have committed it.

Thanks
Neeraj


>
>   ------------------------------------------------------------------------
> Index: DocumentBuilderImpl.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java,v
> retrieving revision 1.20
> diff -u -r1.20 DocumentBuilderImpl.java
> --- DocumentBuilderImpl.java    16 Apr 2003 11:46:13 -0000      1.20
> +++ DocumentBuilderImpl.java    2 May 2003 11:01:26 -0000
> @@ -169,13 +169,26 @@
>                              domParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
>                          }
>                      }
> -                } else {
> +                       } else if(JAXP_SCHEMA_SOURCE.equals(name)){
> +                               if( isValidating() ) {
> +                                               String value=(String)dbfAttrs.get(JAXP_SCHEMA_LANGUAGE);
> +                                               if(value !=null && W3C_XML_SCHEMA.equals(value)){
> +                                       domParser.setProperty(name, val);
> +                                               }else{
> +                                       throw new IllegalArgumentException(
> +                                                               "'http://java.sun.com/xml/jaxp/properties/schemaLanguage' "+
> +                                                               "property should be set before setting "+
> +                                                               "'http://java.sun.com/xml/jaxp/properties/schemaSource'"+
> +                                                               " property");
> +                                               }
> +                                       }
> +               } else {
>                      // Let Xerces code handle the property
>                      domParser.setProperty(name, val);
> -                }
> -            }
> -        }
> -    }
> +                               }
> +                       }
> +               }
> +       }
>
>      /**
>       * Non-preferred: use the getDOMImplementation() method instead of this
>
>   ------------------------------------------------------------------------
> Index: SAXParserImpl.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserImpl.java,v
> retrieving revision 1.19
> diff -u -r1.19 SAXParserImpl.java
> --- SAXParserImpl.java  16 Apr 2003 11:46:14 -0000      1.19
> +++ SAXParserImpl.java  2 May 2003 11:01:41 -0000
> @@ -209,7 +209,17 @@
>                  throw new SAXNotSupportedException(
>                      "Unsupported schema language");
>              }
> -        } else {
> +        } else if(JAXP_SCHEMA_SOURCE.equals(name)){
> +                                       String val = (String)getProperty(JAXP_SCHEMA_LANGUAGE);
> +                                       if(val != null && W3C_XML_SCHEMA.equals(val)){
> +                               xmlReader.setProperty(name, value);
> +                                       }else
> +                               throw new SAXNotSupportedException(
> +                                                               "'http://java.sun.com/xml/jaxp/properties/schemaLanguage' "+
> +                                                               "property should be set before setting "+
> +                                                               "'http://java.sun.com/xml/jaxp/properties/schemaSource'"+
> +                                                               " property");
> +               }else{
>              xmlReader.setProperty(name, value);
>          }
>      }
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

-- Neeraj