neilg 2003/08/20 06:52:57 Modified: java/src/org/apache/xerces/impl/xs/opti SchemaDOMParser.java Log: fix for bug 22531; thanks to Peter McCracken Revision Changes Path 1.5 +25 -7 xml-xerces/java/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java Index: SchemaDOMParser.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SchemaDOMParser.java 3 Jul 2003 15:15:58 -0000 1.4 +++ SchemaDOMParser.java 20 Aug 2003 13:52:57 -0000 1.5 @@ -287,22 +287,40 @@ */ public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException { - + // the order of events that occurs here is: + // schemaDOM.startAnnotation/startAnnotationElement (if applicable) + // schemaDOM.emptyElement (basically the same as startElement then endElement) + // schemaDOM.endAnnotationElement (if applicable) + // the order of events that would occur if this was <element></element>: + // schemaDOM.startAnnotation/startAnnotationElement (if applicable) + // schemaDOM.startElement + // schemaDOM.endAnnotationElement (if applicable) + // schemaDOM.endElementElement + // Thus, we can see that the order of events isn't the same. However, it doesn't + // seem to matter. -- PJM if (fAnnotationDepth == -1) { // this is messed up, but a case to consider: if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && element.localpart == SchemaSymbols.ELT_ANNOTATION) { schemaDOM.startAnnotation(element, attributes, fNamespaceContext); - schemaDOM.endAnnotationElement(element, true); - } + } } else { schemaDOM.startAnnotationElement(element, attributes); - schemaDOM.endAnnotationElement(element, false); - } + } + schemaDOM.emptyElement(element, attributes, fLocator.getLineNumber(), fLocator.getColumnNumber()); - + + if (fAnnotationDepth == -1) { + // this is messed up, but a case to consider: + if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && + element.localpart == SchemaSymbols.ELT_ANNOTATION) { + schemaDOM.endAnnotationElement(element, true); + } + } else { + schemaDOM.endAnnotationElement(element, false); + } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]