neilg 2002/09/17 13:48:36 Modified: java/src/org/apache/xerces/impl XMLDTDScannerImpl.java java/src/org/apache/xerces/impl/msg XMLMessages.properties Log: fixing bug 11991 Revision Changes Path 1.29 +15 -3 xml-xerces/java/src/org/apache/xerces/impl/XMLDTDScannerImpl.java Index: XMLDTDScannerImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLDTDScannerImpl.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- XMLDTDScannerImpl.java 16 Sep 2002 21:25:30 -0000 1.28 +++ XMLDTDScannerImpl.java 17 Sep 2002 20:48:35 -0000 1.29 @@ -1693,7 +1693,7 @@ * </pre> * <p> * <strong>Note:</strong> Called after scanning past '<![' */ - private final void scanConditionalSect() + private final void scanConditionalSect(int currPEDepth) throws IOException, XNIException { fReportEntity = false; @@ -1701,6 +1701,12 @@ if (fEntityScanner.skipString("INCLUDE")) { skipSeparator(false, !scanningInternalSubset()); + if(currPEDepth != fPEDepth && fValidation) { + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, + "INVALID_PE_IN_CONDITIONAL", + new Object[]{ fEntityManager.fCurrentEntity.name}, + XMLErrorReporter.SEVERITY_ERROR); + } // call handler if (!fEntityScanner.skipChar('[')) { reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD", null); @@ -1716,6 +1722,12 @@ } else if (fEntityScanner.skipString("IGNORE")) { skipSeparator(false, !scanningInternalSubset()); + if(currPEDepth != fPEDepth && fValidation) { + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, + "INVALID_PE_IN_CONDITIONAL", + new Object[]{ fEntityManager.fCurrentEntity.name}, + XMLErrorReporter.SEVERITY_ERROR); + } // call handler if (fDTDHandler != null) { fDTDHandler.startConditional(XMLDTDHandler.CONDITIONAL_IGNORE, @@ -1850,7 +1862,7 @@ } else if (fEntityScanner.skipChar('[') && !scanningInternalSubset()) { - scanConditionalSect(); + scanConditionalSect(fPEDepth); } else { fMarkUpDepth--; 1.13 +1 -0 xml-xerces/java/src/org/apache/xerces/impl/msg/XMLMessages.properties Index: XMLMessages.properties =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/msg/XMLMessages.properties,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- XMLMessages.properties 17 Jul 2002 21:30:12 -0000 1.12 +++ XMLMessages.properties 17 Sep 2002 20:48:36 -0000 1.13 @@ -214,6 +214,7 @@ IDREFSInvalid = Attribute value \"{0}\" of type IDREFS must be one or more names. ImproperDeclarationNesting = The replacement text of parameter entity \"{0}\" must include properly nested declarations. ImproperGroupNesting = The replacement text of parameter entity \"{0}\" must include properly nested pairs of parentheses. + INVALID_PE_IN_CONDITIONAL = The replacement text of parameter entity \"{0}\" must include the entire conditional section or just INCLUDE or IGNORE. MSG_ATTRIBUTE_NOT_DECLARED = Attribute \"{1}\" must be declared for element type \"{0}\". MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attribute \"{0}\" with value \"{1}\" must have a value from the list \"{2}\". MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = The value \"{1}\" of attribute \"{0}\" must not be changed by normalization (to \"{2}\") in a standalone document.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]