From xercesdeangardner@example.org Wed Oct 01 16:32:48 2003 Return-Path: <xercesdeangardner@example.org> Delivered-To: deangardner@example.org Received: (qmail 22452 invoked from network); 1 Oct 2003 16:32:48 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 1 Oct 2003 16:32:48 -0000 Received: (qmail 24747 invoked by uid 500); 1 Oct 2003 16:32:37 -0000 Delivered-To: deangardner@example.org Received: (qmail 24690 invoked by uid 500); 1 Oct 2003 16:32:36 -0000 Mailing-List: contact deangardner@example.org; run by ezmlm Precedence: bulk list-help: <mailto:deangardner@example.org> list-unsubscribe: <mailto:deangardner@example.org> list-post: <mailto:deangardner@example.org> Reply-To: <deangardner@example.org> Delivered-To: mailing list deangardner@example.org Received: (qmail 24638 invoked from network); 1 Oct 2003 16:32:36 -0000 Received: from unknown (HELO minotaur.apache.org) (83.161.120.155) by daedalus.apache.org with SMTP; 1 Oct 2003 16:32:36 -0000 Received: (qmail 22283 invoked by uid 1240); 1 Oct 2003 16:32:43 -0000 Date: 1 Oct 2003 16:32:43 -0000 Message-ID: <deangardner@example.org> From: deangardner@example.org To: deangardner@example.org Subject: cvs commit: xml-xerces/c/src/xercesc/validators/schema/identity FieldValueMap.cpp IdentityConstraint.cpp ValueStoreCache.cpp XPathMatcher.cpp XPathMatcherStack.cpp XercesXPath.cpp X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N neilg 2003/10/01 09:32:43 Modified: c/src/xercesc/dom/deprecated DOMParser.cpp DOMString.cpp c/src/xercesc/dom/impl DOMDocumentImpl.cpp DOMElementImpl.cpp DOMElementNSImpl.cpp DOMWriterImpl.cpp c/src/xercesc/framework XMLAttDef.cpp XMLAttr.cpp XMLEntityDecl.cpp XMLNotationDecl.cpp c/src/xercesc/internal DGXMLScanner.cpp IGXMLScanner.cpp MemoryManagerArrayImpl.cpp MemoryManagerImpl.cpp ReaderMgr.cpp SGXMLScanner.cpp WFXMLScanner.cpp XMLScanner.cpp c/src/xercesc/parsers AbstractDOMParser.cpp DOMBuilderImpl.cpp SAX2XMLReaderImpl.cpp SAXParser.cpp XercesDOMParser.cpp c/src/xercesc/util Makefile.in QName.cpp XMLBigDecimal.cpp XMLStringTokenizer.cpp XMLURL.cpp XMLUri.cpp c/src/xercesc/util/Platforms/AIX AIXPlatformUtils.cpp c/src/xercesc/util/Platforms/BeOS BeOSPlatformUtils.cpp c/src/xercesc/util/Platforms/FreeBSD FreeBSDPlatformUtils.cpp c/src/xercesc/util/Platforms/HPUX HPPlatformUtils.cpp c/src/xercesc/util/Platforms/IRIX IRIXPlatformUtils.cpp c/src/xercesc/util/Platforms/Linux LinuxPlatformUtils.cpp c/src/xercesc/util/Platforms/NetBSD NetBSDPlatformUtils.cpp c/src/xercesc/util/Platforms/OS390 OS390PlatformUtils.cpp c/src/xercesc/util/Platforms/OS400 OS400PlatformUtils.cpp c/src/xercesc/util/Platforms/OpenServer OpenServerPlatformUtils.cpp c/src/xercesc/util/Platforms/Solaris SolarisPlatformUtils.cpp c/src/xercesc/util/Platforms/Tandem TandemPlatformUtils.cpp c/src/xercesc/util/Platforms/Tru64 Tru64PlatformUtils.cpp c/src/xercesc/util/Platforms/UnixWare UnixWarePlatformUtils.cpp c/src/xercesc/util/regx BMPattern.cpp RegularExpression.cpp c/src/xercesc/validators/DTD DTDScanner.cpp c/src/xercesc/validators/datatype AnyURIDatatypeValidator.cpp DateDatatypeValidator.cpp DateTimeDatatypeValidator.cpp DateTimeValidator.cpp DayDatatypeValidator.cpp DurationDatatypeValidator.cpp ListDatatypeValidator.cpp MonthDatatypeValidator.cpp MonthDayDatatypeValidator.cpp NOTATIONDatatypeValidator.cpp TimeDatatypeValidator.cpp UnionDatatypeValidator.cpp YearDatatypeValidator.cpp YearMonthDatatypeValidator.cpp c/src/xercesc/validators/schema GeneralAttributeCheck.cpp SchemaGrammar.cpp SchemaValidator.cpp TraverseSchema.cpp c/src/xercesc/validators/schema/identity FieldValueMap.cpp IdentityConstraint.cpp ValueStoreCache.cpp XPathMatcher.cpp XPathMatcherStack.cpp XercesXPath.cpp Added: c/src/xercesc/util OutOfMemoryException.hpp Log: improve handling of out of memory conditions, bug #23415. Thanks to David Cargill. Revision Changes Path 1.26 +30 -8 xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp.diff?r1=1.25&r2=1.26 1.8 +3 -10 xml-xerces/c/src/xercesc/dom/deprecated/DOMString.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/dom/deprecated/DOMString.cpp.diff?r1=1.7&r2=1.8 1.47 +17 -21 xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp.diff?r1=1.46&r2=1.47 1.21 +6 -1 xml-xerces/c/src/xercesc/dom/impl/DOMElementImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/dom/impl/DOMElementImpl.cpp.diff?r1=1.20&r2=1.21 1.14 +6 -1 xml-xerces/c/src/xercesc/dom/impl/DOMElementNSImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/dom/impl/DOMElementNSImpl.cpp.diff?r1=1.13&r2=1.14 1.42 +13 -3 xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp.diff?r1=1.41&r2=1.42 1.6 +6 -1 xml-xerces/c/src/xercesc/framework/XMLAttDef.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/framework/XMLAttDef.cpp.diff?r1=1.5&r2=1.6 1.6 +10 -1 xml-xerces/c/src/xercesc/framework/XMLAttr.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/framework/XMLAttr.cpp.diff?r1=1.5&r2=1.6 1.8 +10 -2 xml-xerces/c/src/xercesc/framework/XMLEntityDecl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/framework/XMLEntityDecl.cpp.diff?r1=1.7&r2=1.8 1.7 +8 -0 xml-xerces/c/src/xercesc/framework/XMLNotationDecl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/framework/XMLNotationDecl.cpp.diff?r1=1.6&r2=1.7 1.24 +34 -2 xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp.diff?r1=1.23&r2=1.24 1.24 +34 -2 xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp.diff?r1=1.23&r2=1.24 1.3 +19 -3 xml-xerces/c/src/xercesc/internal/MemoryManagerArrayImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/MemoryManagerArrayImpl.cpp.diff?r1=1.2&r2=1.3 1.2 +17 -4 xml-xerces/c/src/xercesc/internal/MemoryManagerImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/MemoryManagerImpl.cpp.diff?r1=1.1&r2=1.2 1.17 +6 -2 xml-xerces/c/src/xercesc/internal/ReaderMgr.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/ReaderMgr.cpp.diff?r1=1.16&r2=1.17 1.37 +34 -2 xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp.diff?r1=1.36&r2=1.37 1.15 +26 -2 xml-xerces/c/src/xercesc/internal/WFXMLScanner.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/WFXMLScanner.cpp.diff?r1=1.14&r2=1.15 1.48 +22 -1 xml-xerces/c/src/xercesc/internal/XMLScanner.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/internal/XMLScanner.cpp.diff?r1=1.47&r2=1.48 1.52 +20 -5 xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.cpp.diff?r1=1.51&r2=1.52 1.30 +14 -4 xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp.diff?r1=1.29&r2=1.30 1.28 +32 -7 xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp.diff?r1=1.27&r2=1.28 1.26 +32 -6 xml-xerces/c/src/xercesc/parsers/SAXParser.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/parsers/SAXParser.cpp.diff?r1=1.25&r2=1.26 1.18 +14 -4 xml-xerces/c/src/xercesc/parsers/XercesDOMParser.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/parsers/XercesDOMParser.cpp.diff?r1=1.17&r2=1.18 1.37 +4 -0 xml-xerces/c/src/xercesc/util/Makefile.in http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Makefile.in.diff?r1=1.36&r2=1.37 1.11 +12 -0 xml-xerces/c/src/xercesc/util/QName.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/QName.cpp.diff?r1=1.10&r2=1.11 1.14 +8 -1 xml-xerces/c/src/xercesc/util/XMLBigDecimal.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/XMLBigDecimal.cpp.diff?r1=1.13&r2=1.14 1.6 +12 -0 xml-xerces/c/src/xercesc/util/XMLStringTokenizer.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/XMLStringTokenizer.cpp.diff?r1=1.5&r2=1.6 1.9 +31 -1 xml-xerces/c/src/xercesc/util/XMLURL.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/XMLURL.cpp.diff?r1=1.8&r2=1.9 1.17 +26 -1 xml-xerces/c/src/xercesc/util/XMLUri.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/XMLUri.cpp.diff?r1=1.16&r2=1.17 1.1 xml-xerces/c/src/xercesc/util/OutOfMemoryException.hpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/OutOfMemoryException.hpp?rev=1.1 1.17 +6 -2 xml-xerces/c/src/xercesc/util/Platforms/AIX/AIXPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/AIX/AIXPlatformUtils.cpp.diff?r1=1.16&r2=1.17 1.8 +8 -1 xml-xerces/c/src/xercesc/util/Platforms/BeOS/BeOSPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/BeOS/BeOSPlatformUtils.cpp.diff?r1=1.7&r2=1.8 1.14 +8 -1 xml-xerces/c/src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp.diff?r1=1.13&r2=1.14 1.14 +8 -0 xml-xerces/c/src/xercesc/util/Platforms/HPUX/HPPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/HPUX/HPPlatformUtils.cpp.diff?r1=1.13&r2=1.14 1.13 +8 -1 xml-xerces/c/src/xercesc/util/Platforms/IRIX/IRIXPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/IRIX/IRIXPlatformUtils.cpp.diff?r1=1.12&r2=1.13 1.17 +8 -1 xml-xerces/c/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/Linux/LinuxPlatformUtils.cpp.diff?r1=1.16&r2=1.17 1.5 +5 -1 xml-xerces/c/src/xercesc/util/Platforms/NetBSD/NetBSDPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/NetBSD/NetBSDPlatformUtils.cpp.diff?r1=1.4&r2=1.5 1.12 +15 -3 xml-xerces/c/src/xercesc/util/Platforms/OS390/OS390PlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/OS390/OS390PlatformUtils.cpp.diff?r1=1.11&r2=1.12 1.12 +6 -2 xml-xerces/c/src/xercesc/util/Platforms/OS400/OS400PlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/OS400/OS400PlatformUtils.cpp.diff?r1=1.11&r2=1.12 1.9 +8 -0 xml-xerces/c/src/xercesc/util/Platforms/OpenServer/OpenServerPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/OpenServer/OpenServerPlatformUtils.cpp.diff?r1=1.8&r2=1.9 1.15 +6 -1 xml-xerces/c/src/xercesc/util/Platforms/Solaris/SolarisPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/Solaris/SolarisPlatformUtils.cpp.diff?r1=1.14&r2=1.15 1.10 +8 -0 xml-xerces/c/src/xercesc/util/Platforms/Tandem/TandemPlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/Tandem/TandemPlatformUtils.cpp.diff?r1=1.9&r2=1.10 1.11 +6 -1 xml-xerces/c/src/xercesc/util/Platforms/Tru64/Tru64PlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/Tru64/Tru64PlatformUtils.cpp.diff?r1=1.10&r2=1.11 1.11 +8 -0 xml-xerces/c/src/xercesc/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp.diff?r1=1.10&r2=1.11 1.4 +14 -2 xml-xerces/c/src/xercesc/util/regx/BMPattern.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/regx/BMPattern.cpp.diff?r1=1.3&r2=1.4 1.15 +24 -4 xml-xerces/c/src/xercesc/util/regx/RegularExpression.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/util/regx/RegularExpression.cpp.diff?r1=1.14&r2=1.15 1.29 +8 -2 xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp.diff?r1=1.28&r2=1.29 1.9 +14 -1 xml-xerces/c/src/xercesc/validators/datatype/AnyURIDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/AnyURIDatatypeValidator.cpp.diff?r1=1.8&r2=1.9 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/DateDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/DateDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/DateTimeDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/DateTimeDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.9 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/DateTimeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/DateTimeValidator.cpp.diff?r1=1.8&r2=1.9 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/DayDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/DayDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/DurationDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/DurationDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.11 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/ListDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/ListDatatypeValidator.cpp.diff?r1=1.10&r2=1.11 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/MonthDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/MonthDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/MonthDayDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/MonthDayDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/TimeDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/TimeDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.12 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp.diff?r1=1.11&r2=1.12 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/YearDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/YearDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.7 +9 -1 xml-xerces/c/src/xercesc/validators/datatype/YearMonthDatatypeValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/datatype/YearMonthDatatypeValidator.cpp.diff?r1=1.6&r2=1.7 1.14 +16 -0 xml-xerces/c/src/xercesc/validators/schema/GeneralAttributeCheck.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/GeneralAttributeCheck.cpp.diff?r1=1.13&r2=1.14 1.9 +8 -0 xml-xerces/c/src/xercesc/validators/schema/SchemaGrammar.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/SchemaGrammar.cpp.diff?r1=1.8&r2=1.9 1.38 +12 -1 xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp.diff?r1=1.37&r2=1.38 1.87 +50 -1 xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp.diff?r1=1.86&r2=1.87 1.7 +8 -0 xml-xerces/c/src/xercesc/validators/schema/identity/FieldValueMap.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/identity/FieldValueMap.cpp.diff?r1=1.6&r2=1.7 1.5 +8 -0 xml-xerces/c/src/xercesc/validators/schema/identity/IdentityConstraint.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/identity/IdentityConstraint.cpp.diff?r1=1.4&r2=1.5 1.9 +8 -0 xml-xerces/c/src/xercesc/validators/schema/identity/ValueStoreCache.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/identity/ValueStoreCache.cpp.diff?r1=1.8&r2=1.9 1.9 +12 -0 xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcher.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcher.cpp.diff?r1=1.8&r2=1.9 1.5 +8 -0 xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcherStack.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcherStack.cpp.diff?r1=1.4&r2=1.5 1.9 +8 -0 xml-xerces/c/src/xercesc/validators/schema/identity/XercesXPath.cpp http://cvs.apache.org/viewcvs/xml-xerces/c/src/xercesc/validators/schema/identity/XercesXPath.cpp.diff?r1=1.8&r2=1.9 --------------------------------------------------------------------- To unsubscribe, e-mail: deangardner@example.org For additional commands, e-mail: deangardner@example.org From xercesdeangardner@example.org Wed Oct 01 17:42:09 2003 Return-Path: <xercesdeangardner@example.org> Delivered-To: deangardner@example.org Received: (qmail 98044 invoked from network); 1 Oct 2003 17:42:09 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 1 Oct 2003 17:42:09 -0000 Received: (qmail 39291 invoked by uid 500); 1 Oct 2003 17:41:50 -0000 Delivered-To: deangardner@example.org Received: (qmail 39270 invoked by uid 500); 1 Oct 2003 17:41:50 -0000 Mailing-List: contact deangardner@example.org; run by ezmlm Precedence: bulk list-help: <mailto:deangardner@example.org> list-unsubscribe: <mailto:deangardner@example.org> list-post: <mailto:deangardner@example.org> Reply-To: <deangardner@example.org> Delivered-To: mailing list deangardner@example.org Received: (qmail 39236 invoked from network); 1 Oct 2003 17:41:50 -0000 Received: from unknown (HELO minotaur.apache.org) (83.161.120.155) by daedalus.apache.org with SMTP; 1 Oct 2003 17:41:50 -0000 Received: (qmail 97752 invoked by uid 1240); 1 Oct 2003 17:41:58 -0000 Date: 1 Oct 2003 17:41:58 -0000 Message-ID: <deangardner@example.org> From: deangardner@example.org To: deangardner@example.org Subject: cvs commit: xml-xerces/c/Projects/Win32/VC7/xerces-all/XercesLib XercesLib.vcproj X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N neilg 2003/10/01 10:41:58 Modified: c/Projects/Win32/VC6/xerces-all/XercesLib XercesLib.dsp c/Projects/Win32/VC7/xerces-all/XercesLib XercesLib.vcproj Log: project files for bug 23415, improved out-of-memory handling. Again, thanks to David Cargill Revision Changes Path 1.156 +4 -0 xml-xerces/c/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp Index: XercesLib.dsp =================================================================== RCS file: /home/cvs/xml-xerces/c/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp,v retrieving revision 1.155 retrieving revision 1.156 diff -u -r1.155 -r1.156 --- XercesLib.dsp 30 Sep 2003 18:12:40 -0000 1.155 +++ XercesLib.dsp 1 Oct 2003 17:41:58 -0000 1.156 @@ -615,6 +615,10 @@ # End Source File # Begin Source File +SOURCE=..\..\..\..\..\src\xercesc\util\OutOfMemoryException.hpp +# End Source File +# Begin Source File + SOURCE=..\..\..\..\..\src\xercesc\util\PanicHandler.cpp # End Source File # Begin Source File 1.28 +3 -0 xml-xerces/c/Projects/Win32/VC7/xerces-all/XercesLib/XercesLib.vcproj Index: XercesLib.vcproj =================================================================== RCS file: /home/cvs/xml-xerces/c/Projects/Win32/VC7/xerces-all/XercesLib/XercesLib.vcproj,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- XercesLib.vcproj 3 Sep 2003 15:09:55 -0000 1.27 +++ XercesLib.vcproj 1 Oct 2003 17:41:58 -0000 1.28 @@ -258,6 +258,9 @@ RelativePath="..\..\..\..\..\src\xercesc\util\NullPointerException.hpp"> </File> <File + RelativePath="..\..\..\..\..\src\xercesc\util\OutOfMemoryException.hpp"> + </File> + <File RelativePath="..\..\..\..\..\src\xercesc\util\PanicHandler.cpp"> </File> <File --------------------------------------------------------------------- To unsubscribe, e-mail: deangardner@example.org For additional commands, e-mail: deangardner@example.org From xercesdeangardner@example.org Thu Oct 02 09:33:25 2003 Return-Path: <xercesdeangardner@example.org> Delivered-To: deangardner@example.org Received: (qmail 56550 invoked from network); 2 Oct 2003 09:33:25 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Oct 2003 09:33:25 -0000 Received: (qmail 52384 invoked by uid 500); 2 Oct 2003 09:32:59 -0000 Delivered-To: deangardner@example.org Received: (qmail 52364 invoked by uid 500); 2 Oct 2003 09:32:58 -0000 Mailing-List: contact deangardner@example.org; run by ezmlm Precedence: bulk list-help: <mailto:deangardner@example.org> list-unsubscribe: <mailto:deangardner@example.org> list-post: <mailto:deangardner@example.org> Reply-To: <deangardner@example.org> Delivered-To: mailing list deangardner@example.org Received: (qmail 52351 invoked from network); 2 Oct 2003 09:32:58 -0000 Received: from unknown (HELO minotaur.apache.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Oct 2003 09:32:58 -0000 Received: (qmail 56532 invoked by uid 1595); 2 Oct 2003 09:33:24 -0000 Date: 2 Oct 2003 09:33:24 -0000 Message-ID: <deangardner@example.org> From: deangardner@example.org To: deangardner@example.org Subject: cvs commit: xml-xerces/c/src/xercesc/util XMLURL.cpp X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N gareth 2003/10/02 02:33:24 Modified: c/src/xercesc/dom/deprecated DOMString.cpp c/src/xercesc/dom/impl DOMDocumentImpl.cpp c/src/xercesc/internal MemoryManagerArrayImpl.cpp MemoryManagerImpl.cpp c/src/xercesc/util XMLURL.cpp Log: Removed ^Z from end of files which was preventing compilation under gcc 2.96. Revision Changes Path 1.9 +1 -2 xml-xerces/c/src/xercesc/dom/deprecated/DOMString.cpp Index: DOMString.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/deprecated/DOMString.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- DOMString.cpp 1 Oct 2003 16:32:37 -0000 1.8 +++ DOMString.cpp 2 Oct 2003 09:33:23 -0000 1.9 @@ -1219,4 +1219,3 @@ XERCES_CPP_NAMESPACE_END - \ No newline at end of file 1.48 +1 -2 xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp Index: DOMDocumentImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- DOMDocumentImpl.cpp 1 Oct 2003 16:32:37 -0000 1.47 +++ DOMDocumentImpl.cpp 2 Oct 2003 09:33:23 -0000 1.48 @@ -1403,4 +1403,3 @@ } XERCES_CPP_NAMESPACE_END - \ No newline at end of file 1.4 +3 -1 xml-xerces/c/src/xercesc/internal/MemoryManagerArrayImpl.cpp Index: MemoryManagerArrayImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/MemoryManagerArrayImpl.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MemoryManagerArrayImpl.cpp 1 Oct 2003 16:32:38 -0000 1.3 +++ MemoryManagerArrayImpl.cpp 2 Oct 2003 09:33:23 -0000 1.4 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.4 2003/10/02 09:33:23 gareth + * Removed ^Z from end of files which was preventing compilation under gcc 2.96. + * * Revision 1.3 2003/10/01 16:32:38 neilg * improve handling of out of memory conditions, bug #23415. Thanks to David Cargill. * @@ -102,4 +105,3 @@ XERCES_CPP_NAMESPACE_END - \ No newline at end of file 1.3 +3 -1 xml-xerces/c/src/xercesc/internal/MemoryManagerImpl.cpp Index: MemoryManagerImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/MemoryManagerImpl.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MemoryManagerImpl.cpp 1 Oct 2003 16:32:38 -0000 1.2 +++ MemoryManagerImpl.cpp 2 Oct 2003 09:33:23 -0000 1.3 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.3 2003/10/02 09:33:23 gareth + * Removed ^Z from end of files which was preventing compilation under gcc 2.96. + * * Revision 1.2 2003/10/01 16:32:38 neilg * improve handling of out of memory conditions, bug #23415. Thanks to David Cargill. * @@ -94,4 +97,3 @@ } XERCES_CPP_NAMESPACE_END - \ No newline at end of file 1.10 +1 -2 xml-xerces/c/src/xercesc/util/XMLURL.cpp Index: XMLURL.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLURL.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- XMLURL.cpp 1 Oct 2003 16:32:39 -0000 1.9 +++ XMLURL.cpp 2 Oct 2003 09:33:24 -0000 1.10 @@ -1467,4 +1467,3 @@ XERCES_CPP_NAMESPACE_END - \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: deangardner@example.org For additional commands, e-mail: deangardner@example.org From xercesdeangardner@example.org Thu Oct 02 11:07:28 2003 Return-Path: <xercesdeangardner@example.org> Delivered-To: deangardner@example.org Received: (qmail 99896 invoked from network); 2 Oct 2003 11:07:28 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Oct 2003 11:07:28 -0000 Received: (qmail 70834 invoked by uid 500); 2 Oct 2003 11:07:26 -0000 Delivered-To: deangardner@example.org Received: (qmail 70804 invoked by uid 500); 2 Oct 2003 11:07:26 -0000 Mailing-List: contact deangardner@example.org; run by ezmlm Precedence: bulk list-help: <mailto:deangardner@example.org> list-unsubscribe: <mailto:deangardner@example.org> list-post: <mailto:deangardner@example.org> Reply-To: <deangardner@example.org> Delivered-To: mailing list deangardner@example.org Received: (qmail 70788 invoked from network); 2 Oct 2003 11:07:26 -0000 Received: from unknown (HELO minotaur.apache.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Oct 2003 11:07:26 -0000 Received: (qmail 99886 invoked by uid 1595); 2 Oct 2003 11:07:26 -0000 Date: 2 Oct 2003 11:07:26 -0000 Message-ID: <deangardner@example.org> From: deangardner@example.org To: deangardner@example.org Subject: cvs commit: xml-xerces/c/src/xercesc/util XMLString.cpp XMLString.hpp X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N gareth 2003/10/02 04:07:26 Modified: c/src/xercesc/util XMLString.cpp XMLString.hpp Log: Made the non-memory manager version of replicate not inlined. Updated the documentation for the memory manager versions so they don't tell you you should call release. Revision Changes Path 1.25 +14 -1 xml-xerces/c/src/xercesc/util/XMLString.cpp Index: XMLString.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLString.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- XMLString.cpp 1 Oct 2003 00:22:20 -0000 1.24 +++ XMLString.cpp 2 Oct 2003 11:07:26 -0000 1.25 @@ -491,6 +491,19 @@ } +XMLCh* XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4replicate(const XMLCh* const toRep) +{ + // If a null string, return a null string! + XMLCh* ret = 0; + if (toRep) + { + const unsigned int len = stringLen(toRep); + ret = new XMLCh[len + 1]; + memcpy(ret, toRep, (len + 1) * sizeof(XMLCh)); + } + return ret; +} + char* XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4replicate(const char* const toRep) { // If a null string, return a null string 1.20 +38 -27 xml-xerces/c/src/xercesc/util/XMLString.hpp Index: XMLString.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLString.hpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- XMLString.hpp 1 Oct 2003 00:22:20 -0000 1.19 +++ XMLString.hpp 2 Oct 2003 11:07:26 -0000 1.20 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.20 2003/10/02 11:07:26 gareth + * Made the non-memory manager version of replicate not inlined. Updated the documentation for the memory manager versions so they don't tell you you should call release. + * * Revision 1.19 2003/10/01 00:22:20 knoaman * Add a lastIndexOf method that takes the string length as one of the params. * @@ -839,6 +842,17 @@ * @see XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release(char**) */ static char* replicate(const char* const toRep); + + + + /** Replicates a string + * NOTE: The returned buffer is allocated with the MemoryManager. It is the + * responsibility of the caller to delete it when not longer needed. + * + * @param toRep The string to replicate + * @param manager The MemoryManager to use to allocate the string + * @return Returns a pointer to the replicated string + */ static char* replicate(const char* const toRep, MemoryManager* const manager); @@ -852,6 +866,16 @@ * @see XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release(XMLCh**) */ static XMLCh* replicate(const XMLCh* const toRep); + + + /** Replicates a string + * NOTE: The returned buffer is allocated with the MemoryManager. It is the + * responsibility of the caller to delete it when not longer needed. + * + * @param toRep The string to replicate + * @param manager The MemoryManager to use to allocate the string + * @return Returns a pointer to the replicated string + */ static XMLCh* replicate(const XMLCh* const toRep, MemoryManager* const manager); @@ -1531,6 +1555,20 @@ } } +inline XMLCh* XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4replicate(const XMLCh* const toRep, + MemoryManager* const manager) +{ + // If a null string, return a null string! + XMLCh* ret = 0; + if (toRep) + { + const unsigned int len = stringLen(toRep); + ret = (XMLCh*) manager->allocate((len+1) * sizeof(XMLCh)); //new XMLCh[len + 1]; + memcpy(ret, toRep, (len + 1) * sizeof(XMLCh)); + } + return ret; +} + inline bool XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4startsWith( const XMLCh* const toTest , const XMLCh* const prefix) { @@ -1551,33 +1589,6 @@ return regionMatches(toTest, XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stringLen(toTest) - suffixLen, suffix, 0, suffixLen); -} - -inline XMLCh* XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4replicate(const XMLCh* const toRep) -{ - // If a null string, return a null string! - XMLCh* ret = 0; - if (toRep) - { - const unsigned int len = stringLen(toRep); - ret = new XMLCh[len + 1]; - memcpy(ret, toRep, (len + 1) * sizeof(XMLCh)); - } - return ret; -} - -inline XMLCh* XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4replicate(const XMLCh* const toRep, - MemoryManager* const manager) -{ - // If a null string, return a null string! - XMLCh* ret = 0; - if (toRep) - { - const unsigned int len = stringLen(toRep); - ret = (XMLCh*) manager->allocate((len+1) * sizeof(XMLCh)); //new XMLCh[len + 1]; - memcpy(ret, toRep, (len + 1) * sizeof(XMLCh)); - } - return ret; } inline bool XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4validateRegion(const XMLCh* const str1, --------------------------------------------------------------------- To unsubscribe, e-mail: deangardner@example.org For additional commands, e-mail: deangardner@example.org From xercesdeangardner@example.org Thu Oct 02 18:18:18 2003 Return-Path: <xercesdeangardner@example.org> Delivered-To: deangardner@example.org Received: (qmail 20862 invoked from network); 2 Oct 2003 18:18:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Oct 2003 18:18:18 -0000 Received: (qmail 5379 invoked by uid 500); 2 Oct 2003 18:18:08 -0000 Delivered-To: deangardner@example.org Received: (qmail 5300 invoked by uid 500); 2 Oct 2003 18:18:07 -0000 Mailing-List: contact deangardner@example.org; run by ezmlm Precedence: bulk list-help: <mailto:deangardner@example.org> list-unsubscribe: <mailto:deangardner@example.org> list-post: <mailto:deangardner@example.org> Reply-To: <deangardner@example.org> Delivered-To: mailing list deangardner@example.org Received: (qmail 5287 invoked from network); 2 Oct 2003 18:18:07 -0000 Received: from unknown (HELO minotaur.apache.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Oct 2003 18:18:07 -0000 Received: (qmail 20831 invoked by uid 1678); 2 Oct 2003 18:18:15 -0000 Date: 2 Oct 2003 18:18:15 -0000 Message-ID: <deangardner@example.org> From: deangardner@example.org To: deangardner@example.org Subject: cvs commit: xml-xerces/java/src/org/apache/xerces/impl/dtd XML11NSDTDValidator.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mrglavas 2003/10/02 11:18:15 Added: java/src/org/apache/xerces/impl XML11NSDocumentScannerImpl.java java/src/org/apache/xerces/impl/dtd XML11NSDTDValidator.java Log: Adding a specialized document scanner and DTD validator for namepace binding of XML 1.1 documents. This was inspired by the improvement that was gained from a similar change for XML 1.0. Preliminary performance testing showed a 5-10% improvement depending on the characteristics of the document. Revision Changes Path 1.1 xml-xerces/java/src/org/apache/xerces/impl/XML11NSDocumentScannerImpl.java Index: XML11NSDocumentScannerImpl.java =================================================================== /* * The Apache Software License, Version 1.1 * * * Copyright (c) 1999-2003 The Apache Software Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Xerces" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact deangardner@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation and was * originally based on software copyright (c) 2002, International * Business Machines, Inc., http://www.apache.org. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ package org.apache.xerces.impl; import java.io.IOException; import org.apache.xerces.impl.dtd.XMLDTDValidatorFilter; import org.apache.xerces.impl.msg.XMLMessageFormatter; import org.apache.xerces.util.XMLAttributesImpl; import org.apache.xerces.util.XMLSymbols; import org.apache.xerces.xni.NamespaceContext; import org.apache.xerces.xni.QName; import org.apache.xerces.xni.XMLDocumentHandler; import org.apache.xerces.xni.XNIException; import org.apache.xerces.xni.parser.XMLComponentManager; import org.apache.xerces.xni.parser.XMLConfigurationException; import org.apache.xerces.xni.parser.XMLDocumentSource; /** * The scanner acts as the source for the document * information which is communicated to the document handler. * * This class scans an XML document, checks if document has a DTD, and if * DTD is not found the scanner will remove the DTD Validator from the pipeline and perform * namespace binding. * * Note: This scanner should only be used when the namespace processing is on! * * <p> * This component requires the following features and properties from the * component manager that uses it: * <ul> * <li>http://xml.org/sax/features/namespaces {true} -- if the value of this * feature is set to false this scanner must not be used.</li> * <li>http://xml.org/sax/features/validation</li> * <li>http://apache.org/xml/features/nonvalidating/load-external-dtd</li> * <li>http://apache.org/xml/features/scanner/notify-char-refs</li> * <li>http://apache.org/xml/features/scanner/notify-builtin-refs</li> * <li>http://apache.org/xml/properties/internal/symbol-table</li> * <li>http://apache.org/xml/properties/internal/error-reporter</li> * <li>http://apache.org/xml/properties/internal/entity-manager</li> * <li>http://apache.org/xml/properties/internal/dtd-scanner</li> * </ul> * * @author Elena Litani, IBM * @author Michael Glavassevich, IBM */ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { /** * If is true, the dtd validator is no longer in the pipeline * and the scanner should bind namespaces */ protected boolean fBindNamespaces; /** * If validating parser, make sure we report an error in the * scanner if DTD grammar is missing. */ protected boolean fPerformValidation; protected String[] fUri= new String[4]; protected String[] fLocalpart = new String[4]; protected int fLength = 0; // private data // /** DTD validator */ private XMLDTDValidatorFilter fDTDValidator; /** * The scanner is responsible for removing DTD validator * from the pipeline if it is not needed. * * @param validator the DTD validator from the pipeline */ public void setDTDValidator(XMLDTDValidatorFilter validator){ fDTDValidator = validator; } /** * Scans a start element. This method will handle the binding of * namespace information and notifying the handler of the start * of the element. * <p> * <pre> * [44] EmptyElemTag 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= '&lt;' Name (S Attribute)* S? '/>' * [40] STag 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= '&lt;' Name (S Attribute)* S? '>' * </pre> * <p> * <strong>Note:</strong> This method assumes that the leading * '&lt;' character has been consumed. * <p> * <strong>Note:</strong> This method uses the fElementQName and * fAttributes variables. The contents of these variables will be * destroyed. The caller should copy important information out of * these variables before calling this method. * * @return True if element is empty. (i.e. It matches * production [44]. */ protected boolean scanStartElement() throws IOException, XNIException { if (DEBUG_CONTENT_SCANNING) System.out.println(">>> scanStartElementNS()"); // Note: namespace processing is on by default fEntityScanner.scanQName(fElementQName); // REVISIT - [Q] Why do we need this local variable? -- mrglavas String rawname = fElementQName.rawname; if (fBindNamespaces) { fNamespaceContext.pushContext(); if (fScannerState == SCANNER_STATE_ROOT_ELEMENT) { if (fPerformValidation) { fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "MSG_GRAMMAR_NOT_FOUND", new Object[]{ rawname}, XMLErrorReporter.SEVERITY_ERROR); if (fDoctypeName == null || !fDoctypeName.equals(rawname)) { fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN, "RootElementTypeMustMatchDoctypedecl", new Object[]{fDoctypeName, rawname}, XMLErrorReporter.SEVERITY_ERROR); } } } } // push element stack fCurrentElement = fElementStack.pushElement(fElementQName); // attributes boolean empty = false; fAttributes.removeAllAttributes(); do { // spaces boolean sawSpace = fEntityScanner.skipSpaces(); // end tag? int c = fEntityScanner.peekChar(); if (c == '>') { fEntityScanner.scanChar(); break; } else if (c == '/') { fEntityScanner.scanChar(); if (!fEntityScanner.skipChar('>')) { reportFatalError("ElementUnterminated", new Object[]{rawname}); } empty = true; break; } else if (!isValidNameStartChar(c) || !sawSpace) { reportFatalError("ElementUnterminated", new Object[]{rawname}); } // attributes scanAttribute(fAttributes); } while (true); if (fBindNamespaces) { // REVISIT: is it required? forbit xmlns prefix for element if (fElementQName.prefix == XMLSymbols.PREFIX_XMLNS) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "ElementXMLNSPrefix", new Object[]{fElementQName.rawname}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // bind the element String prefix = fElementQName.prefix != null ? fElementQName.prefix : XMLSymbols.EMPTY_STRING; // assign uri to the element fElementQName.uri = fNamespaceContext.getURI(prefix); // make sure that object in the element stack is updated as well fCurrentElement.uri = fElementQName.uri; if (fElementQName.prefix == null && fElementQName.uri != null) { fElementQName.prefix = XMLSymbols.EMPTY_STRING; } if (fElementQName.prefix != null && fElementQName.uri == null) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "ElementPrefixUnbound", new Object[]{fElementQName.prefix, fElementQName.rawname}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // bind attributes (xmlns are already bound bellow) int length = fAttributes.getLength(); fLength = 0; //initialize structure for (int i = 0; i < length; i++) { fAttributes.getName(i, fAttributeQName); String aprefix = fAttributeQName.prefix != null ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING; String uri = fNamespaceContext.getURI(aprefix); // REVISIT: try removing the first "if" and see if it is faster. // if (fAttributeQName.uri != null && fAttributeQName.uri == uri) { checkDuplicates(fAttributeQName, fAttributes); continue; } if (aprefix != XMLSymbols.EMPTY_STRING) { fAttributeQName.uri = uri; if (uri == null) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "AttributePrefixUnbound", new Object[]{fElementQName.rawname,fAttributeQName.rawname,aprefix}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } fAttributes.setURI(i, uri); checkDuplicates(fAttributeQName, fAttributes); } } } // call handler if (fDocumentHandler != null) { if (empty) { //decrease the markup depth.. fMarkupDepth--; // check that this element was opened in the same entity if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) { reportFatalError("ElementEntityMismatch", new Object[]{fCurrentElement.rawname}); } fDocumentHandler.emptyElement(fElementQName, fAttributes, null); if (fBindNamespaces) { fNamespaceContext.popContext(); } //pop the element off the stack.. fElementStack.popElement(fElementQName); } else { fDocumentHandler.startElement(fElementQName, fAttributes, null); } } if (DEBUG_CONTENT_SCANNING) System.out.println("<<< scanStartElement(): "+empty); return empty; } // scanStartElement():boolean private final void checkDuplicates(QName qname, XMLAttributesImpl attributes){ // Example: <foo xmlns:a='NS' xmlns:b='NS' a:attr='v1' b:attr='v2'/> // search if such attribute already exists for (int i = 0; i < fLength; i++) { if (qname.uri == fUri[i] && fLocalpart[i].equals(qname.localpart)) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "AttributeNSNotUnique", new Object[]{fElementQName.rawname,qname.rawname, qname.uri}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } } int index = fLength; if (fLength++ == fUri.length) { String[] uris = new String[fUri.length + 4]; String[] lps = new String [fUri.length + 4]; System.arraycopy(fUri, 0, uris, 0, fUri.length); System.arraycopy(fLocalpart, 0, lps, 0, fLocalpart.length); fUri = uris; fLocalpart = lps; } fUri[index] = qname.uri; fLocalpart[index] = qname.localpart; } /** * Scans an attribute. * <p> * <pre> * [41] Attribute 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= Name Eq AttValue * </pre> * <p> * <strong>Note:</strong> This method assumes that the next * character on the stream is the first character of the attribute * name. * <p> * <strong>Note:</strong> This method uses the fAttributeQName and * fQName variables. The contents of these variables will be * destroyed. * * @param attributes The attributes list for the scanned attribute. */ protected void scanAttribute(XMLAttributesImpl attributes) throws IOException, XNIException { if (DEBUG_CONTENT_SCANNING) System.out.println(">>> scanAttribute()"); // name fEntityScanner.scanQName(fAttributeQName); // equals fEntityScanner.skipSpaces(); if (!fEntityScanner.skipChar('=')) { reportFatalError("EqRequiredInAttribute", new Object[]{fCurrentElement.rawname,fAttributeQName.rawname}); } fEntityScanner.skipSpaces(); // content int oldLen = attributes.getLength(); attributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, null); // WFC: Unique Att Spec if (oldLen == attributes.getLength()) { reportFatalError("AttributeNotUnique", new Object[]{fCurrentElement.rawname, fAttributeQName.rawname}); } //REVISIT: one more case needs to be included: external PE and standalone is no boolean isVC = fHasExternalDTD && !fStandalone; // REVISIT: it seems that this function should not take attributes, and length scanAttributeValue(this.fTempString, fTempString2, fAttributeQName.rawname, attributes, oldLen, isVC,fCurrentElement.rawname); String value = fTempString.toString(); attributes.setValue(oldLen, value); attributes.setNonNormalizedValue(oldLen, fTempString2.toString()); attributes.setSpecified(oldLen, true); // record namespace declarations if any. if (fBindNamespaces) { String localpart = fAttributeQName.localpart; String prefix = fAttributeQName.prefix != null ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING; // when it's of form xmlns="..." or xmlns:prefix="...", // it's a namespace declaration. but prefix:xmlns="..." isn't. if (prefix == XMLSymbols.PREFIX_XMLNS || prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) { // get the internalized value of this attribute String uri = fSymbolTable.addSymbol(value); // 1. "xmlns" can't be bound to any namespace if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXMLNS", new Object[]{fAttributeQName}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // 2. the namespace for "xmlns" can't be bound to any prefix if (uri == NamespaceContext.XMLNS_URI) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXMLNS", new Object[]{fAttributeQName}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // 3. "xml" can't be bound to any other namespace than it's own if (localpart == XMLSymbols.PREFIX_XML) { if (uri != NamespaceContext.XML_URI) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXML", new Object[]{fAttributeQName}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } } // 4. the namespace for "xml" can't be bound to any other prefix else { if (uri ==NamespaceContext.XML_URI) { fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXML", new Object[]{fAttributeQName}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } } prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING; // Declare prefix in context. Removing the association between a prefix and a // namespace name is permitted in XML 1.1, so if the uri value is the empty string, // the prefix is being unbound. -- mrglavas fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null); // bind namespace attribute to a namespace attributes.setURI(oldLen, fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS)); } else { // attempt to bind attribute if (fAttributeQName.prefix != null) { attributes.setURI(oldLen, fNamespaceContext.getURI(fAttributeQName.prefix)); } } } if (DEBUG_CONTENT_SCANNING) System.out.println("<<< scanAttribute()"); } // scanAttribute(XMLAttributes) /** * Scans an end element. * <p> * <pre> * [42] ETag 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= '&lt;/' Name S? '>' * </pre> * <p> * <strong>Note:</strong> This method uses the fElementQName variable. * The contents of this variable will be destroyed. The caller should * copy the needed information out of this variable before calling * this method. * * @return The element depth. */ protected int scanEndElement() throws IOException, XNIException { if (DEBUG_CONTENT_SCANNING) System.out.println(">>> scanEndElement()"); // pop context fElementStack.popElement(fElementQName) ; // Take advantage of the fact that next string _should_ be "fElementQName.rawName", //In scanners most of the time is consumed on checks done for XML characters, we can // optimize on it and avoid the checks done for endElement, //we will also avoid symbol table lookup - deangardner@example.org // this should work both for namespace processing true or false... //REVISIT: if the string is not the same as expected.. we need to do better error handling.. //We can skip this for now... In any case if the string doesn't match -- document is not well formed. if (!fEntityScanner.skipString(fElementQName.rawname)) { reportFatalError("ETagRequired", new Object[]{fElementQName.rawname}); } // end fEntityScanner.skipSpaces(); if (!fEntityScanner.skipChar('>')) { reportFatalError("ETagUnterminated", new Object[]{fElementQName.rawname}); } fMarkupDepth--; //we have increased the depth for two markup "<" characters fMarkupDepth--; // check that this element was opened in the same entity if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) { reportFatalError("ElementEntityMismatch", new Object[]{fCurrentElement.rawname}); } // call handler if (fDocumentHandler != null ) { fDocumentHandler.endElement(fElementQName, null); if (fBindNamespaces) { fNamespaceContext.popContext(); } } return fMarkupDepth; } // scanEndElement():int public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { super.reset(componentManager); fPerformValidation = false; fBindNamespaces = false; } /** Creates a content dispatcher. */ protected Dispatcher createContentDispatcher() { return new NS11ContentDispatcher(); } // createContentDispatcher():Dispatcher /** * Dispatcher to handle content scanning. */ protected final class NS11ContentDispatcher extends ContentDispatcher { /** * Scan for root element hook. This method is a hook for * subclasses to add code that handles scanning for the root * element. This method will also attempt to remove DTD validator * from the pipeline, if there is no DTD grammar. If DTD validator * is no longer in the pipeline bind namespaces in the scanner. * * * @return True if the caller should stop and return true which * allows the scanner to switch to a new scanning * dispatcher. A return value of false indicates that * the content dispatcher should continue as normal. */ protected boolean scanRootElementHook() throws IOException, XNIException { if (fDTDValidator == null) { fBindNamespaces = true; } else if (!fDTDValidator.hasGrammar()) { fBindNamespaces = true; fPerformValidation = fDTDValidator.validate(); // re-configure pipeline XMLDocumentSource source = fDTDValidator.getDocumentSource(); XMLDocumentHandler handler = fDTDValidator.getDocumentHandler(); source.setDocumentHandler(handler); if (handler != null) handler.setDocumentSource(source); fDTDValidator.setDocumentSource(null); fDTDValidator.setDocumentHandler(null); } if (scanStartElement()) { setScannerState(SCANNER_STATE_TRAILING_MISC); setDispatcher(fTrailingMiscDispatcher); return true; } return false; } // scanRootElementHook():boolean } } 1.1 xml-xerces/java/src/org/apache/xerces/impl/dtd/XML11NSDTDValidator.java Index: XML11NSDTDValidator.java =================================================================== /* * The Apache Software License, Version 1.1 * * * Copyright (c) 1999-2003 The Apache Software Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Xerces" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact deangardner@example.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation and was * originally based on software copyright (c) 2002, International * Business Machines, Inc., http://www.apache.org. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ package org.apache.xerces.impl.dtd; import org.apache.xerces.impl.XMLErrorReporter; import org.apache.xerces.impl.msg.XMLMessageFormatter; import org.apache.xerces.util.XMLSymbols; import org.apache.xerces.xni.Augmentations; import org.apache.xerces.xni.NamespaceContext; import org.apache.xerces.xni.QName; import org.apache.xerces.xni.XMLAttributes; import org.apache.xerces.xni.XNIException; /** * The DTD validator. The validator implements a document * filter: receiving document events from the scanner; validating * the content and structure; augmenting the InfoSet, if applicable; * and notifying the parser of the information resulting from the * validation process. * <p> Formerly, this component also handled DTD events and grammar construction. * To facilitate the development of a meaningful DTD grammar caching/preparsing * framework, this functionality has been moved into the XMLDTDLoader * class. Therefore, this class no longer implements the DTDFilter * or DTDContentModelFilter interfaces. * <p> * This component requires the following features and properties from the * component manager that uses it: * <ul> * <li>http://xml.org/sax/features/namespaces</li> * <li>http://xml.org/sax/features/validation</li> * <li>http://apache.org/xml/features/validation/dynamic</li> * <li>http://apache.org/xml/properties/internal/symbol-table</li> * <li>http://apache.org/xml/properties/internal/error-reporter</li> * <li>http://apache.org/xml/properties/internal/grammar-pool</li> * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li> * </ul> * * @author Elena Litani, IBM * @author Michael Glavassevich, IBM * * @version $Id: XML11NSDTDValidator.java,v 1.1 2003/10/02 18:18:15 mrglavas Exp $ */ public class XML11NSDTDValidator extends XML11DTDValidator { /** Attribute QName. */ private QName fAttributeQName = new QName(); /** Bind namespaces */ protected final void startNamespaceScope(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException { // add new namespace context fNamespaceContext.pushContext(); if (element.prefix == XMLSymbols.PREFIX_XMLNS) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "ElementXMLNSPrefix", new Object[] { element.rawname }, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // search for new namespace bindings int length = attributes.getLength(); for (int i = 0; i < length; i++) { String localpart = attributes.getLocalName(i); String prefix = attributes.getPrefix(i); // when it's of form xmlns="..." or xmlns:prefix="...", // it's a namespace declaration. but prefix:xmlns="..." isn't. if (prefix == XMLSymbols.PREFIX_XMLNS || prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) { // get the internalized value of this attribute String uri = fSymbolTable.addSymbol(attributes.getValue(i)); // 1. "xmlns" can't be bound to any namespace if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXMLNS", new Object[] { attributes.getQName(i)}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // 2. the namespace for "xmlns" can't be bound to any prefix if (uri == NamespaceContext.XMLNS_URI) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXMLNS", new Object[] { attributes.getQName(i)}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // 3. "xml" can't be bound to any other namespace than it's own if (localpart == XMLSymbols.PREFIX_XML) { if (uri != NamespaceContext.XML_URI) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXML", new Object[] { attributes.getQName(i)}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } } // 4. the namespace for "xml" can't be bound to any other prefix else { if (uri == NamespaceContext.XML_URI) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "CantBindXML", new Object[] { attributes.getQName(i)}, XMLErrorReporter.SEVERITY_FATAL_ERROR); } } prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING; // Declare prefix in context. Removing the association between a prefix and a // namespace name is permitted in XML 1.1, so if the uri value is the empty string, // the prefix is being unbound. -- mrglavas fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null); } } // bind the element String prefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING; element.uri = fNamespaceContext.getURI(prefix); if (element.prefix == null && element.uri != null) { element.prefix = XMLSymbols.EMPTY_STRING; } if (element.prefix != null && element.uri == null) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "ElementPrefixUnbound", new Object[] { element.prefix, element.rawname }, XMLErrorReporter.SEVERITY_FATAL_ERROR); } // bind the attributes for (int i = 0; i < length; i++) { attributes.getName(i, fAttributeQName); String aprefix = fAttributeQName.prefix != null ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING; String arawname = fAttributeQName.rawname; if (arawname == XMLSymbols.PREFIX_XMLNS) { fAttributeQName.uri = fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS); attributes.setName(i, fAttributeQName); } else if (aprefix != XMLSymbols.EMPTY_STRING) { fAttributeQName.uri = fNamespaceContext.getURI(aprefix); if (fAttributeQName.uri == null) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "AttributePrefixUnbound", new Object[] { element.rawname, arawname, aprefix }, XMLErrorReporter.SEVERITY_FATAL_ERROR); } attributes.setName(i, fAttributeQName); } } // verify that duplicate attributes don't exist // Example: <foo xmlns:a='NS' xmlns:b='NS' a:attr='v1' b:attr='v2'/> int attrCount = attributes.getLength(); for (int i = 0; i < attrCount - 1; i++) { String alocalpart = attributes.getLocalName(i); String auri = attributes.getURI(i); for (int j = i + 1; j < attrCount; j++) { String blocalpart = attributes.getLocalName(j); String buri = attributes.getURI(j); if (alocalpart == blocalpart && auri == buri) { fErrorReporter.reportError( XMLMessageFormatter.XMLNS_DOMAIN, "AttributeNSNotUnique", new Object[] { element.rawname, alocalpart, auri }, XMLErrorReporter.SEVERITY_FATAL_ERROR); } } } } // startNamespaceScope(QName,XMLAttributes) /** Handles end element. */ protected void endNamespaceScope(QName element, Augmentations augs, boolean isEmpty) throws XNIException { // bind element String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING; element.uri = fNamespaceContext.getURI(eprefix); if (element.uri != null) { element.prefix = eprefix; } // call handlers if (fDocumentHandler != null) { if (!isEmpty) { fDocumentHandler.endElement(element, augs); } } // pop context fNamespaceContext.popContext(); } // endNamespaceScope(QName,boolean) } --------------------------------------------------------------------- To unsubscribe, e-mail: deangardner@example.org For additional commands, e-mail: deangardner@example.org From xercesdeangardner@example.org Thu Oct 02 18:24:17 2003 Return-Path: <xercesdeangardner@example.org> Delivered-To: deangardner@example.org Received: (qmail 23281 invoked from network); 2 Oct 2003 18:24:17 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Oct 2003 18:24:17 -0000 Received: (qmail 16807 invoked by uid 500); 2 Oct 2003 18:24:07 -0000 Delivered-To: deangardner@example.org Received: (qmail 16789 invoked by uid 500); 2 Oct 2003 18:24:07 -0000 Mailing-List: contact deangardner@example.org; run by ezmlm Precedence: bulk list-help: <mailto:deangardner@example.org> list-unsubscribe: <mailto:deangardner@example.org> list-post: <mailto:deangardner@example.org> Reply-To: <deangardner@example.org> Delivered-To: mailing list deangardner@example.org Received: (qmail 16764 invoked from network); 2 Oct 2003 18:24:07 -0000 Received: from unknown (HELO minotaur.apache.org) (83.161.120.155) by daedalus.apache.org with SMTP; 2 Oct 2003 18:24:07 -0000 Received: (qmail 23269 invoked by uid 1678); 2 Oct 2003 18:24:15 -0000 Date: 2 Oct 2003 18:24:15 -0000 Message-ID: <deangardner@example.org> From: deangardner@example.org To: deangardner@example.org Subject: cvs commit: xml-xerces/java/src/org/apache/xerces/impl XML11NSDocumentScannerImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mrglavas 2003/10/02 11:24:15 Modified: java/src/org/apache/xerces/impl XML11NSDocumentScannerImpl.java Log: Fixing indentation. Revision Changes Path 1.2 +532 -481 xml-xerces/java/src/org/apache/xerces/impl/XML11NSDocumentScannerImpl.java Index: XML11NSDocumentScannerImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XML11NSDocumentScannerImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XML11NSDocumentScannerImpl.java 2 Oct 2003 18:18:15 -0000 1.1 +++ XML11NSDocumentScannerImpl.java 2 Oct 2003 18:24:15 -0000 1.2 @@ -99,489 +99,540 @@ * * @author Elena Litani, IBM * @author Michael Glavassevich, IBM + * + * @version */ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { - /** - * If is true, the dtd validator is no longer in the pipeline - * and the scanner should bind namespaces - */ - protected boolean fBindNamespaces; - - /** - * If validating parser, make sure we report an error in the - * scanner if DTD grammar is missing. - */ - protected boolean fPerformValidation; - - protected String[] fUri= new String[4]; - protected String[] fLocalpart = new String[4]; - protected int fLength = 0; - - - // private data - // - - /** DTD validator */ - private XMLDTDValidatorFilter fDTDValidator; - - /** - * The scanner is responsible for removing DTD validator - * from the pipeline if it is not needed. - * - * @param validator the DTD validator from the pipeline - */ - public void setDTDValidator(XMLDTDValidatorFilter validator){ - fDTDValidator = validator; - } - - /** - * Scans a start element. This method will handle the binding of - * namespace information and notifying the handler of the start - * of the element. - * <p> - * <pre> - * [44] EmptyElemTag 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= '&lt;' Name (S Attribute)* S? '/>' - * [40] STag 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= '&lt;' Name (S Attribute)* S? '>' - * </pre> - * <p> - * <strong>Note:</strong> This method assumes that the leading - * '&lt;' character has been consumed. - * <p> - * <strong>Note:</strong> This method uses the fElementQName and - * fAttributes variables. The contents of these variables will be - * destroyed. The caller should copy important information out of - * these variables before calling this method. - * - * @return True if element is empty. (i.e. It matches - * production [44]. - */ - protected boolean scanStartElement() - throws IOException, XNIException { - if (DEBUG_CONTENT_SCANNING) System.out.println(">>> scanStartElementNS()"); - - // Note: namespace processing is on by default - fEntityScanner.scanQName(fElementQName); - // REVISIT - [Q] Why do we need this local variable? -- mrglavas - String rawname = fElementQName.rawname; - if (fBindNamespaces) { - fNamespaceContext.pushContext(); - if (fScannerState == SCANNER_STATE_ROOT_ELEMENT) { - if (fPerformValidation) { - fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, - "MSG_GRAMMAR_NOT_FOUND", - new Object[]{ rawname}, - XMLErrorReporter.SEVERITY_ERROR); - - if (fDoctypeName == null || !fDoctypeName.equals(rawname)) { - fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN, - "RootElementTypeMustMatchDoctypedecl", - new Object[]{fDoctypeName, rawname}, - XMLErrorReporter.SEVERITY_ERROR); - } - } - } - } - - // push element stack - fCurrentElement = fElementStack.pushElement(fElementQName); - - // attributes - boolean empty = false; - fAttributes.removeAllAttributes(); - do { - // spaces - boolean sawSpace = fEntityScanner.skipSpaces(); - - // end tag? - int c = fEntityScanner.peekChar(); - if (c == '>') { - fEntityScanner.scanChar(); - break; - } - else if (c == '/') { - fEntityScanner.scanChar(); - if (!fEntityScanner.skipChar('>')) { - reportFatalError("ElementUnterminated", - new Object[]{rawname}); - } - empty = true; - break; - } - else if (!isValidNameStartChar(c) || !sawSpace) { - reportFatalError("ElementUnterminated", new Object[]{rawname}); - } - - // attributes - scanAttribute(fAttributes); - - } while (true); - - if (fBindNamespaces) { - // REVISIT: is it required? forbit xmlns prefix for element - if (fElementQName.prefix == XMLSymbols.PREFIX_XMLNS) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "ElementXMLNSPrefix", - new Object[]{fElementQName.rawname}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - - // bind the element - String prefix = fElementQName.prefix != null - ? fElementQName.prefix : XMLSymbols.EMPTY_STRING; - // assign uri to the element - fElementQName.uri = fNamespaceContext.getURI(prefix); - // make sure that object in the element stack is updated as well - fCurrentElement.uri = fElementQName.uri; - - if (fElementQName.prefix == null && fElementQName.uri != null) { - fElementQName.prefix = XMLSymbols.EMPTY_STRING; - } - if (fElementQName.prefix != null && fElementQName.uri == null) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "ElementPrefixUnbound", - new Object[]{fElementQName.prefix, fElementQName.rawname}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - - // bind attributes (xmlns are already bound bellow) - int length = fAttributes.getLength(); - fLength = 0; //initialize structure - for (int i = 0; i < length; i++) { - fAttributes.getName(i, fAttributeQName); - - String aprefix = fAttributeQName.prefix != null - ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING; - String uri = fNamespaceContext.getURI(aprefix); - // REVISIT: try removing the first "if" and see if it is faster. - // - if (fAttributeQName.uri != null && fAttributeQName.uri == uri) { - checkDuplicates(fAttributeQName, fAttributes); - continue; - } - if (aprefix != XMLSymbols.EMPTY_STRING) { - fAttributeQName.uri = uri; - if (uri == null) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "AttributePrefixUnbound", - new Object[]{fElementQName.rawname,fAttributeQName.rawname,aprefix}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - fAttributes.setURI(i, uri); - checkDuplicates(fAttributeQName, fAttributes); - } - } - } - - - // call handler - if (fDocumentHandler != null) { - if (empty) { - - //decrease the markup depth.. - fMarkupDepth--; - - // check that this element was opened in the same entity - if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) { - reportFatalError("ElementEntityMismatch", - new Object[]{fCurrentElement.rawname}); - } - - fDocumentHandler.emptyElement(fElementQName, fAttributes, null); - - if (fBindNamespaces) { - fNamespaceContext.popContext(); - } - //pop the element off the stack.. - fElementStack.popElement(fElementQName); - } else { - fDocumentHandler.startElement(fElementQName, fAttributes, null); - } - } - - if (DEBUG_CONTENT_SCANNING) System.out.println("<<< scanStartElement(): "+empty); - return empty; - - } // scanStartElement():boolean - - private final void checkDuplicates(QName qname, XMLAttributesImpl attributes){ - - // Example: <foo xmlns:a='NS' xmlns:b='NS' a:attr='v1' b:attr='v2'/> - // search if such attribute already exists - for (int i = 0; i < fLength; i++) { - if (qname.uri == fUri[i] && fLocalpart[i].equals(qname.localpart)) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "AttributeNSNotUnique", - new Object[]{fElementQName.rawname,qname.rawname, qname.uri}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - } - int index = fLength; - if (fLength++ == fUri.length) { - String[] uris = new String[fUri.length + 4]; - String[] lps = new String [fUri.length + 4]; - System.arraycopy(fUri, 0, uris, 0, fUri.length); - System.arraycopy(fLocalpart, 0, lps, 0, fLocalpart.length); - fUri = uris; - fLocalpart = lps; - - } - - fUri[index] = qname.uri; - fLocalpart[index] = qname.localpart; - } - - - - - /** - * Scans an attribute. - * <p> - * <pre> - * [41] Attribute 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= Name Eq AttValue - * </pre> - * <p> - * <strong>Note:</strong> This method assumes that the next - * character on the stream is the first character of the attribute - * name. - * <p> - * <strong>Note:</strong> This method uses the fAttributeQName and - * fQName variables. The contents of these variables will be - * destroyed. - * - * @param attributes The attributes list for the scanned attribute. - */ - protected void scanAttribute(XMLAttributesImpl attributes) - throws IOException, XNIException { - if (DEBUG_CONTENT_SCANNING) System.out.println(">>> scanAttribute()"); - - // name - fEntityScanner.scanQName(fAttributeQName); - - // equals - fEntityScanner.skipSpaces(); - if (!fEntityScanner.skipChar('=')) { - reportFatalError("EqRequiredInAttribute", - new Object[]{fCurrentElement.rawname,fAttributeQName.rawname}); - } - fEntityScanner.skipSpaces(); - - // content - int oldLen = attributes.getLength(); - attributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, null); - - // WFC: Unique Att Spec - if (oldLen == attributes.getLength()) { - reportFatalError("AttributeNotUnique", - new Object[]{fCurrentElement.rawname, - fAttributeQName.rawname}); - } - - //REVISIT: one more case needs to be included: external PE and standalone is no - boolean isVC = fHasExternalDTD && !fStandalone; - - // REVISIT: it seems that this function should not take attributes, and length - scanAttributeValue(this.fTempString, fTempString2, - fAttributeQName.rawname, attributes, - oldLen, isVC,fCurrentElement.rawname); - String value = fTempString.toString(); - attributes.setValue(oldLen, value); - attributes.setNonNormalizedValue(oldLen, fTempString2.toString()); - attributes.setSpecified(oldLen, true); - - // record namespace declarations if any. - if (fBindNamespaces) { - - String localpart = fAttributeQName.localpart; - String prefix = fAttributeQName.prefix != null - ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING; - // when it's of form xmlns="..." or xmlns:prefix="...", - // it's a namespace declaration. but prefix:xmlns="..." isn't. - if (prefix == XMLSymbols.PREFIX_XMLNS || - prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) { - - // get the internalized value of this attribute - String uri = fSymbolTable.addSymbol(value); - - // 1. "xmlns" can't be bound to any namespace - if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "CantBindXMLNS", - new Object[]{fAttributeQName}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - - // 2. the namespace for "xmlns" can't be bound to any prefix - if (uri == NamespaceContext.XMLNS_URI) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "CantBindXMLNS", - new Object[]{fAttributeQName}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - - // 3. "xml" can't be bound to any other namespace than it's own - if (localpart == XMLSymbols.PREFIX_XML) { - if (uri != NamespaceContext.XML_URI) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "CantBindXML", - new Object[]{fAttributeQName}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - } - // 4. the namespace for "xml" can't be bound to any other prefix - else { - if (uri ==NamespaceContext.XML_URI) { - fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN, - "CantBindXML", - new Object[]{fAttributeQName}, - XMLErrorReporter.SEVERITY_FATAL_ERROR); - } - } - - prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING; - - // Declare prefix in context. Removing the association between a prefix and a - // namespace name is permitted in XML 1.1, so if the uri value is the empty string, - // the prefix is being unbound. -- mrglavas - fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null); - // bind namespace attribute to a namespace - attributes.setURI(oldLen, fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS)); - - } - else { - // attempt to bind attribute - if (fAttributeQName.prefix != null) { - attributes.setURI(oldLen, fNamespaceContext.getURI(fAttributeQName.prefix)); - } - } - } - - if (DEBUG_CONTENT_SCANNING) System.out.println("<<< scanAttribute()"); - } // scanAttribute(XMLAttributes) - - - - /** - * Scans an end element. - * <p> - * <pre> - * [42] ETag 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4= '&lt;/' Name S? '>' - * </pre> - * <p> - * <strong>Note:</strong> This method uses the fElementQName variable. - * The contents of this variable will be destroyed. The caller should - * copy the needed information out of this variable before calling - * this method. - * - * @return The element depth. - */ - protected int scanEndElement() throws IOException, XNIException { - if (DEBUG_CONTENT_SCANNING) System.out.println(">>> scanEndElement()"); - - // pop context - fElementStack.popElement(fElementQName) ; - - // Take advantage of the fact that next string _should_ be "fElementQName.rawName", - //In scanners most of the time is consumed on checks done for XML characters, we can - // optimize on it and avoid the checks done for endElement, - //we will also avoid symbol table lookup - deangardner@example.org - - // this should work both for namespace processing true or false... - - //REVISIT: if the string is not the same as expected.. we need to do better error handling.. - //We can skip this for now... In any case if the string doesn't match -- document is not well formed. - if (!fEntityScanner.skipString(fElementQName.rawname)) { - reportFatalError("ETagRequired", new Object[]{fElementQName.rawname}); - } - - // end - fEntityScanner.skipSpaces(); - if (!fEntityScanner.skipChar('>')) { - reportFatalError("ETagUnterminated", - new Object[]{fElementQName.rawname}); - } - fMarkupDepth--; - - //we have increased the depth for two markup "<" characters - fMarkupDepth--; - - // check that this element was opened in the same entity - if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) { - reportFatalError("ElementEntityMismatch", - new Object[]{fCurrentElement.rawname}); - } - - // call handler - if (fDocumentHandler != null ) { - - fDocumentHandler.endElement(fElementQName, null); - if (fBindNamespaces) { - fNamespaceContext.popContext(); - } - - } - - return fMarkupDepth; - - } // scanEndElement():int - - - public void reset(XMLComponentManager componentManager) - throws XMLConfigurationException { - - super.reset(componentManager); - fPerformValidation = false; - fBindNamespaces = false; - } - - /** Creates a content dispatcher. */ - protected Dispatcher createContentDispatcher() { - return new NS11ContentDispatcher(); - } // createContentDispatcher():Dispatcher - - /** - * Dispatcher to handle content scanning. - */ - protected final class NS11ContentDispatcher - extends ContentDispatcher { - /** - * Scan for root element hook. This method is a hook for - * subclasses to add code that handles scanning for the root - * element. This method will also attempt to remove DTD validator - * from the pipeline, if there is no DTD grammar. If DTD validator - * is no longer in the pipeline bind namespaces in the scanner. - * - * - * @return True if the caller should stop and return true which - * allows the scanner to switch to a new scanning - * dispatcher. A return value of false indicates that - * the content dispatcher should continue as normal. - */ - protected boolean scanRootElementHook() - throws IOException, XNIException { - if (fDTDValidator == null) { - fBindNamespaces = true; - } - else if (!fDTDValidator.hasGrammar()) { - fBindNamespaces = true; - fPerformValidation = fDTDValidator.validate(); - // re-configure pipeline - XMLDocumentSource source = fDTDValidator.getDocumentSource(); - XMLDocumentHandler handler = fDTDValidator.getDocumentHandler(); - source.setDocumentHandler(handler); - if (handler != null) - handler.setDocumentSource(source); - fDTDValidator.setDocumentSource(null); - fDTDValidator.setDocumentHandler(null); - } - - if (scanStartElement()) { - setScannerState(SCANNER_STATE_TRAILING_MISC); - setDispatcher(fTrailingMiscDispatcher); - return true; - } - return false; + /** + * If is true, the dtd validator is no longer in the pipeline + * and the scanner should bind namespaces + */ + protected boolean fBindNamespaces; + + /** + * If validating parser, make sure we report an error in the + *
{'source': 'Apache Software Foundation Public Mail Archives'}