sandygao 2003/11/11 09:35:18
Modified: java/src/org/apache/xerces/impl/xs/traversers
XSDComplexTypeTraverser.java
XSDElementTraverser.java
Log:
More PSVI related fixes. We didn't have proper final/block values on
element and complex declarations.
Revision Changes Path
1.40 +8 -13
xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
Index: XSDComplexTypeTraverser.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- XSDComplexTypeTraverser.java 10 Nov 2003 20:44:41 -0000 1.39
+++ XSDComplexTypeTraverser.java 11 Nov 2003 17:35:17 -0000 1.40
@@ -225,18 +225,13 @@
fName = complexTypeName;
fComplexTypeDecl.setName(fName);
fTargetNamespace = schemaDoc.fTargetNamespace;
- if (blockAtt == null) {
- fBlock =
(short)(schemaDoc.fBlockDefault&(XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION));
- }
- else {
- fBlock = blockAtt.shortValue();
- }
- if (finalAtt == null) {
- fFinal =
(short)(schemaDoc.fFinalDefault&(XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION));
- }
- else {
- fFinal = finalAtt.shortValue();
- }
+
+ fBlock = blockAtt == null ? schemaDoc.fBlockDefault : blockAtt.shortValue();
+ fFinal = finalAtt == null ? schemaDoc.fFinalDefault : finalAtt.shortValue();
+ //discard valid Block/Final 'Default' values that are invalid for
Block/Final
+ fBlock &= (XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION);
+ fFinal &= (XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION);
+
if (abstractAtt != null && abstractAtt.booleanValue())
fIsAbstract = true;
1.27 +7 -13
xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
Index: XSDElementTraverser.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- XSDElementTraverser.java 10 Nov 2003 20:44:41 -0000 1.26
+++ XSDElementTraverser.java 11 Nov 2003 17:35:17 -0000 1.27
@@ -310,18 +310,12 @@
}
// get 'block', 'final', 'nillable', 'abstract'
- if (blockAtt == null) {
- element.fBlock =
(short)(schemaDoc.fBlockDefault&(XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION | XSConstants.DERIVATION_SUBSTITUTION));
- }
- else {
- element.fBlock = blockAtt.shortValue();
- }
- if (finalAtt == null) {
- element.fFinal =
(short)(schemaDoc.fFinalDefault&(XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION));
- }
- else {
- element.fFinal = finalAtt.shortValue();
- }
+ element.fBlock = blockAtt == null ? schemaDoc.fBlockDefault :
blockAtt.shortValue();
+ element.fFinal = finalAtt == null ? schemaDoc.fFinalDefault :
finalAtt.shortValue();
+ // discard valid Block/Final 'Default' values that are invalid for
Block/Final
+ element.fBlock &= (XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION | XSConstants.DERIVATION_SUBSTITUTION);
+ element.fFinal &= (XSConstants.DERIVATION_EXTENSION |
XSConstants.DERIVATION_RESTRICTION);
+
if (nillableAtt.booleanValue())
element.setIsNillable();
if (abstractAtt != null && abstractAtt.booleanValue())
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]