Author: mrglavas
Date: Fri Oct 16 20:43:00 2009
New Revision: 826080
URL: http://svn.apache.org/viewvc?rev=826080&view=rev
Log:
Applying SVN rev 821931 to the XML Schema 1.1 branch :: "Remember the type name
when it can't be resolved to a type definition."
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java?rev=826080&r1=826079&r2=826080&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
Fri Oct 16 20:43:00 2009
@@ -20,6 +20,7 @@
import org.apache.xerces.impl.dv.ValidatedInfo;
import org.apache.xerces.impl.dv.XSSimpleType;
import org.apache.xerces.impl.xs.util.XSObjectListImpl;
+import org.apache.xerces.xni.QName;
import org.apache.xerces.xs.ShortList;
import org.apache.xerces.xs.XSAnnotation;
import org.apache.xerces.xs.XSAttributeDeclaration;
@@ -52,6 +53,7 @@
String fTargetNamespace = null;
// the simple type of the attribute
XSSimpleType fType = null;
+ public QName fUnresolvedTypeName = null;
// value constraint type: default, fixed or !specified
short fConstraintType = XSConstants.VC_NONE;
// scope
@@ -87,6 +89,7 @@
fName = null;
fTargetNamespace = null;
fType = null;
+ fUnresolvedTypeName = null;
fConstraintType = XSConstants.VC_NONE;
fScope = XSConstants.SCOPE_ABSENT;
fDefault = null;
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java?rev=826080&r1=826079&r2=826080&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java
Fri Oct 16 20:43:00 2009
@@ -22,6 +22,7 @@
import org.apache.xerces.impl.xs.identity.IdentityConstraint;
import org.apache.xerces.impl.xs.util.XSNamedMapImpl;
import org.apache.xerces.impl.xs.util.XSObjectListImpl;
+import org.apache.xerces.xni.QName;
import org.apache.xerces.xs.ShortList;
import org.apache.xerces.xs.XSAnnotation;
import org.apache.xerces.xs.XSComplexTypeDefinition;
@@ -55,6 +56,7 @@
public String fTargetNamespace = null;
// type of the element
public XSTypeDefinition fType = null;
+ public QName fUnresolvedTypeName = null;
// misc flag of the element: nillable/abstract/fixed
short fMiscFlags = 0;
public short fScope = XSConstants.SCOPE_ABSENT;
@@ -240,6 +242,7 @@
fName = null;
fTargetNamespace = null;
fType = null;
+ fUnresolvedTypeName = null;
fMiscFlags = 0;
fBlock = XSConstants.DERIVATION_NONE;
fFinal = XSConstants.DERIVATION_NONE;
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java?rev=826080&r1=826079&r2=826080&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
Fri Oct 16 20:43:00 2009
@@ -330,10 +330,15 @@
// Handler type attribute
if (attrType == null && typeAtt != null) {
XSTypeDefinition type =
(XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc,
XSDHandler.TYPEDECL_TYPE, typeAtt, attrDecl);
- if (type != null && type.getTypeCategory() ==
XSTypeDefinition.SIMPLE_TYPE)
+ if (type != null && type.getTypeCategory() ==
XSTypeDefinition.SIMPLE_TYPE) {
attrType = (XSSimpleType)type;
- else
+ }
+ else {
reportSchemaError("src-resolve", new Object[]{typeAtt.rawname,
"simpleType definition"}, attrDecl);
+ if (type == null) {
+ attribute.fUnresolvedTypeName = typeAtt;
+ }
+ }
}
if (attrType == null) {
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java?rev=826080&r1=826079&r2=826080&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
Fri Oct 16 20:43:00 2009
@@ -398,6 +398,9 @@
// Handler type attribute
if (elementType == null && typeAtt != null) {
elementType =
(XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc,
XSDHandler.TYPEDECL_TYPE, typeAtt, elmDecl);
+ if (elementType == null) {
+ element.fUnresolvedTypeName = typeAtt;
+ }
}
// Get it from the substitutionGroup declaration
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]