Author: peterjm
Date: Fri Apr 7 07:56:33 2006
New Revision: 392309
URL: http://svn.apache.org/viewcvs?rev=392309&view=rev
Log:
Changed the processing of the root-type-definition property to account for
built-in types.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL:
http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=392309&r1=392308&r2=392309&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Fri
Apr 7 07:56:33 2006
@@ -1928,17 +1928,21 @@
if (rootTypeNamespace != null &&
rootTypeNamespace.equals(XMLConstants.NULL_NS_URI)) {
rootTypeNamespace = null;
}
- SchemaGrammar grammarForRootType =
- findSchemaGrammar(
- XSDDescription.CONTEXT_ELEMENT, rootTypeNamespace,
null, null, null);
- if (grammarForRootType != null) {
- fCurrentType =
grammarForRootType.getGlobalTypeDecl(fRootTypeQName.getLocalPart());
+ if (rootTypeNamespace == SchemaSymbols.URI_SCHEMAFORSCHEMA) {
+ fCurrentType =
SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(fRootTypeQName.getLocalPart());
+ }
+ else {
+ SchemaGrammar grammarForRootType = findSchemaGrammar(
+ XSDDescription.CONTEXT_ELEMENT, rootTypeNamespace, null,
null, null);
+ if (grammarForRootType != null) {
+ fCurrentType =
grammarForRootType.getGlobalTypeDecl(fRootTypeQName.getLocalPart());
+ }
}
if (fCurrentType == null) {
String typeName =
(fRootTypeQName.getPrefix().equals(XMLConstants.DEFAULT_NS_PREFIX)) ?
- fRootTypeQName.getLocalPart() :
-
fRootTypeQName.getPrefix()+":"+fRootTypeQName.getLocalPart();
- reportSchemaError("cvc-type.1", new Object[]
{typeName});
+ fRootTypeQName.getLocalPart() :
+
fRootTypeQName.getPrefix()+":"+fRootTypeQName.getLocalPart();
+ reportSchemaError("cvc-type.1", new Object[] {typeName});
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]