Make Xalan-C++ 1.10.0 compile with Xerces-C++ 3. This patch is a backport of the following changesets: http://svn.apache.org/viewvc?view=rev&revision=482425 http://svn.apache.org/viewvc?view=rev&revision=572759 http://svn.apache.org/viewvc?view=rev&revision=651671 http://svn.apache.org/viewvc?view=rev&revision=671671 http://svn.apache.org/viewvc?view=rev&revision=672824 http://svn.apache.org/viewvc?view=rev&revision=672963 http://svn.apache.org/viewvc?view=rev&revision=696900 They were applied against the following tag: web: http://svn.apache.org/viewvc/xalan/c/tags/Xalan-C_1_10_0/ svn: http://svn.apache.org/repos/asf/xalan/c/tags/Xalan-C_1_10_0/ Conflicts were resolved manually, trying to keep the intended meaning of the change. No guarantees, though. See also: https://bugs.gentoo.org/show_bug.cgi?id=242218 http://thread.gmane.org/gmane.text.xml.xalan.c++.user/3600/focus=3601 https://issues.apache.org/jira/browse/XALANC-622 https://issues.apache.org/jira/browse/XALANC-652 2008-10-20 Martin von Gagern Index: src/xalanc/PlatformSupport/AttributesImpl.cpp =================================================================== --- src/xalanc/PlatformSupport/AttributesImpl.cpp (revision 706129) +++ src/xalanc/PlatformSupport/AttributesImpl.cpp (working copy) @@ -109,7 +109,7 @@ // until we're done. AttributesVectorType tempVector(getMemoryManager()); - const unsigned int theLength = theRHS.getLength(); + const XalanSize_t theLength = theRHS.getLength(); if (theLength > 0) { @@ -167,12 +167,12 @@ // safe and don't need any try blocks. AttributesImpl theTempList(getMemoryManager()); - const unsigned int theLength = theRHS.getLength(); + const XalanSize_t theLength = theRHS.getLength(); theTempList.reserve(theLength); // Add each attribute. - for(unsigned int i = 0; i < theLength; i++) + for(XalanSize_t i = 0; i < theLength; i++) { theTempList.addAttribute( theRHS.getURI(i), @@ -192,7 +192,7 @@ -unsigned int +XalanSize_t AttributesImpl::getLength() const { return unsigned(m_attributesVector.size()); @@ -201,7 +201,7 @@ const XMLCh* -AttributesImpl::getURI(const unsigned int index) const +AttributesImpl::getURI(const XalanSize_t index) const { assert(index < getLength()); @@ -211,7 +211,7 @@ const XMLCh* -AttributesImpl::getLocalName(const unsigned int index) const +AttributesImpl::getLocalName(const XalanSize_t index) const { assert(index < getLength()); @@ -221,7 +221,7 @@ const XMLCh* -AttributesImpl::getQName(const unsigned int index) const +AttributesImpl::getQName(const XalanSize_t index) const { assert(index < getLength()); @@ -231,7 +231,7 @@ const XMLCh* -AttributesImpl::getType(const unsigned int index) const +AttributesImpl::getType(const XalanSize_t index) const { assert(index < getLength()); @@ -241,7 +241,7 @@ const XMLCh* -AttributesImpl::getValue(const unsigned int index) const +AttributesImpl::getValue(const XalanSize_t index) const { assert(index < getLength()); @@ -380,18 +380,41 @@ +bool +AttributesImpl::getIndex( + const XMLCh* const uri, + const XMLCh* const localPart, + XalanSize_t& index) const +{ + const int tempIndex = + getIndex(uri, localPart); + + if (tempIndex == -1) + { + return false; + } + else + { + index = tempIndex; + + return true; + } +} + + + int AttributesImpl::getIndex( const XMLCh* const uri, - const XMLCh* const localName) const + const XMLCh* const localPart) const { - assert(uri != 0 && localName != 0); + assert(uri != 0 && localPart != 0); const AttributesVectorType::const_iterator i = XALAN_STD_QUALIFIER find_if( m_attributesVector.begin(), m_attributesVector.end(), - URIAndLocalNameCompareFunctor(uri, localName)); + URIAndLocalNameCompareFunctor(uri, localPart)); if (i != m_attributesVector.end()) { @@ -407,6 +430,28 @@ +bool +AttributesImpl::getIndex( + const XMLCh* const qName, + XalanSize_t& index) const +{ + const int tempIndex = + getIndex(qName); + + if (tempIndex == -1) + { + return false; + } + else + { + index = tempIndex; + + return true; + } +} + + + int AttributesImpl::getIndex(const XMLCh* const qname) const { Index: src/xalanc/PlatformSupport/NamedNodeMapAttributeList.cpp =================================================================== --- src/xalanc/PlatformSupport/NamedNodeMapAttributeList.cpp (revision 706129) +++ src/xalanc/PlatformSupport/NamedNodeMapAttributeList.cpp (working copy) @@ -43,13 +43,15 @@ -NamedNodeMapAttributeList::NamedNodeMapAttributeList(const XalanNamedNodeMap& theMap, - MemoryManagerType& theManager) : +NamedNodeMapAttributeList::NamedNodeMapAttributeList( + const XalanNamedNodeMap& theMap, + MemoryManagerType& theManager) : ParentType(), m_nodeMap(theMap), m_lastIndex(theMap.getLength() - 1), m_memoryManager(theManager) { + assert(theMap.getLength() != 0); } @@ -60,7 +62,7 @@ -unsigned int +XalanSize_t NamedNodeMapAttributeList::getLength() const { return m_nodeMap.getLength(); @@ -69,7 +71,7 @@ const XMLCh* -NamedNodeMapAttributeList::getName(const unsigned int index) const +NamedNodeMapAttributeList::getName(const XalanSize_t index) const { const XalanNode* const theAttribute = m_nodeMap.item(m_lastIndex - index); assert(theAttribute != 0); @@ -80,7 +82,7 @@ const XMLCh* -NamedNodeMapAttributeList::getType(const unsigned int /* index */) const +NamedNodeMapAttributeList::getType(const XalanSize_t /* index */) const { assert(length(s_typeString) > 0); @@ -90,9 +92,11 @@ const XMLCh* -NamedNodeMapAttributeList::getValue(const unsigned int index) const +NamedNodeMapAttributeList::getValue(const XalanSize_t index) const { - const XalanNode* const theAttribute = m_nodeMap.item(m_lastIndex - index); + assert(index <= m_lastIndex); + + const XalanNode* const theAttribute = m_nodeMap.item(m_lastIndex - index); assert(theAttribute != 0); return c_wstr(theAttribute->getNodeValue()); @@ -111,7 +115,7 @@ const XMLCh* -NamedNodeMapAttributeList::getValue(const XMLCh* const name) const +NamedNodeMapAttributeList::getValue(const XMLCh* const name) const { const XalanNode* theNode = m_nodeMap.getNamedItem(XalanDOMString(name, m_memoryManager)); Index: src/xalanc/PlatformSupport/StdBinInputStream.cpp =================================================================== --- src/xalanc/PlatformSupport/StdBinInputStream.cpp (revision 706129) +++ src/xalanc/PlatformSupport/StdBinInputStream.cpp (working copy) @@ -43,7 +43,7 @@ -unsigned int +XalanFilePos StdBinInputStream::curPos() const { return m_stream.tellg(); @@ -51,10 +51,10 @@ -unsigned int +XalanSize_t StdBinInputStream::readBytes( XMLByte* const toFill, - const unsigned int maxToRead) + const XalanSize_t maxToRead) { assert(sizeof(XMLByte) == sizeof(char)); @@ -80,4 +80,12 @@ +const XalanDOMChar* +StdBinInputStream::getContentType() const +{ + return 0; +} + + + XALAN_CPP_NAMESPACE_END Index: src/xalanc/PlatformSupport/AttributeListImpl.hpp =================================================================== --- src/xalanc/PlatformSupport/AttributeListImpl.hpp (revision 706129) +++ src/xalanc/PlatformSupport/AttributeListImpl.hpp (working copy) @@ -73,17 +73,17 @@ } // These are inherited from AttributeList - virtual unsigned int + virtual XalanSize_t getLength() const; virtual const XMLCh* - getName(const unsigned int index) const; + getName(const XalanSize_t index) const; virtual const XMLCh* - getType(const unsigned int index) const; + getType(const XalanSize_t index) const; virtual const XMLCh* - getValue(const unsigned int index) const; + getValue(const XalanSize_t index) const; virtual const XMLCh* getType(const XMLCh* const name) const; @@ -141,7 +141,7 @@ * @param theCount The number to reserve */ void - reserve(unsigned int theCount) + reserve(XalanSize_t theCount) { m_AttributeVector.reserve(theCount); } Index: src/xalanc/PlatformSupport/XSLException.hpp =================================================================== --- src/xalanc/PlatformSupport/XSLException.hpp (revision 706129) +++ src/xalanc/PlatformSupport/XSLException.hpp (working copy) @@ -40,8 +40,6 @@ { public: - typedef XalanLocator::size_type size_type; - /** * Constructor * @@ -119,7 +117,7 @@ * * @return the line number */ - size_type + XalanFileLoc getLineNumber() const { return m_lineNumber; @@ -130,13 +128,12 @@ * * @return the column number */ - size_type + XalanFileLoc getColumnNumber() const { return m_columnNumber; } - MemoryManagerType& getMemoryManager()const { Index: src/xalanc/PlatformSupport/XalanLocator.hpp =================================================================== --- src/xalanc/PlatformSupport/XalanLocator.hpp (revision 706129) +++ src/xalanc/PlatformSupport/XalanLocator.hpp (working copy) @@ -45,8 +45,6 @@ typedef Locator ParentType; - typedef XMLSSize_t size_type; - XalanLocator() {} virtual @@ -58,28 +56,28 @@ virtual const XMLCh* getSystemId() const = 0; - virtual size_type + virtual XalanFileLoc getLineNumber() const = 0; - virtual size_type + virtual XalanFileLoc getColumnNumber() const = 0; - static size_type + static XalanFileLoc getLineNumber(const ParentType* theLocator) { - return theLocator == 0 ? size_type(-1) : theLocator->getLineNumber(); + return theLocator == 0 ? getUnknownValue() : theLocator->getLineNumber(); } - static size_type + static XalanFileLoc getColumnNumber(const ParentType* theLocator) { - return theLocator == 0 ? size_type(-1) : theLocator->getColumnNumber(); + return theLocator == 0 ? getUnknownValue() : theLocator->getColumnNumber(); } - static size_type + static XalanFileLoc getUnknownValue() { - return size_type(-1); + return XalanFileLoc(-1); } private: Index: src/xalanc/PlatformSupport/XalanMemoryManagerDefault.cpp =================================================================== --- src/xalanc/PlatformSupport/XalanMemoryManagerDefault.cpp (revision 706129) +++ src/xalanc/PlatformSupport/XalanMemoryManagerDefault.cpp (working copy) @@ -74,4 +74,12 @@ +MemoryManager* +XalanMemoryManagerDefault::getExceptionMemoryManager() +{ + return this; +} + + + XALAN_CPP_NAMESPACE_END Index: src/xalanc/PlatformSupport/FormatterListener.hpp =================================================================== --- src/xalanc/PlatformSupport/FormatterListener.hpp (revision 706129) +++ src/xalanc/PlatformSupport/FormatterListener.hpp (working copy) @@ -66,7 +66,7 @@ typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler ParentType; // A handy typedef... Must match DocumentHandler's type for characters(), etc... - typedef unsigned int size_type; + typedef XalanSize_t size_type; enum eFormat { Index: src/xalanc/PlatformSupport/DOMStringHelper.hpp =================================================================== --- src/xalanc/PlatformSupport/DOMStringHelper.hpp (revision 706129) +++ src/xalanc/PlatformSupport/DOMStringHelper.hpp (working copy) @@ -705,7 +705,7 @@ { public: - typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const unsigned int); + typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const FormatterListener::size_type); static void DoubleToCharacters( Index: src/xalanc/PlatformSupport/NamedNodeMapAttributeList.hpp =================================================================== --- src/xalanc/PlatformSupport/NamedNodeMapAttributeList.hpp (revision 706129) +++ src/xalanc/PlatformSupport/NamedNodeMapAttributeList.hpp (working copy) @@ -43,24 +43,25 @@ typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList ParentType; explicit - NamedNodeMapAttributeList(const XalanNamedNodeMap& theMap, - MemoryManagerType& theManager); + NamedNodeMapAttributeList( + const XalanNamedNodeMap& theMap, + MemoryManagerType& theManager); virtual ~NamedNodeMapAttributeList(); // These are inherited from AttributeList - virtual unsigned int + virtual XalanSize_t getLength() const; virtual const XalanDOMChar* - getName(const unsigned int index) const; + getName(const XalanSize_t index) const; virtual const XalanDOMChar* - getType(const unsigned int index) const; + getType(const XalanSize_t index) const; virtual const XalanDOMChar* - getValue(const unsigned int index) const; + getValue(const XalanSize_t index) const; virtual const XalanDOMChar* getType(const XalanDOMChar* const name) const; @@ -83,11 +84,11 @@ // Data members... const XalanNamedNodeMap& m_nodeMap; - const unsigned int m_lastIndex; + const XalanSize_t m_lastIndex; + MemoryManagerType& m_memoryManager; + static const XalanDOMChar s_typeString[]; - - MemoryManagerType& m_memoryManager; }; Index: src/xalanc/PlatformSupport/AttributesImpl.hpp =================================================================== --- src/xalanc/PlatformSupport/AttributesImpl.hpp (revision 706129) +++ src/xalanc/PlatformSupport/AttributesImpl.hpp (working copy) @@ -65,31 +65,42 @@ AttributesImpl& operator=(const AttributesType& theRHS); - // These are inherited from AttributeList - virtual unsigned int + // These are inherited from Attributes + virtual XalanSize_t getLength() const; virtual const XMLCh* - getURI(const unsigned int index) const; + getURI(const XalanSize_t index) const; virtual const XMLCh* - getLocalName(const unsigned int index) const; + getLocalName(const XalanSize_t index) const; virtual const XMLCh* - getQName(const unsigned int index) const; + getQName(const XalanSize_t index) const; virtual const XMLCh* - getType(const unsigned int index) const; + getType(const XalanSize_t index) const; virtual const XMLCh* - getValue(const unsigned int index) const; + getValue(const XalanSize_t index) const; - virtual int + virtual bool + getIndex( + const XMLCh* const uri, + const XMLCh* const localPart, + XalanSize_t& index) const; + + virtual int getIndex( const XMLCh* const uri, - const XMLCh* const localName) const; + const XMLCh* const localPart) const; - virtual int + virtual bool + getIndex( + const XMLCh* const qName, + XalanSize_t& index) const; + + virtual int getIndex(const XMLCh* const qname) const; virtual const XMLCh* @@ -186,7 +197,7 @@ * @param theCount The number to reserve */ void - reserve(unsigned int theCount) + reserve(XalanSize_t theCount) { m_attributesVector.reserve(theCount); } Index: src/xalanc/PlatformSupport/AttributeListImpl.cpp =================================================================== --- src/xalanc/PlatformSupport/AttributeListImpl.cpp (revision 706129) +++ src/xalanc/PlatformSupport/AttributeListImpl.cpp (working copy) @@ -110,7 +110,7 @@ // until we're done. AttributeVectorType tempVector(getMemoryManager()); - const unsigned int theLength = theRHS.getLength(); + const XalanSize_t theLength = theRHS.getLength(); if (theLength > 0) { @@ -166,12 +166,12 @@ // safe and don't need any try blocks. AttributeListImpl theTempList(getMemoryManager()); - const unsigned int theLength = theRHS.getLength(); + const XalanSize_t theLength = theRHS.getLength(); theTempList.reserve(theLength); // Add each attribute. - for(unsigned int i = 0; i < theLength; i++) + for(XalanSize_t i = 0; i < theLength; i++) { theTempList.addAttribute( theRHS.getName(i), @@ -189,7 +189,7 @@ -unsigned int +XalanSize_t AttributeListImpl::getLength() const { // Make sure the mismatch between Xerces and vector<> doesn't cause a problem... @@ -201,7 +201,7 @@ const XMLCh* -AttributeListImpl::getName(const unsigned int index) const +AttributeListImpl::getName(const XalanSize_t index) const { assert(index < getLength()); @@ -211,7 +211,7 @@ const XMLCh* -AttributeListImpl::getType(const unsigned int index) const +AttributeListImpl::getType(const XalanSize_t index) const { assert(index < getLength()); @@ -221,7 +221,7 @@ const XMLCh* -AttributeListImpl::getValue(const unsigned int index) const +AttributeListImpl::getValue(const XalanSize_t index) const { assert(index < getLength()); Index: src/xalanc/PlatformSupport/StdBinInputStream.hpp =================================================================== --- src/xalanc/PlatformSupport/StdBinInputStream.hpp (revision 706129) +++ src/xalanc/PlatformSupport/StdBinInputStream.hpp (working copy) @@ -58,14 +58,17 @@ virtual ~StdBinInputStream(); - virtual unsigned int + virtual XalanFilePos curPos() const; - virtual unsigned int + virtual XalanSize_t readBytes( XMLByte* const toFill, - const unsigned int maxToRead); + const XalanSize_t maxToRead); + virtual const XalanDOMChar* + getContentType() const; + private: // Unimplemented... Index: src/xalanc/PlatformSupport/XalanMemoryManagerDefault.hpp =================================================================== --- src/xalanc/PlatformSupport/XalanMemoryManagerDefault.hpp (revision 706129) +++ src/xalanc/PlatformSupport/XalanMemoryManagerDefault.hpp (working copy) @@ -52,6 +52,9 @@ virtual void deallocate(void* pointer); + virtual MemoryManager* + getExceptionMemoryManager(); + private: // These are not implemented. Index: src/xalanc/PlatformSupport/XalanTranscodingServices.hpp =================================================================== --- src/xalanc/PlatformSupport/XalanTranscodingServices.hpp (revision 706129) +++ src/xalanc/PlatformSupport/XalanTranscodingServices.hpp (working copy) @@ -56,8 +56,8 @@ static void terminate(); - typedef unsigned char XalanXMLByte; - typedef unsigned int size_type; + typedef unsigned char XalanXMLByte; + typedef XalanSize_t size_type; typedef unsigned int UnicodeCharType; static size_type Index: src/xalanc/PlatformSupport/XalanMemoryManagement.cpp =================================================================== --- src/xalanc/PlatformSupport/XalanMemoryManagement.cpp (revision 706129) +++ src/xalanc/PlatformSupport/XalanMemoryManagement.cpp (working copy) @@ -40,7 +40,8 @@ return 0; } - virtual void + + virtual void deallocate( void* /* pDataPointer */ ) { XALAN_USING_STD(bad_alloc) @@ -48,8 +49,12 @@ throw bad_alloc(); } - - + + MemoryManager* + getExceptionMemoryManager() + { + return this; + } }; Index: src/xalanc/Include/VCPPDefinitions.hpp =================================================================== --- src/xalanc/Include/VCPPDefinitions.hpp (revision 706129) +++ src/xalanc/Include/VCPPDefinitions.hpp (working copy) @@ -17,7 +17,7 @@ #define VCPPDEFINITIONS_HEADER_GUARD_1357924680 -#pragma warning(disable: 4127 4251 4511 4512 4514 4702 4710 4711 4786 4097 4503 4786; error: 4150 4172 4238 4239 4715) +#pragma warning(disable: 4127 4251 4345 4351 4511 4512 4514 4521 4702 4710 4711 4786 4097 4503 4786; error: 4150 4172 4238 4239 4715) // --------------------------------------------------------------------------- Index: src/xalanc/Include/PlatformDefinitions.hpp =================================================================== --- src/xalanc/Include/PlatformDefinitions.hpp (revision 706129) +++ src/xalanc/Include/PlatformDefinitions.hpp (working copy) @@ -120,6 +120,16 @@ typedef unsigned short XalanDOMChar; #endif +#if XERCES_VERSION_MAJOR < 3 +typedef unsigned int XalanSize_t; +typedef unsigned int XalanFilePos; +typedef unsigned int XalanFileLoc; +#else +typedef XMLSize_t XalanSize_t; +typedef XMLFilePos XalanFilePos; +typedef XMLFileLoc XalanFileLoc; +#endif + template struct XalanCompileErrorBoolean { Index: src/xalanc/XPath/XPathProcessorImpl.hpp =================================================================== --- src/xalanc/XPath/XPathProcessorImpl.hpp (revision 706129) +++ src/xalanc/XPath/XPathProcessorImpl.hpp (working copy) @@ -70,6 +70,8 @@ typedef XalanVector BoolVectorType; + typedef XalanDOMString::size_type t_size_type; + XPathProcessorImpl(MemoryManagerType& theManager XALAN_DEFAULT_MEMMGR); virtual @@ -121,12 +123,12 @@ * When a separator token is found, see if there's a element name or the * like to map. */ - int + t_size_type mapNSTokens( const XalanDOMString& pat, - int startSubstring, - int posOfNSSep, - int posOfScan); + t_size_type startSubstring, + t_size_type posOfNSSep, + t_size_type posOfScan); /** * Check if m_token==s. If m_token is null, this won't throw Index: src/xalanc/XPath/XPathExecutionContextDefault.cpp =================================================================== --- src/xalanc/XPath/XPathExecutionContextDefault.cpp (revision 706129) +++ src/xalanc/XPath/XPathExecutionContextDefault.cpp (working copy) @@ -492,8 +492,8 @@ { assert(m_xpathEnvSupport != 0); - XalanLocator::size_type lineNumber = XalanLocator::getUnknownValue(); - XalanLocator::size_type columnNumber = XalanLocator::getUnknownValue(); + XalanFileLoc lineNumber = XalanLocator::getUnknownValue(); + XalanFileLoc columnNumber = XalanLocator::getUnknownValue(); MemoryManagerType& theManager = const_cast(this)->getMemoryManager(); @@ -546,8 +546,8 @@ { assert(m_xpathEnvSupport != 0); - XalanLocator::size_type lineNumber = XalanLocator::getUnknownValue(); - XalanLocator::size_type columnNumber = XalanLocator::getUnknownValue(); + XalanFileLoc lineNumber = XalanLocator::getUnknownValue(); + XalanFileLoc columnNumber = XalanLocator::getUnknownValue(); MemoryManagerType& theManager = const_cast(this)->getMemoryManager(); @@ -600,8 +600,8 @@ { assert(m_xpathEnvSupport != 0); - XalanLocator::size_type lineNumber = XalanLocator::getUnknownValue(); - XalanLocator::size_type columnNumber = XalanLocator::getUnknownValue(); + XalanFileLoc lineNumber = XalanLocator::getUnknownValue(); + XalanFileLoc columnNumber = XalanLocator::getUnknownValue(); MemoryManagerType& theManager = const_cast(this)->getMemoryManager(); Index: src/xalanc/XPath/XPathExecutionContextDefault.hpp =================================================================== --- src/xalanc/XPath/XPathExecutionContextDefault.hpp (revision 706129) +++ src/xalanc/XPath/XPathExecutionContextDefault.hpp (working copy) @@ -32,9 +32,6 @@ -/** - * @author David N. Bertoni - */ // Base class include file. #include @@ -346,7 +343,11 @@ protected: - typedef XalanObjectCache, DeleteFunctor, ClearCacheResetFunctor > NodeListCacheType; + typedef XalanObjectCache< + MutableNodeRefList, + DefaultCacheCreateFunctorMemMgr, + DeleteFunctor, + ClearCacheResetFunctor > NodeListCacheType; enum { eNodeListCacheListSize = 50 }; Index: src/xalanc/XPath/FormatterStringLengthCounter.cpp =================================================================== --- src/xalanc/XPath/FormatterStringLengthCounter.cpp (revision 706129) +++ src/xalanc/XPath/FormatterStringLengthCounter.cpp (working copy) @@ -76,8 +76,8 @@ void FormatterStringLengthCounter::characters( - const XMLCh* const /* chars */, - const unsigned int length) + const XMLCh* const /* chars */, + const size_type length) { m_count += length; } @@ -86,8 +86,8 @@ void FormatterStringLengthCounter::charactersRaw( - const XMLCh* const /* chars */, - const unsigned int /*length */) + const XMLCh* const /* chars */, + const size_type /*length */) { } @@ -101,8 +101,8 @@ void FormatterStringLengthCounter::ignorableWhitespace( - const XMLCh* const /* chars */, - const unsigned int /* length */) + const XMLCh* const /* chars */, + const size_type /* length */) { } @@ -133,8 +133,8 @@ void FormatterStringLengthCounter::cdata( - const XMLCh* const /* ch */, - const unsigned int /* length */) + const XMLCh* const /* ch */, + const size_type /* length */) { } Index: src/xalanc/XPath/XPathConstructionContext.hpp =================================================================== --- src/xalanc/XPath/XPathConstructionContext.hpp (revision 706129) +++ src/xalanc/XPath/XPathConstructionContext.hpp (working copy) @@ -123,20 +123,11 @@ { } - // Note non-const copy semantics... - GetAndReleaseCachedString(GetAndReleaseCachedString& theSource) : - m_constructionContext(theSource.m_constructionContext), - m_string(theSource.m_string) - { - theSource.m_string = 0; - } - ~GetAndReleaseCachedString() { - if (m_string != 0) - { - m_constructionContext->releaseCachedString(*m_string); - } + assert(m_string != 0); + + m_constructionContext->releaseCachedString(*m_string); } XalanDOMString& @@ -150,13 +141,18 @@ XPathConstructionContext& getConstructionContext() const { + assert(m_constructionContext != 0); + return *m_constructionContext; } - private: // Not implemented... + GetAndReleaseCachedString(); + + GetAndReleaseCachedString(const GetAndReleaseCachedString&); + GetAndReleaseCachedString& operator=(const GetAndReleaseCachedString&); Index: src/xalanc/XPath/XPathExecutionContext.hpp =================================================================== --- src/xalanc/XPath/XPathExecutionContext.hpp (revision 706129) +++ src/xalanc/XPath/XPathExecutionContext.hpp (working copy) @@ -35,9 +35,6 @@ -/** - * @author David N. Bertoni - */ // Base class header file... #include @@ -470,6 +467,10 @@ private: // Not implemented... + GetAndReleaseCachedString(); + + GetAndReleaseCachedString(const GetAndReleaseCachedString&); + GetAndReleaseCachedString& operator=(const GetAndReleaseCachedString&); Index: src/xalanc/XPath/XObject.hpp =================================================================== --- src/xalanc/XPath/XObject.hpp (revision 706129) +++ src/xalanc/XPath/XObject.hpp (working copy) @@ -141,7 +141,7 @@ virtual const XalanDOMString& str() const; - typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const unsigned int); + typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const FormatterListener::size_type); /** * Send the string value to a FormatterListener instance. Index: src/xalanc/XPath/FormatterStringLengthCounter.hpp =================================================================== --- src/xalanc/XPath/FormatterStringLengthCounter.hpp (revision 706129) +++ src/xalanc/XPath/FormatterStringLengthCounter.hpp (working copy) @@ -41,8 +41,6 @@ { public: - typedef unsigned long size_type; - /** * FormatterStringLengthCounter instance constructor. */ @@ -81,12 +79,12 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void charactersRaw( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void entityReference(const XMLCh* const name); @@ -94,7 +92,7 @@ virtual void ignorableWhitespace( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void processingInstruction( @@ -110,7 +108,7 @@ virtual void cdata( const XMLCh* const ch, - const unsigned int length); + const size_type length); private: Index: src/xalanc/XPath/XPathProcessorImpl.cpp =================================================================== --- src/xalanc/XPath/XPathProcessorImpl.cpp (revision 706129) +++ src/xalanc/XPath/XPathProcessorImpl.cpp (working copy) @@ -212,16 +212,16 @@ m_expression->setCurrentPattern(m_constructionContext->getPooledString(pat)); - const int nChars = length(pat); + const t_size_type nChars = length(pat); - int startSubstring = -1; - int posOfNSSep = -1; + t_size_type startSubstring = XalanDOMString::npos; + t_size_type posOfNSSep = XalanDOMString::npos; const XPathConstructionContext::GetAndReleaseCachedString theGuard(*m_constructionContext); XalanDOMString& theToken = theGuard.get(); - for(int i = 0; i < nChars; i++) + for(t_size_type i = 0; i < nChars; i++) { XalanDOMChar c = charAt(pat, i); @@ -229,9 +229,9 @@ { case XalanUnicode::charQuoteMark: { - if(startSubstring != -1) + if(startSubstring != XalanDOMString::npos) { - if(-1 != posOfNSSep) + if(XalanDOMString::npos != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } @@ -253,7 +253,7 @@ addToTokenQueue(theToken); - startSubstring = -1; + startSubstring = XalanDOMString::npos; } else { @@ -264,9 +264,9 @@ case XalanUnicode::charApostrophe: { - if(startSubstring != -1) + if(startSubstring != XalanDOMString::npos) { - if(-1 != posOfNSSep) + if(XalanDOMString::npos != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } @@ -288,7 +288,7 @@ addToTokenQueue(theToken); - startSubstring = -1; + startSubstring = XalanDOMString::npos; } else { @@ -302,9 +302,9 @@ case XalanUnicode::charSpace: case XalanUnicode::charHTab: { - if(startSubstring != -1) + if(startSubstring != XalanDOMString::npos) { - if(-1 != posOfNSSep) + if(XalanDOMString::npos != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } @@ -315,14 +315,14 @@ addToTokenQueue(theToken); } - startSubstring = -1; + startSubstring = XalanDOMString::npos; } } break; case XalanUnicode::charHyphenMinus: { - if(!(startSubstring == -1)) + if(!(startSubstring == XalanDOMString::npos)) { break; } @@ -347,9 +347,9 @@ case XalanUnicode::charLessThanSign: case XalanUnicode::charGreaterThanSign: { - if(startSubstring != -1) + if(startSubstring != XalanDOMString::npos) { - if(-1 != posOfNSSep) + if(XalanDOMString::npos != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } @@ -360,7 +360,7 @@ addToTokenQueue(theToken); } - startSubstring = -1; + startSubstring = XalanDOMString::npos; } substring(pat, theToken, i, i + 1); @@ -373,7 +373,7 @@ { if(posOfNSSep == i - 1 && i > 0) { - if(startSubstring != -1) + if(startSubstring != XalanDOMString::npos) { if (startSubstring < i - 1) { @@ -383,8 +383,8 @@ } } - startSubstring = -1; - posOfNSSep = -1; + startSubstring = XalanDOMString::npos; + posOfNSSep = XalanDOMString::npos; substring(pat, theToken, i - 1, i + 1); @@ -401,7 +401,7 @@ default: { - if(-1 == startSubstring) + if(XalanDOMString::npos == startSubstring) { startSubstring = i; @@ -440,16 +440,16 @@ addToTokenQueue(theToken); - startSubstring = -1; + startSubstring = XalanDOMString::npos; } } } } } - if(startSubstring != -1) + if(startSubstring != XalanDOMString::npos) { - if(-1 != posOfNSSep) + if(XalanDOMString::npos != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, nChars); } @@ -504,12 +504,12 @@ -int +XPathProcessorImpl::t_size_type XPathProcessorImpl::mapNSTokens( const XalanDOMString& pat, - int startSubstring, - int posOfNSSep, - int posOfScan) + t_size_type startSubstring, + t_size_type posOfNSSep, + t_size_type posOfScan) { assert(m_prefixResolver != 0); @@ -575,7 +575,7 @@ } } - return -1; + return XalanDOMString::npos; } @@ -2938,14 +2938,16 @@ bool XPathProcessorImpl::isCurrentLiteral() const { - const int last = length(m_token) - 1; + const t_size_type theLength = m_token.length(); - if (last <= 0) + if (theLength <= 1) { return false; } else { + const t_size_type last = theLength - 1; + const XalanDOMChar c0 = m_tokenChar; const XalanDOMChar cX = charAt(m_token, last); Index: src/xalanc/XPath/XPath.hpp =================================================================== --- src/xalanc/XPath/XPath.hpp (revision 706129) +++ src/xalanc/XPath/XPath.hpp (working copy) @@ -241,7 +241,7 @@ XPathExecutionContext& executionContext, XalanDOMString& result) const; - typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const unsigned int); + typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const FormatterListener::size_type); /** * Execute the XPath from the provided context. Index: src/xalanc/XercesParserLiaison/XercesDOMWrapperException.hpp =================================================================== --- src/xalanc/XercesParserLiaison/XercesDOMWrapperException.hpp (revision 706129) +++ src/xalanc/XercesParserLiaison/XercesDOMWrapperException.hpp (working copy) @@ -83,6 +83,12 @@ static ExceptionCode translateErrorCode(DOMExceptionType::ExceptionCode theCode); + + static ExceptionCode + translateErrorCode(short theCode) + { + return translateErrorCode(static_cast(theCode)); + } }; Index: src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp =================================================================== --- src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp (revision 706129) +++ src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp (working copy) @@ -741,7 +741,12 @@ DOMParserType* const theParser = new (&theMemoryManager) DOMParserType(0, &theMemoryManager); +#if XERCES_VERSION_MAJOR < 3 theParser->setExpandEntityReferences(true); +#else + theParser->setCreateEntityReferenceNodes(false); +#endif + theParser->setDoNamespaces(m_doNamespaces); theParser->setEntityResolver(m_entityResolver); @@ -759,7 +764,11 @@ SAXParserType* const theParser = new (&theMemoryManager) SAXParserType(0, &theMemoryManager); +#if XERCES_VERSION_MAJOR < 3 theParser->setDoValidation(false); +#else + theParser->setValidationScheme(SAXParserType::Val_Never); +#endif theParser->setDoNamespaces(false); Index: src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.hpp =================================================================== --- src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.hpp (revision 706129) +++ src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.hpp (working copy) @@ -48,17 +48,17 @@ ~XercesNamedNodeMapAttributeList(); // These are inherited from AttributeList - virtual unsigned int + virtual XalanSize_t getLength() const; virtual const XMLCh* - getName(const unsigned int index) const; + getName(const XalanSize_t index) const; virtual const XMLCh* - getType(const unsigned int index) const; + getType(const XalanSize_t index) const; virtual const XMLCh* - getValue(const unsigned int index) const; + getValue(const XalanSize_t index) const; virtual const XMLCh* getType(const XMLCh* const name) const; @@ -81,7 +81,7 @@ // Data members... const DOMNamedNodeMapType* const m_nodeMap; - const XMLSizeType m_lastIndex; + const XalanSize_t m_lastIndex; static const XMLCh s_typeString[]; }; Index: src/xalanc/XercesParserLiaison/FormatterToXercesDOM.cpp =================================================================== --- src/xalanc/XercesParserLiaison/FormatterToXercesDOM.cpp (revision 706129) +++ src/xalanc/XercesParserLiaison/FormatterToXercesDOM.cpp (working copy) @@ -191,7 +191,7 @@ void FormatterToXercesDOM::characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { m_textBuffer.append(chars, length); } @@ -201,7 +201,7 @@ void FormatterToXercesDOM::charactersRaw( const XMLCh* const chars, - const unsigned int length) + const size_type length) { try { @@ -237,7 +237,7 @@ void FormatterToXercesDOM::ignorableWhitespace( const XMLCh* const chars, - const unsigned int length) + const size_type length) { try { @@ -301,7 +301,7 @@ void FormatterToXercesDOM::cdata( const XMLCh* const ch, - const unsigned int length) + const size_type length) { try { Index: src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.cpp =================================================================== --- src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.cpp (revision 706129) +++ src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.cpp (working copy) @@ -48,6 +48,7 @@ m_nodeMap(theMap), m_lastIndex(theMap->getLength() - 1) { + assert(theMap->getLength() != 0); } @@ -58,7 +59,7 @@ -unsigned int +XalanSize_t XercesNamedNodeMapAttributeList::getLength() const { return m_lastIndex + 1; @@ -67,7 +68,7 @@ const XMLCh* -XercesNamedNodeMapAttributeList::getName(const unsigned int index) const +XercesNamedNodeMapAttributeList::getName(const XalanSize_t index) const { const DOMNodeType* const theAttribute = m_nodeMap->item(m_lastIndex - index); assert(theAttribute != 0); @@ -78,7 +79,7 @@ const XMLCh* -XercesNamedNodeMapAttributeList::getType(const unsigned int /* index */) const +XercesNamedNodeMapAttributeList::getType(const XalanSize_t /* index */) const { assert(length(s_typeString) > 0); @@ -88,7 +89,7 @@ const XMLCh* -XercesNamedNodeMapAttributeList::getValue(const unsigned int index) const +XercesNamedNodeMapAttributeList::getValue(const XalanSize_t index) const { const DOMNodeType* const theAttribute = m_nodeMap->item(m_lastIndex - index); assert(theAttribute != 0); @@ -126,7 +127,7 @@ const XMLCh* XercesNamedNodeMapAttributeList::getValue(const char* const /*name*/) const { - assert( 0 ); + assert(false); return 0; } Index: src/xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp =================================================================== --- src/xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp (revision 706129) +++ src/xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp (working copy) @@ -82,12 +82,12 @@ ~FormatterToXercesDOM(); - // These methods are inherited from DocumentHandler ... + // These methods are inherited from FormatterListener... virtual void charactersRaw( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void comment(const XMLCh* const data); @@ -95,7 +95,7 @@ virtual void cdata( const XMLCh* const ch, - const unsigned int length); + const size_type length); virtual void entityReference(const XMLCh* const name); @@ -120,12 +120,12 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void ignorableWhitespace( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void processingInstruction( Index: src/xalanc/XSLT/XSLTProcessor.hpp =================================================================== --- src/xalanc/XSLT/XSLTProcessor.hpp (revision 706129) +++ src/xalanc/XSLT/XSLTProcessor.hpp (working copy) @@ -80,7 +80,7 @@ { public: - typedef size_t size_type; + typedef XalanSize_t size_type; XSLTProcessor(); Index: src/xalanc/XSLT/ElemCopyOf.cpp =================================================================== --- src/xalanc/XSLT/ElemCopyOf.cpp (revision 706129) +++ src/xalanc/XSLT/ElemCopyOf.cpp (working copy) @@ -49,8 +49,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemTemplateElement(constructionContext, stylesheetTree, lineNumber, @@ -60,13 +60,13 @@ { bool isSelectCurrentNode = false; - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; ++i) + for (XalanSize_t i = 0; i < nAttrs; ++i) { const XalanDOMChar* const aname = atts.getName(i); - if(equals(aname, Constants::ATTRNAME_SELECT)) + if (equals(aname, Constants::ATTRNAME_SELECT)) { const XalanDOMChar* const avalue = atts.getValue(i); assert(avalue != 0); @@ -80,7 +80,7 @@ m_selectPattern = constructionContext.createXPath(getLocator(), avalue, *this); } } - else if(isAttrOK( + else if (isAttrOK( aname, atts, i, @@ -124,7 +124,7 @@ if (m_selectPattern == 0) { - if(0 != executionContext.getTraceListeners()) + if (0 != executionContext.getTraceListeners()) { StylesheetExecutionContext::BorrowReturnMutableNodeRefList theNodeList(executionContext); @@ -147,7 +147,7 @@ const XObjectPtr value(m_selectPattern->execute(*this, executionContext)); assert(value.null() == false); - if(0 != executionContext.getTraceListeners()) + if (0 != executionContext.getTraceListeners()) { executionContext.fireSelectEvent( SelectionEvent( @@ -209,7 +209,7 @@ if (m_selectPattern == 0) { - if(0 != executionContext.getTraceListeners()) + if (0 != executionContext.getTraceListeners()) { StylesheetExecutionContext::BorrowReturnMutableNodeRefList theNodeList(executionContext); @@ -232,7 +232,7 @@ const XObjectPtr value(m_selectPattern->execute(*this, executionContext)); assert(value.null() == false); - if(0 != executionContext.getTraceListeners()) + if (0 != executionContext.getTraceListeners()) { executionContext.fireSelectEvent( SelectionEvent( @@ -283,7 +283,7 @@ const XPath* -ElemCopyOf::getXPath(unsigned int index) const +ElemCopyOf::getXPath(XalanSize_t index) const { return index == 0 ? m_selectPattern : 0; } Index: src/xalanc/XSLT/XalanElemAttributeSetAllocator.cpp =================================================================== --- src/xalanc/XSLT/XalanElemAttributeSetAllocator.cpp (revision 706129) +++ src/xalanc/XSLT/XalanElemAttributeSetAllocator.cpp (working copy) @@ -23,7 +23,9 @@ -XalanElemAttributeSetAllocator::XalanElemAttributeSetAllocator(MemoryManagerType& theManager, size_type theBlockCount) : +XalanElemAttributeSetAllocator::XalanElemAttributeSetAllocator( + MemoryManagerType& theManager, + size_type theBlockCount) : m_allocator(theManager, theBlockCount) { } @@ -41,8 +43,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) { data_type* const theBlock = m_allocator.allocateBlock(); assert(theBlock != 0); Index: src/xalanc/XSLT/ElemAttribute.hpp =================================================================== --- src/xalanc/XSLT/ElemAttribute.hpp (revision 706129) +++ src/xalanc/XSLT/ElemAttribute.hpp (working copy) @@ -52,8 +52,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); virtual ~ElemAttribute(); Index: src/xalanc/XSLT/XalanElemElementAllocator.hpp =================================================================== --- src/xalanc/XSLT/XalanElemElementAllocator.hpp (revision 706129) +++ src/xalanc/XSLT/XalanElemElementAllocator.hpp (working copy) @@ -57,7 +57,9 @@ * * @param theBlockSize The block size. */ - XalanElemElementAllocator(MemoryManagerType& theManager, size_type theBlockCount); + XalanElemElementAllocator( + MemoryManagerType& theManager, + size_type theBlockCount); ~XalanElemElementAllocator(); @@ -77,8 +79,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); /** * Determine if an object is owned by the allocator... Index: src/xalanc/XSLT/XalanElemAttributeAllocator.hpp =================================================================== --- src/xalanc/XSLT/XalanElemAttributeAllocator.hpp (revision 706129) +++ src/xalanc/XSLT/XalanElemAttributeAllocator.hpp (working copy) @@ -57,7 +57,9 @@ * * @param theBlockSize The block size. */ - XalanElemAttributeAllocator(MemoryManagerType& theManager, size_type theBlockCount); + XalanElemAttributeAllocator( + MemoryManagerType& theManager, + size_type theBlockCount); ~XalanElemAttributeAllocator(); @@ -77,8 +79,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); /** * Determine if an object is owned by the allocator... Index: src/xalanc/XSLT/StylesheetConstructionContextDefault.cpp =================================================================== --- src/xalanc/XSLT/StylesheetConstructionContextDefault.cpp (revision 706129) +++ src/xalanc/XSLT/StylesheetConstructionContextDefault.cpp (working copy) @@ -631,8 +631,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) { Type* theResult; @@ -656,9 +656,12 @@ const AttributeListType& atts, const LocatorType* locator) { - const XalanLocator::size_type lineNumber = XalanLocator::getLineNumber(locator); - const XalanLocator::size_type columnNumber = XalanLocator::getColumnNumber(locator); + const XalanFileLoc lineNumber = + XalanLocator::getLineNumber(locator); + const XalanFileLoc columnNumber = + XalanLocator::getColumnNumber(locator); + ElemTemplateElement* theElement = 0; switch(token) @@ -975,9 +978,12 @@ const AttributeListType& atts, const LocatorType* locator) { - const XalanLocator::size_type lineNumber = XalanLocator::getLineNumber(locator); - const XalanLocator::size_type columnNumber = XalanLocator::getColumnNumber(locator); + const XalanFileLoc lineNumber = + XalanLocator::getLineNumber(locator); + const XalanFileLoc columnNumber = + XalanLocator::getColumnNumber(locator); + ElemTemplateElement* theElement = 0; if (token == ELEMNAME_LITERAL_RESULT) @@ -1032,9 +1038,6 @@ ExtensionNSHandler& handler, const LocatorType* locator) { - const XalanLocator::size_type lineNumber = XalanLocator::getLineNumber(locator); - const XalanLocator::size_type columnNumber = XalanLocator::getColumnNumber(locator); - m_allocatedElements.push_back(0); m_allocatedElements.back() = ElemExtensionCall::create( @@ -1043,8 +1046,8 @@ stylesheetTree, name, atts, - lineNumber, - columnNumber, + XalanLocator::getLineNumber(locator), + XalanLocator::getColumnNumber(locator), handler); return m_allocatedElements.back(); @@ -1061,14 +1064,11 @@ bool disableOutputEscaping, const LocatorType* locator) { - const XalanLocator::size_type lineNumber = XalanLocator::getLineNumber(locator); - const XalanLocator::size_type columnNumber = XalanLocator::getColumnNumber(locator); - return m_elemTextLiteralAllocator.create( *this, stylesheetTree, - lineNumber, - columnNumber, + XalanLocator::getLineNumber(locator), + XalanLocator::getColumnNumber(locator), chars, 0, length, @@ -1992,7 +1992,7 @@ } }; -const unsigned int StylesheetConstructionContextDefault::s_elementTokenTableSize = +const XalanSize_t StylesheetConstructionContextDefault::s_elementTokenTableSize = sizeof(s_elementTokenTable) / sizeof(s_elementTokenTable[0]); const StylesheetConstructionContextDefault::ElementTokenTableEntry& StylesheetConstructionContextDefault::s_elementTokenTableLast = Index: src/xalanc/XSLT/StylesheetConstructionContext.hpp =================================================================== --- src/xalanc/XSLT/StylesheetConstructionContext.hpp (revision 706129) +++ src/xalanc/XSLT/StylesheetConstructionContext.hpp (working copy) @@ -76,12 +76,6 @@ typedef XalanQName::NamespacesStackType NamespacesStackType; -#if defined(XALAN_STRICT_ANSI_HEADERS) - typedef std::size_t size_type; -#else - typedef size_t size_type; -#endif - /** * IDs for XSL element types. These are the values * that must be returned by getElementToken(). Index: src/xalanc/XSLT/ElemDecimalFormat.hpp =================================================================== --- src/xalanc/XSLT/ElemDecimalFormat.hpp (revision 706129) +++ src/xalanc/XSLT/ElemDecimalFormat.hpp (working copy) @@ -57,8 +57,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); ~ElemDecimalFormat(); @@ -83,7 +83,7 @@ } virtual const XPath* - getXPath(unsigned int index = 0) const; + getXPath(XalanSize_t index) const; private: Index: src/xalanc/XSLT/ElemAttributeSet.hpp =================================================================== --- src/xalanc/XSLT/ElemAttributeSet.hpp (revision 706129) +++ src/xalanc/XSLT/ElemAttributeSet.hpp (working copy) @@ -49,8 +49,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); virtual ~ElemAttributeSet(); Index: src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp =================================================================== --- src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp (revision 706129) +++ src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp (working copy) @@ -928,9 +928,9 @@ void StylesheetExecutionContextDefault::characters( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar* ch, + fl_size_type start, + fl_size_type length) { assert(m_xsltProcessor != 0); @@ -941,9 +941,9 @@ void StylesheetExecutionContextDefault::charactersRaw( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar* ch, + fl_size_type start, + fl_size_type length) { assert(m_xsltProcessor != 0); Index: src/xalanc/XSLT/ElemSort.cpp =================================================================== --- src/xalanc/XSLT/ElemSort.cpp (revision 706129) +++ src/xalanc/XSLT/ElemSort.cpp (working copy) @@ -39,8 +39,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemTemplateElement(constructionContext, stylesheetTree, lineNumber, @@ -52,38 +52,38 @@ m_orderAVT(0), m_caseOrderAVT(0) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(equals(aname, Constants::ATTRNAME_SELECT)) + if (equals(aname, Constants::ATTRNAME_SELECT)) { m_selectPattern = constructionContext.createXPath(getLocator(), atts.getValue(i), *this); } - else if(equals(aname, Constants::ATTRNAME_LANG)) + else if (equals(aname, Constants::ATTRNAME_LANG)) { m_langAVT = constructionContext.createAVT(getLocator(), aname, atts.getValue(i), *this); } - else if(equals(aname, Constants::ATTRNAME_DATATYPE)) + else if (equals(aname, Constants::ATTRNAME_DATATYPE)) { m_dataTypeAVT = constructionContext.createAVT(getLocator(), aname, atts.getValue(i), *this); } - else if(equals(aname, Constants::ATTRNAME_ORDER)) + else if (equals(aname, Constants::ATTRNAME_ORDER)) { m_orderAVT = constructionContext.createAVT(getLocator(), aname, atts.getValue(i), *this); } - else if(equals(aname, Constants::ATTRNAME_CASEORDER)) + else if (equals(aname, Constants::ATTRNAME_CASEORDER)) { m_caseOrderAVT = constructionContext.createAVT(getLocator(), aname, atts.getValue(i), *this); } - else if(isAttrOK( + else if (isAttrOK( aname, atts, i, @@ -126,8 +126,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) { typedef ElemSort ThisType; @@ -163,7 +163,7 @@ const XPath* -ElemSort::getXPath(unsigned int index) const +ElemSort::getXPath(XalanSize_t index) const { return index == 0 ? m_selectPattern : 0; } Index: src/xalanc/XSLT/ElemElement.hpp =================================================================== --- src/xalanc/XSLT/ElemElement.hpp (revision 706129) +++ src/xalanc/XSLT/ElemElement.hpp (working copy) @@ -60,8 +60,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); virtual ~ElemElement(); Index: src/xalanc/XSLT/XalanElemApplyTemplatesAllocator.hpp =================================================================== --- src/xalanc/XSLT/XalanElemApplyTemplatesAllocator.hpp (revision 706129) +++ src/xalanc/XSLT/XalanElemApplyTemplatesAllocator.hpp (working copy) @@ -57,7 +57,9 @@ * * @param theBlockSize The block size. */ - XalanElemApplyTemplatesAllocator(MemoryManagerType& theManager, size_type theBlockCount); + XalanElemApplyTemplatesAllocator( + MemoryManagerType& theManager, + size_type theBlockCount); ~XalanElemApplyTemplatesAllocator(); @@ -77,8 +79,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); /** * Determine if an object is owned by the allocator... Index: src/xalanc/XSLT/ElemCopyOf.hpp =================================================================== --- src/xalanc/XSLT/ElemCopyOf.hpp (revision 706129) +++ src/xalanc/XSLT/ElemCopyOf.hpp (working copy) @@ -57,8 +57,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); @@ -76,7 +76,7 @@ execute(StylesheetExecutionContext& executionContext) const; #endif virtual const XPath* - getXPath(unsigned int index = 0) const; + getXPath(XalanSize_t index) const; private: Index: src/xalanc/XSLT/ElemApplyTemplates.cpp =================================================================== --- src/xalanc/XSLT/ElemApplyTemplates.cpp (revision 706129) +++ src/xalanc/XSLT/ElemApplyTemplates.cpp (working copy) @@ -50,8 +50,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ParentType( constructionContext, stylesheetTree, @@ -60,9 +60,9 @@ StylesheetConstructionContext::ELEMNAME_APPLY_TEMPLATES), m_mode(0) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); Index: src/xalanc/XSLT/XalanElemAttributeSetAllocator.hpp =================================================================== --- src/xalanc/XSLT/XalanElemAttributeSetAllocator.hpp (revision 706129) +++ src/xalanc/XSLT/XalanElemAttributeSetAllocator.hpp (working copy) @@ -57,7 +57,9 @@ * * @param theBlockSize The block size. */ - XalanElemAttributeSetAllocator(MemoryManagerType& theManager, size_type theBlockCount); + XalanElemAttributeSetAllocator( + MemoryManagerType& theManager, + size_type theBlockCount); ~XalanElemAttributeSetAllocator(); @@ -77,8 +79,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); /** * Determine if an object is owned by the allocator... Index: src/xalanc/XSLT/StylesheetExecutionContext.hpp =================================================================== --- src/xalanc/XSLT/StylesheetExecutionContext.hpp (revision 706129) +++ src/xalanc/XSLT/StylesheetExecutionContext.hpp (working copy) @@ -56,6 +56,7 @@ #include +#include #include @@ -105,12 +106,10 @@ { public: -#if defined(XALAN_STRICT_ANSI_HEADERS) - typedef std::size_t tl_size_type; -#else - typedef size_t tl_size_type; -#endif + typedef XalanSize_t tl_size_type; + typedef FormatterListener::size_type fl_size_type; + #if defined(XALAN_NO_STD_NAMESPACE) typedef ostream StreamType; #else @@ -1069,9 +1068,9 @@ */ virtual void characters( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length) = 0; + const XalanDOMChar* ch, + fl_size_type start, + fl_size_type length) = 0; /** * Receive notification of character data. If available, when the @@ -1084,9 +1083,9 @@ */ virtual void charactersRaw( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length) = 0; + const XalanDOMChar* ch, + fl_size_type start, + fl_size_type length) = 0; /** * Called when a Comment is to be constructed. Index: src/xalanc/XSLT/ElemTemplateElement.cpp =================================================================== --- src/xalanc/XSLT/ElemTemplateElement.cpp (revision 706129) +++ src/xalanc/XSLT/ElemTemplateElement.cpp (working copy) @@ -82,8 +82,8 @@ ElemTemplateElement::ElemTemplateElement( StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, - int lineNumber, - int columnNumber, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber, int xslToken) : PrefixResolver(), m_stylesheet(stylesheetTree), @@ -112,8 +112,8 @@ Stylesheet& stylesheetTree, int xslToken, const XalanDOMString& baseURI, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : PrefixResolver(), m_stylesheet(stylesheetTree), m_namespacesHandler(constructionContext.getMemoryManager()), @@ -158,7 +158,7 @@ ElemTemplateElement::isAttrOK( const XalanDOMChar* attrName, const AttributeListType& atts, - int which, + XalanSize_t which, StylesheetConstructionContext& constructionContext) const { return m_stylesheet.isAttrOK(attrName, atts, which, constructionContext); @@ -171,7 +171,7 @@ const XalanDOMChar* elementName, const XalanDOMChar* aname, const AttributeListType& atts, - int which, + XalanSize_t which, StylesheetConstructionContext& constructionContext) { if(constructionContext.isXMLSpaceAttribute( @@ -1062,12 +1062,13 @@ const XPath* -ElemTemplateElement::getXPath(unsigned int /* index */) const +ElemTemplateElement::getXPath(XalanSize_t /* index */) const { return 0; } + #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) const ElemTemplateElement* ElemTemplateElement::findTemplateToTransformChild( @@ -1504,8 +1505,8 @@ ElemTemplateElement::LocatorProxy::LocatorProxy( - size_type theLineNumber, - size_type theColumnNumber, + XMLFileLoc theLineNumber, + XMLFileLoc theColumnNumber, const XalanDOMString& theURI) : m_lineNumber(theLineNumber), m_columnNumber(theColumnNumber), @@ -1521,7 +1522,7 @@ -ElemTemplateElement::LocatorProxy::size_type +XMLFileLoc ElemTemplateElement::LocatorProxy::getLineNumber() const { return m_lineNumber; @@ -1529,7 +1530,7 @@ -ElemTemplateElement::LocatorProxy::size_type +XMLFileLoc ElemTemplateElement::LocatorProxy::getColumnNumber() const { return m_columnNumber; Index: src/xalanc/XSLT/Stylesheet.cpp =================================================================== --- src/xalanc/XSLT/Stylesheet.cpp (revision 706129) +++ src/xalanc/XSLT/Stylesheet.cpp (working copy) @@ -252,9 +252,9 @@ XPath* matchAttr = 0; XPath* useAttr = 0; - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for(XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); @@ -317,7 +317,7 @@ } } - if(0 == theQName) + if (0 == theQName) { const GetAndReleaseCachedString theGuard(constructionContext); @@ -331,7 +331,7 @@ locator); } - if(0 == matchAttr) + if (0 == matchAttr) { const GetAndReleaseCachedString theGuard(constructionContext); @@ -345,7 +345,7 @@ locator); } - if(0 == useAttr) + if (0 == useAttr) { const GetAndReleaseCachedString theGuard(constructionContext); @@ -374,13 +374,13 @@ void Stylesheet::pushNamespaces(const AttributeListType& atts) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); NamespaceVectorType namespaces(getMemoryManager()); XalanDOMString prefix(getMemoryManager()); - for(unsigned int i = 0; i < nAttrs; i++) + for(XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); const XalanDOMChar* const value = atts.getValue(i); @@ -438,12 +438,10 @@ Stylesheet::PatternTableVectorType& theList, const XalanMatchPatternData* thePattern) { - - typedef Stylesheet::size_type size_type; assert(thePattern != 0); const double thePatternPriority = thePattern->getPriorityOrDefault(); - const size_type thePatternPosition = thePattern->getPosition(); + const XalanSize_t thePatternPosition = thePattern->getPosition(); typedef Stylesheet::PatternTableVectorType PatternTableListType; typedef PatternTableListType::iterator iterator; @@ -452,7 +450,7 @@ const iterator theEnd = theList.end(); - while(theCurrent != theEnd) + while (theCurrent != theEnd) { const double theCurrentPriority = (*theCurrent)->getPriorityOrDefault(); @@ -626,7 +624,7 @@ Stylesheet::isAttrOK( const XalanDOMChar* attrName, const AttributeListType& /* atts */, - int /* which */, + XalanSize_t /* which */, StylesheetConstructionContext& constructionContext) const { // Namespace declarations are OK by definition @@ -1497,16 +1495,16 @@ const AttributeListType& atts, StylesheetConstructionContext& constructionContext) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); const XalanDOMString* stylesheetNamespace = 0; const XalanDOMString* resultNamespace = 0; - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(equals(aname, Constants::ATTRNAME_STYLESHEET_PREFIX) == true) + if (equals(aname, Constants::ATTRNAME_STYLESHEET_PREFIX) == true) { const XalanDOMChar* const value = atts.getValue(i); @@ -1519,7 +1517,7 @@ stylesheetNamespace = getNamespaceForPrefix(value, constructionContext); } } - else if(equals(aname, Constants::ATTRNAME_RESULT_PREFIX)) + else if (equals(aname, Constants::ATTRNAME_RESULT_PREFIX)) { const XalanDOMChar* const value = atts.getValue(i); @@ -1532,7 +1530,7 @@ resultNamespace = getNamespaceForPrefix(value, constructionContext); } } - else if(!isAttrOK(aname, atts, i, constructionContext)) + else if (!isAttrOK(aname, atts, i, constructionContext)) { const GetAndReleaseCachedString theGuard(constructionContext); @@ -1588,10 +1586,10 @@ const AttributeListType& atts, const LocatorType* locator) { - const XalanLocator::size_type lineNumber = + const XalanFileLoc lineNumber = XalanLocator::getLineNumber(locator); - const XalanLocator::size_type columnNumber = + const XalanFileLoc columnNumber = XalanLocator::getColumnNumber(locator); m_elemDecimalFormats.reserve(m_elemDecimalFormats.size() + 1); Index: src/xalanc/XSLT/ElemUse.cpp =================================================================== --- src/xalanc/XSLT/ElemUse.cpp (revision 706129) +++ src/xalanc/XSLT/ElemUse.cpp (working copy) @@ -48,8 +48,8 @@ ElemUse::ElemUse( StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, - int lineNumber, - int columnNumber, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber, int xslToken) : ElemTemplateElement(constructionContext, stylesheetTree, @@ -268,7 +268,7 @@ StylesheetConstructionContext& constructionContext, const XalanDOMChar* attrName, const AttributeListType& atts, - int which) + XalanSize_t which) { bool isUAS = false; Index: src/xalanc/XSLT/ElemValueOf.cpp =================================================================== --- src/xalanc/XSLT/ElemValueOf.cpp (revision 706129) +++ src/xalanc/XSLT/ElemValueOf.cpp (working copy) @@ -185,7 +185,7 @@ void characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { m_executionContext.characters(chars, 0, length); } @@ -193,7 +193,7 @@ void charactersRaw( const XMLCh* const chars, - const unsigned int length) + const size_type length) { m_executionContext.charactersRaw(chars, 0, length); } @@ -206,7 +206,7 @@ void ignorableWhitespace( const XMLCh* const /* chars */, - const unsigned int /* length */) + const size_type /* length */) { } @@ -232,7 +232,7 @@ void cdata( const XMLCh* const /* ch */, - const unsigned int /* length */) + const size_type /* length */) { } Index: src/xalanc/XSLT/ElemCopy.cpp =================================================================== --- src/xalanc/XSLT/ElemCopy.cpp (revision 706129) +++ src/xalanc/XSLT/ElemCopy.cpp (working copy) @@ -46,32 +46,32 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemUse(constructionContext, stylesheetTree, lineNumber, columnNumber, StylesheetConstructionContext::ELEMNAME_COPY) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(processUseAttributeSets( + if (processUseAttributeSets( constructionContext, aname, atts, i) == false && - processSpaceAttr( + processSpaceAttr( Constants::ELEMNAME_COPY_WITH_PREFIX_STRING.c_str(), aname, atts, i, constructionContext) == false && - isAttrOK( + isAttrOK( aname, atts, i, @@ -94,6 +94,7 @@ } + #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) const ElemTemplateElement* ElemCopy::startElement(StylesheetExecutionContext& executionContext) const @@ -120,7 +121,6 @@ executionContext.copyNamespaceAttributes(*sourceNode); return beginExecuteChildren(executionContext); - } else { Index: src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp =================================================================== --- src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp (revision 706129) +++ src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp (working copy) @@ -213,8 +213,9 @@ getURLFromString(const XalanDOMString& urlString); virtual XalanDOMString& - getURLStringFromString(const XalanDOMString& urlString, - XalanDOMString& theResult); + getURLStringFromString( + const XalanDOMString& urlString, + XalanDOMString& theResult); virtual URLAutoPtrType getURLFromString( @@ -648,7 +649,7 @@ static const ElementTokenTableEntry s_elementTokenTable[]; - static const unsigned int s_elementTokenTableSize; + static const XalanSize_t s_elementTokenTableSize; static const ElementTokenTableEntry& s_elementTokenTableLast; Index: src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp =================================================================== --- src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp (revision 706129) +++ src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp (working copy) @@ -471,15 +471,15 @@ virtual void characters( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length); + const XalanDOMChar* ch, + fl_size_type start, + fl_size_type length); virtual void charactersRaw( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length); + const XalanDOMChar* ch, + fl_size_type start, + fl_size_type length); virtual void comment(const XalanDOMChar* data); @@ -515,8 +515,7 @@ endCreateXResultTreeFrag(); virtual void - beginFormatToText( - XalanDOMString& theResult); + beginFormatToText(XalanDOMString& theResult); virtual void endFormatToText(); Index: src/xalanc/XSLT/ElemSort.hpp =================================================================== --- src/xalanc/XSLT/ElemSort.hpp (revision 706129) +++ src/xalanc/XSLT/ElemSort.hpp (working copy) @@ -59,8 +59,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); static ElemSort* create( @@ -68,8 +68,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); ~ElemSort(); @@ -132,7 +132,7 @@ getElementName() const; virtual const XPath* - getXPath(unsigned int index = 0) const; + getXPath(XalanSize_t index = 0) const; private: Index: src/xalanc/XSLT/XSLTEngineImpl.cpp =================================================================== --- src/xalanc/XSLT/XSLTEngineImpl.cpp (revision 706129) +++ src/xalanc/XSLT/XSLTEngineImpl.cpp (working copy) @@ -692,7 +692,7 @@ #if defined(XALAN_OLD_STYLE_CASTS) nsNode = (const XalanElement*)&fragBase; #else - nsNode = static_cast(node); + nsNode = static_cast(node); #endif } else @@ -1064,9 +1064,12 @@ XalanDOMString uri( theManager ); - int lineNumber = XalanLocator::getUnknownValue(); - int columnNumber = XalanLocator::getUnknownValue(); + XalanFileLoc lineNumber = + XalanLocator::getUnknownValue(); + XalanFileLoc columnNumber = + XalanLocator::getUnknownValue(); + const LocatorType* locator = getLocatorFromStack(); if (locator == 0 && styleNode != 0) @@ -1136,8 +1139,8 @@ id = &theDummy; } - const XalanLocator::size_type lineNumber = locator.getLineNumber(); - const XalanLocator::size_type columnNumber = locator.getColumnNumber(); + XalanFileLoc lineNumber = locator.getLineNumber(); + XalanFileLoc columnNumber = locator.getColumnNumber(); if (m_problemListener != 0) { @@ -1364,12 +1367,12 @@ void XSLTEngineImpl::addResultAttribute( - AttributeListImpl& attList, - const XalanDOMString& aname, - const XalanDOMChar* value, - XalanDOMString::size_type theLength, - bool fromCopy, - const LocatorType* locator) + AttributeListImpl& attList, + const XalanDOMString& aname, + const XalanDOMChar* value, + size_type theLength, + bool fromCopy, + const LocatorType* locator) { assert(value != 0); @@ -1517,13 +1520,13 @@ const AttributeListImpl& thePendingAttributes = (const AttributeListImpl&)getPendingAttributes(); - const unsigned int n = thePendingAttributes.getLength(); + const XalanSize_t n = thePendingAttributes.getLength(); - for(unsigned int i = 0; i < n; i++) + for (XalanSize_t i = 0; i < n; i++) { - if(equals( - thePendingAttributes.getName(i), - DOMServices::s_XMLNamespace) == true) + if (equals( + thePendingAttributes.getName(i), + DOMServices::s_XMLNamespace) == true) { return true; } @@ -1650,7 +1653,7 @@ flushPending(); - const unsigned int nAtts = atts.getLength(); + const XalanSize_t nAtts = atts.getLength(); assert(m_outputContextStack.empty() == false); @@ -1659,7 +1662,7 @@ thePendingAttributes.clear(); - for(unsigned int i = 0; i < nAtts; i++) + for (XalanSize_t i = 0; i < nAtts; i++) { thePendingAttributes.addAttribute( atts.getName(i), @@ -1708,8 +1711,8 @@ void XSLTEngineImpl::characters( - const XalanDOMChar* ch, - XalanDOMString::size_type length) + const XalanDOMChar* ch, + size_type length) { characters( ch, @@ -1721,9 +1724,9 @@ void XSLTEngineImpl::characters( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar* ch, + size_type start, + size_type length) { assert(getFormatterListenerImpl() != 0); assert(ch != 0); @@ -1732,11 +1735,11 @@ doFlushPending(); - if(generateCDATASection() == true) + if (generateCDATASection() == true) { getFormatterListenerImpl()->cdata(ch + start, length); - if(getTraceListeners() > 0) + if (getTraceListeners() > 0) { fireCharacterGenerateEvent(ch, start, length, true); } @@ -1745,7 +1748,7 @@ { getFormatterListenerImpl()->characters(ch + start, length); - if(getTraceListeners() > 0) + if (getTraceListeners() > 0) { fireCharacterGenerateEvent(ch, start, length, false); } @@ -1817,9 +1820,9 @@ void XSLTEngineImpl::charactersRaw( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar* ch, + size_type start, + size_type length) { assert(ch != 0); assert(length != 0); @@ -1880,8 +1883,8 @@ void XSLTEngineImpl::ignorableWhitespace( - const XalanDOMChar* ch, - XalanDOMString::size_type length) + const XalanDOMChar* ch, + size_type length) { assert(getFormatterListenerImpl() != 0); assert(ch != 0); @@ -1973,9 +1976,9 @@ void XSLTEngineImpl::cdata( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar* ch, + size_type start, + size_type length) { assert(getFormatterListenerImpl() != 0); assert(ch != 0); @@ -2716,7 +2719,7 @@ const XalanDOMString& thePrefix, XalanDOMString::size_type thePrefixLength) { - const unsigned int thePendingAttributesCount = + const XalanSize_t thePendingAttributesCount = thePendingAttributes.getLength(); if (thePendingAttributesCount == 0) @@ -2729,7 +2732,7 @@ bool fResult = false; // Check each attribute... - for (unsigned int i = 0; i < thePendingAttributesCount; ++i) + for (XalanSize_t i = 0; i < thePendingAttributesCount; ++i) { const XalanDOMChar* const thePendingAttributeName = thePendingAttributes.getName(i); @@ -3141,10 +3144,10 @@ void XSLTEngineImpl::fireCharacterGenerateEvent( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length, - bool isCDATA) + const XalanDOMChar* ch, + size_type start, + size_type length, + bool isCDATA) { const GenerateEvent ge( isCDATA == true ? GenerateEvent::EVENTTYPE_CDATA : GenerateEvent::EVENTTYPE_CHARACTERS, Index: src/xalanc/XSLT/DecimalToRoman.hpp =================================================================== --- src/xalanc/XSLT/DecimalToRoman.hpp (revision 706129) +++ src/xalanc/XSLT/DecimalToRoman.hpp (working copy) @@ -38,7 +38,7 @@ { enum { eMaxLetter = 2 }; - typedef unsigned long ValueType; + typedef XalanSize_t ValueType; ValueType m_postValue; Index: src/xalanc/XSLT/ElemForEach.cpp =================================================================== --- src/xalanc/XSLT/ElemForEach.cpp (revision 706129) +++ src/xalanc/XSLT/ElemForEach.cpp (working copy) @@ -55,8 +55,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemTemplateElement(constructionContext, stylesheetTree, lineNumber, @@ -66,17 +66,17 @@ m_sortElems(constructionContext.getMemoryManager()), m_sortElemsCount(0) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(equals(aname, Constants::ATTRNAME_SELECT)) + if (equals(aname, Constants::ATTRNAME_SELECT)) { m_selectPattern = constructionContext.createXPath(getLocator(), atts.getValue(i), *this); } - else if(isAttrOK( + else if (isAttrOK( aname, atts, i, @@ -96,7 +96,7 @@ } } - if(0 == m_selectPattern) + if (0 == m_selectPattern) { error( constructionContext, @@ -111,8 +111,8 @@ ElemForEach::ElemForEach( StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, - int lineNumber, - int columnNumber, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber, int xslToken) : ElemTemplateElement(constructionContext, stylesheetTree, @@ -147,8 +147,8 @@ const AttributeListType& atts, const LocatorType* locator) { - const int lineNumber = XalanLocator::getLineNumber(locator); - const int columnNumber = XalanLocator::getColumnNumber(locator); + const XalanFileLoc lineNumber = XalanLocator::getLineNumber(locator); + const XalanFileLoc columnNumber = XalanLocator::getColumnNumber(locator); m_sortElems.reserve(m_sortElems.size() + 1); @@ -826,7 +826,7 @@ const XPath* -ElemForEach::getXPath(unsigned int index) const +ElemForEach::getXPath(XalanSize_t index) const { return index == 0 ? m_selectPattern : 0; } Index: src/xalanc/XSLT/ElemApplyTemplates.hpp =================================================================== --- src/xalanc/XSLT/ElemApplyTemplates.hpp (revision 706129) +++ src/xalanc/XSLT/ElemApplyTemplates.hpp (working copy) @@ -50,11 +50,11 @@ * @param columnNumber column number in document */ ElemApplyTemplates( - StylesheetConstructionContext& constructionContext, - Stylesheet& stylesheetTree, - const AttributeListType& atts, - int lineNumber, - int columnNumber); + StylesheetConstructionContext& constructionContext, + Stylesheet& stylesheetTree, + const AttributeListType& atts, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); virtual ~ElemApplyTemplates(); Index: src/xalanc/XSLT/StylesheetHandler.cpp =================================================================== --- src/xalanc/XSLT/StylesheetHandler.cpp (revision 706129) +++ src/xalanc/XSLT/StylesheetHandler.cpp (working copy) @@ -1525,7 +1525,7 @@ void StylesheetHandler::characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { if (m_inTemplate == false && inExtensionElement() == false && @@ -1551,7 +1551,7 @@ void StylesheetHandler::cdata( const XMLCh* const chars, - const unsigned int length) + const size_type length) { accumulateText(chars, length); @@ -1565,7 +1565,7 @@ void StylesheetHandler::ignorableWhitespace( const XMLCh* const /*chars*/, - const unsigned int /*length*/) + const size_type /*length*/) { // Ignore! m_lastPopped = 0; @@ -1617,7 +1617,7 @@ void StylesheetHandler::charactersRaw( const XMLCh* const /* chars */, - const unsigned int /* length */) + const size_type /* length */) { } @@ -1625,8 +1625,8 @@ void StylesheetHandler::processText( - const XMLCh* chars, - XalanDOMString::size_type length) + const XMLCh* chars, + size_type length) { if(m_inTemplate) { @@ -1719,8 +1719,8 @@ void StylesheetHandler::accumulateText( - const XMLCh* chars, - XalanDOMString::size_type length) + const XMLCh* chars, + size_type length) { if(m_inTemplate) { Index: src/xalanc/XSLT/ElemTemplateElement.hpp =================================================================== --- src/xalanc/XSLT/ElemTemplateElement.hpp (revision 706129) +++ src/xalanc/XSLT/ElemTemplateElement.hpp (working copy) @@ -89,8 +89,8 @@ ElemTemplateElement( StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, - int lineNumber, - int columnNumber, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber, int xslToken); /** @@ -110,8 +110,8 @@ Stylesheet& stylesheetTree, int xslToken, const XalanDOMString& baseURI = XalanDOMString(XalanMemMgrs::getDummyMemMgr()), - int lineNumber = XalanLocator::getUnknownValue(), - int columnNumber = XalanLocator::getUnknownValue()); + XalanFileLoc lineNumber = XalanLocator::getUnknownValue(), + XalanFileLoc columnNumber = XalanLocator::getUnknownValue()); virtual ~ElemTemplateElement(); @@ -138,7 +138,7 @@ isAttrOK( const XalanDOMChar* attrName, const AttributeListType& atts, - int which, + XalanSize_t which, StylesheetConstructionContext& constructionContext) const; /** @@ -156,7 +156,7 @@ const XalanDOMChar* elementName, const XalanDOMChar* aname, const AttributeListType& atts, - int which, + XalanSize_t which, StylesheetConstructionContext& constructionContext); /** @@ -615,7 +615,7 @@ * @return pointer or null */ virtual const XPath* - getXPath(unsigned int index = 0) const; + getXPath(XalanSize_t index) const; // These interfaces are inherited from PrefixResolver... @@ -633,8 +633,8 @@ public: LocatorProxy( - size_type theLineNumber, - size_type theColumnNumber, + XMLFileLoc theLineNumber, + XMLFileLoc theColumnNumber, const XalanDOMString& theURI); virtual @@ -646,10 +646,10 @@ virtual const XMLCh* getSystemId() const; - virtual size_type + virtual XMLFileLoc getLineNumber() const; - virtual size_type + virtual XMLFileLoc getColumnNumber() const; const XalanDOMString& @@ -670,21 +670,21 @@ operator==(const LocatorProxy&) const; // data members... - const size_type m_lineNumber; + const XMLFileLoc m_lineNumber; - const size_type m_columnNumber; + const XMLFileLoc m_columnNumber; const XalanDOMString& m_uri; }; - LocatorProxy::size_type + XMLFileLoc getLineNumber() const { return m_locatorProxy.getLineNumber(); } - LocatorProxy::size_type + XMLFileLoc getColumnNumber() const { return m_locatorProxy.getColumnNumber(); Index: src/xalanc/XSLT/Stylesheet.hpp =================================================================== --- src/xalanc/XSLT/Stylesheet.hpp (revision 706129) +++ src/xalanc/XSLT/Stylesheet.hpp (working copy) @@ -86,7 +86,6 @@ public: - typedef StylesheetConstructionContext::size_type size_type; typedef StylesheetExecutionContext::ParamVectorType ParamVectorType; typedef XalanQName::NamespaceVectorType NamespaceVectorType; typedef XalanQName::NamespacesStackType NamespacesStackType; @@ -288,7 +287,7 @@ isAttrOK( const XalanDOMChar* attrName, const AttributeListType& atts, - int which, + XalanSize_t which, StylesheetConstructionContext& constructionContext) const; /** @@ -298,8 +297,9 @@ * @return namespace string for node, or null if not found. */ const XalanDOMString* - getNamespaceFromStack(const XalanDOMString& nodeName, - XalanDOMString& theBuffer) const + getNamespaceFromStack( + const XalanDOMString& nodeName, + XalanDOMString& theBuffer) const { return getNamespaceFromStack(c_wstr(nodeName), theBuffer); } @@ -311,8 +311,9 @@ * @return namespace string for node, or null if not found. */ const XalanDOMString* - getNamespaceFromStack(const XalanDOMChar* nodeName, - XalanDOMString& theBuffer) const; + getNamespaceFromStack( + const XalanDOMChar* nodeName, + XalanDOMString& theBuffer) const; /** * Get the namespace from a prefix by searching the stack of namespace Index: src/xalanc/XSLT/ElemUse.hpp =================================================================== --- src/xalanc/XSLT/ElemUse.hpp (revision 706129) +++ src/xalanc/XSLT/ElemUse.hpp (working copy) @@ -56,8 +56,8 @@ ElemUse( StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, - int lineNumber, - int columnNumber, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber, int xslToken); virtual @@ -77,7 +77,7 @@ StylesheetConstructionContext& constructionContext, const XalanDOMChar* attrName, const AttributeListType& atts, - int which); + XalanSize_t which); // These methods are inherited from ElemTemplateElement ... Index: src/xalanc/XSLT/ElemCallTemplate.cpp =================================================================== --- src/xalanc/XSLT/ElemCallTemplate.cpp (revision 706129) +++ src/xalanc/XSLT/ElemCallTemplate.cpp (working copy) @@ -54,13 +54,13 @@ m_templateName(0), m_template(0) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for(XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(equals(aname, Constants::ATTRNAME_NAME)) + if (equals(aname, Constants::ATTRNAME_NAME)) { m_templateName = constructionContext.createXalanQName( atts.getValue(i), @@ -76,7 +76,7 @@ atts.getValue(i)); } } - else if(isAttrOK( + else if (isAttrOK( aname, atts, i, Index: src/xalanc/XSLT/CountersTable.hpp =================================================================== --- src/xalanc/XSLT/CountersTable.hpp (revision 706129) +++ src/xalanc/XSLT/CountersTable.hpp (working copy) @@ -55,7 +55,7 @@ */ struct Counter { - typedef unsigned long CountType; + typedef XalanSize_t CountType; typedef XalanVector NodeVectorType; Index: src/xalanc/XSLT/ElemCopy.hpp =================================================================== --- src/xalanc/XSLT/ElemCopy.hpp (revision 706129) +++ src/xalanc/XSLT/ElemCopy.hpp (working copy) @@ -49,8 +49,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); // These methods are inherited from ElemTemplateElement ... Index: src/xalanc/XSLT/ElemChoose.cpp =================================================================== --- src/xalanc/XSLT/ElemChoose.cpp (revision 706129) +++ src/xalanc/XSLT/ElemChoose.cpp (working copy) @@ -48,26 +48,26 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemTemplateElement(constructionContext, stylesheetTree, lineNumber, columnNumber, StylesheetConstructionContext::ELEMNAME_CHOOSE) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(isAttrOK( + if (isAttrOK( aname, atts, i, constructionContext) == false && - processSpaceAttr( + processSpaceAttr( Constants::ELEMNAME_CHOOSE_WITH_PREFIX_STRING.c_str(), aname, atts, @@ -107,17 +107,17 @@ { const int type = node->getXSLToken(); - if(StylesheetConstructionContext::ELEMNAME_WHEN == type) + if (StylesheetConstructionContext::ELEMNAME_WHEN == type) { - const XPath* const theXPath = node->getXPath(); + const XPath* const theXPath = node->getXPath(0); assert(theXPath != 0); bool test; theXPath->execute(*this, executionContext, test); - if(0 != executionContext.getTraceListeners()) + if (0 != executionContext.getTraceListeners()) { executionContext.fireSelectEvent( SelectionEvent(executionContext, @@ -172,7 +172,7 @@ if(StylesheetConstructionContext::ELEMNAME_WHEN == type) { - const XPath* const theXPath = node->getXPath(); + const XPath* const theXPath = node->getXPath(0); assert(theXPath != 0); bool test; Index: src/xalanc/XSLT/ElemApplyImport.cpp =================================================================== --- src/xalanc/XSLT/ElemApplyImport.cpp (revision 706129) +++ src/xalanc/XSLT/ElemApplyImport.cpp (working copy) @@ -52,21 +52,21 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemTemplateElement(constructionContext, stylesheetTree, lineNumber, columnNumber, StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(isAttrOK( + if (isAttrOK( aname, atts, i, Index: src/xalanc/XSLT/KeyDeclaration.hpp =================================================================== --- src/xalanc/XSLT/KeyDeclaration.hpp (revision 706129) +++ src/xalanc/XSLT/KeyDeclaration.hpp (working copy) @@ -54,8 +54,8 @@ const XPath& matchPattern, const XPath& use, const XalanDOMString& uri, - XalanLocator::size_type lineNumber, - XalanLocator::size_type columnNumber) : + XMLFileLoc lineNumber, + XMLFileLoc columnNumber) : m_qname(&qname), m_match(&matchPattern), m_use(&use), @@ -136,7 +136,7 @@ * * @return The line number */ - XalanLocator::size_type + XMLFileLoc getLineNumber() const { return m_lineNumber; @@ -147,7 +147,7 @@ * * @return The column number */ - XalanLocator::size_type + XMLFileLoc getColumnNumber() const { return m_columnNumber; @@ -163,9 +163,9 @@ const XalanDOMString* m_uri; - XalanLocator::size_type m_lineNumber; + XMLFileLoc m_lineNumber; - XalanLocator::size_type m_columnNumber; + XMLFileLoc m_columnNumber; }; Index: src/xalanc/XSLT/ElemAttribute.cpp =================================================================== --- src/xalanc/XSLT/ElemAttribute.cpp (revision 706129) +++ src/xalanc/XSLT/ElemAttribute.cpp (working copy) @@ -46,8 +46,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemTemplateElement(constructionContext, stylesheetTree, lineNumber, @@ -56,9 +56,9 @@ m_nameAVT(0), m_namespaceAVT(0) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); @@ -398,6 +398,7 @@ } executionContext.getAndPopCachedString(); + return 0; } Index: src/xalanc/XSLT/XSLTEngineImpl.hpp =================================================================== --- src/xalanc/XSLT/XSLTEngineImpl.hpp (revision 706129) +++ src/xalanc/XSLT/XSLTEngineImpl.hpp (working copy) @@ -425,7 +425,7 @@ addResultNamespaceDecl( const XalanDOMString& prefix, const XalanDOMChar* namespaceVal, - XalanDOMString::size_type len) + size_type len) { m_resultNamespacesStack.addDeclaration( prefix, @@ -496,15 +496,15 @@ * @param theLength The length of the value * @param fromCopy true if the attribute is being copied from the source tree * @param locator The Locator for reporting errors. - */ - void - addResultAttribute( - AttributeListImpl& attList, - const XalanDOMString& aname, - const XalanDOMChar* value, - XalanDOMString::size_type theLength, - bool fromCopy = false, - const LocatorType* locator = 0); + */ + void + addResultAttribute( + AttributeListImpl& attList, + const XalanDOMString& aname, + const XalanDOMChar* value, + size_type theLength, + bool fromCopy = false, + const LocatorType* locator = 0); /** * Add attribute to pending attributes list, and if it is a namespace, add @@ -585,15 +585,15 @@ void endElement(const XalanDOMChar* name); - void - characters ( - const XalanDOMChar* ch, - XalanDOMString::size_type length); + void + characters ( + const XalanDOMChar* ch, + size_type length); - void - ignorableWhitespace( - const XalanDOMChar* ch, - XalanDOMString::size_type length); + void + ignorableWhitespace( + const XalanDOMChar* ch, + size_type length); void processingInstruction( @@ -603,18 +603,18 @@ void resetDocument(); - /** - * Receive notification of character data. - * - * @param ch pointer to characters from the XML document - * @param start startng offset in 'ch' array - * @param length number of characters to read from the array - */ - void - characters( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length); + /** + * Receive notification of character data. + * + * @param ch pointer to characters from the XML document + * @param start startng offset in 'ch' array + * @param length number of characters to read from the array + */ + void + characters( + const XalanDOMChar* ch, + size_type start, + size_type length); /** * Send character data from the node to the result tree. @@ -641,20 +641,20 @@ void startElement(const XalanDOMChar* name); - /** - * Receive notification of character data. If available, when the - * disable-output-escaping attribute is used, output raw text without - * escaping. - * - * @param ch pointer to characters from the XML document - * @param start start position in the array - * @param length number of characters to read from the array - */ - void - charactersRaw( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length); + /** + * Receive notification of character data. If available, when the + * disable-output-escaping attribute is used, output raw text without + * escaping. + * + * @param ch pointer to characters from the XML document + * @param start start position in the array + * @param length number of characters to read from the array + */ + void + charactersRaw( + const XalanDOMChar* ch, + size_type start, + size_type length); /** * Send raw character data from the node to the result tree. @@ -689,18 +689,18 @@ void entityReference(const XalanDOMChar* data); - /** - * Receive notification of cdata. - * - * @param ch pointer to characters from the XML document - * @param start start position in the array - * @param length number of characters to read from the array - */ - void - cdata( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length); + /** + * Receive notification of cdata. + * + * @param ch pointer to characters from the XML document + * @param start start position in the array + * @param length number of characters to read from the array + */ + void + cdata( + const XalanDOMChar* ch, + size_type start, + size_type length); /** * Clone a node to the result tree @@ -1600,12 +1600,12 @@ const XalanDOMString& theString, bool isCDATA); - void - fireCharacterGenerateEvent( - const XalanDOMChar* ch, - XalanDOMString::size_type start, - XalanDOMString::size_type length, - bool isCDATA); + void + fireCharacterGenerateEvent( + const XalanDOMChar* ch, + size_type start, + size_type length, + bool isCDATA); void checkDefaultNamespace( Index: src/xalanc/XSLT/ElemForEach.hpp =================================================================== --- src/xalanc/XSLT/ElemForEach.hpp (revision 706129) +++ src/xalanc/XSLT/ElemForEach.hpp (working copy) @@ -67,11 +67,11 @@ * @param columnNumber column number in document */ ElemForEach( - StylesheetConstructionContext& constructionContext, - Stylesheet& stylesheetTree, - const AttributeListType& atts, - int lineNumber, - int columnNumber); + StylesheetConstructionContext& constructionContext, + Stylesheet& stylesheetTree, + const AttributeListType& atts, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); virtual ~ElemForEach(); @@ -112,7 +112,7 @@ #endif virtual const XPath* - getXPath(unsigned int index = 0) const; + getXPath(XalanSize_t index) const; protected: @@ -126,11 +126,11 @@ * @param xslToken an integer representing the type of instance. */ ElemForEach( - StylesheetConstructionContext& constructionContext, - Stylesheet& stylesheetTree, - int lineNumber, - int columnNumber, - int xslToken); + StylesheetConstructionContext& constructionContext, + Stylesheet& stylesheetTree, + XalanFileLoc lineNumber, + XalanFileLoc columnNumber, + int xslToken); #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) Index: src/xalanc/XSLT/XalanElemElementAllocator.cpp =================================================================== --- src/xalanc/XSLT/XalanElemElementAllocator.cpp (revision 706129) +++ src/xalanc/XSLT/XalanElemElementAllocator.cpp (working copy) @@ -23,7 +23,9 @@ -XalanElemElementAllocator::XalanElemElementAllocator(MemoryManagerType& theManager, size_type theBlockCount) : +XalanElemElementAllocator::XalanElemElementAllocator( + MemoryManagerType& theManager, + size_type theBlockCount) : m_allocator(theManager, theBlockCount) { } @@ -41,8 +43,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) { data_type* const theBlock = m_allocator.allocateBlock(); assert(theBlock != 0); Index: src/xalanc/XSLT/XalanElemAttributeAllocator.cpp =================================================================== --- src/xalanc/XSLT/XalanElemAttributeAllocator.cpp (revision 706129) +++ src/xalanc/XSLT/XalanElemAttributeAllocator.cpp (working copy) @@ -23,7 +23,9 @@ -XalanElemAttributeAllocator::XalanElemAttributeAllocator(MemoryManagerType& theManager, size_type theBlockCount) : +XalanElemAttributeAllocator::XalanElemAttributeAllocator( + MemoryManagerType& theManager, + size_type theBlockCount) : m_allocator(theManager, theBlockCount) { } @@ -41,8 +43,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) { data_type* const theBlock = m_allocator.allocateBlock(); assert(theBlock != 0); Index: src/xalanc/XSLT/StylesheetHandler.hpp =================================================================== --- src/xalanc/XSLT/StylesheetHandler.hpp (revision 706129) +++ src/xalanc/XSLT/StylesheetHandler.hpp (working copy) @@ -129,7 +129,10 @@ * @see #ignorableWhitespace * @see org.xml.sax.Locator */ - virtual void characters (const XMLCh* const chars, const unsigned int length); + virtual void + characters( + const XMLCh* const chars, + const size_type length); /** * Receive notification of character data. If available, when the @@ -141,7 +144,10 @@ * @param length number of characters to read from the array * @exception SAXException */ - virtual void charactersRaw(const XMLCh* const chars, const unsigned int length); + virtual void + charactersRaw( + const XMLCh* const chars, + const size_type length); /** * Receive notification of cdata. @@ -166,7 +172,10 @@ * @exception SAXException * @see #ignorableWhitespace */ - virtual void cdata(const XMLCh* const ch, const unsigned int length); + virtual void + cdata( + const XMLCh* const ch, + const size_type length); /** * Receive notification of ignorable whitespace in element content. @@ -191,7 +200,10 @@ * @exception SAXException * @see #characters */ - virtual void ignorableWhitespace (const XMLCh* const chars, const unsigned int length); + virtual void + ignorableWhitespace( + const XMLCh* const chars, + const size_type length); /** * Receive notification of a processing instruction. @@ -467,13 +479,13 @@ void processText( - const XMLCh* chars, - XalanDOMString::size_type length); + const XMLCh* chars, + size_type length); void accumulateText( - const XMLCh* chars, - XalanDOMString::size_type length); + const XMLCh* chars, + size_type length); void processAccumulatedText(); Index: src/xalanc/XSLT/ElemDecimalFormat.cpp =================================================================== --- src/xalanc/XSLT/ElemDecimalFormat.cpp (revision 706129) +++ src/xalanc/XSLT/ElemDecimalFormat.cpp (working copy) @@ -50,8 +50,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemTemplateElement(constructionContext, stylesheetTree, lineNumber, @@ -66,13 +66,13 @@ m_decimalFormatSymbols.setInfinity(XalanDOMString(constructionContext.getMemoryManager())); m_decimalFormatSymbols.setNaN(XalanDOMString(constructionContext.getMemoryManager())); - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(equals(aname, Constants::ATTRNAME_NAME)) + if (equals(aname, Constants::ATTRNAME_NAME)) { assert(atts.getValue(i) != 0); @@ -90,7 +90,7 @@ atts.getValue(i)); } } - else if(equals(aname, Constants::ATTRNAME_DECIMALSEPARATOR)) + else if (equals(aname, Constants::ATTRNAME_DECIMALSEPARATOR)) { const XalanDOMChar* const decimalSepValue = atts.getValue(i); assert(decimalSepValue != 0); @@ -109,7 +109,7 @@ decimalSepValue); } } - else if(equals(aname, Constants::ATTRNAME_GROUPINGSEPARATOR)) + else if (equals(aname, Constants::ATTRNAME_GROUPINGSEPARATOR)) { const XalanDOMChar* const sepValue = atts.getValue(i); assert(sepValue!= 0); @@ -128,13 +128,13 @@ sepValue); } } - else if(equals(aname, Constants::ATTRNAME_INFINITY)) + else if (equals(aname, Constants::ATTRNAME_INFINITY)) { assert(atts.getValue(i) != 0); m_decimalFormatSymbols.setInfinity(atts.getValue(i)); } - else if(equals(aname, Constants::ATTRNAME_MINUSSIGN)) + else if (equals(aname, Constants::ATTRNAME_MINUSSIGN)) { const XalanDOMChar* const minusValue = atts.getValue(i); assert(minusValue != 0); @@ -153,13 +153,13 @@ minusValue); } } - else if(equals(aname, Constants::ATTRNAME_NAN)) + else if (equals(aname, Constants::ATTRNAME_NAN)) { assert(atts.getValue(i) != 0); m_decimalFormatSymbols.setNaN(atts.getValue(i)); } - else if(equals(aname, Constants::ATTRNAME_PERCENT)) + else if (equals(aname, Constants::ATTRNAME_PERCENT)) { const XalanDOMChar* const percentValue = atts.getValue(i); assert(percentValue != 0); @@ -178,7 +178,7 @@ percentValue); } } - else if(equals(aname, Constants::ATTRNAME_PERMILLE)) + else if (equals(aname, Constants::ATTRNAME_PERMILLE)) { const XalanDOMChar* const permilleValue = atts.getValue(i); assert(permilleValue != 0); @@ -197,7 +197,7 @@ permilleValue); } } - else if(equals(aname, Constants::ATTRNAME_ZERODIGIT)) + else if (equals(aname, Constants::ATTRNAME_ZERODIGIT)) { const XalanDOMChar* const zeroDigitValue = atts.getValue(i); assert(zeroDigitValue != 0); @@ -216,7 +216,7 @@ zeroDigitValue); } } - else if(equals(aname, Constants::ATTRNAME_DIGIT)) + else if (equals(aname, Constants::ATTRNAME_DIGIT)) { const XalanDOMChar* const digitValue = atts.getValue(i); assert(digitValue != 0); @@ -308,7 +308,7 @@ const XPath* -ElemDecimalFormat::getXPath(unsigned int index) const +ElemDecimalFormat::getXPath(XalanSize_t index) const { const XPath* result = 0; Index: src/xalanc/XSLT/ElemAttributeSet.cpp =================================================================== --- src/xalanc/XSLT/ElemAttributeSet.cpp (revision 706129) +++ src/xalanc/XSLT/ElemAttributeSet.cpp (working copy) @@ -41,8 +41,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemUse(constructionContext, stylesheetTree, lineNumber, @@ -50,13 +50,13 @@ StylesheetConstructionContext::ELEMNAME_ATTRIBUTE_SET), m_qname(0) { - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); - if(equals(aname, Constants::ATTRNAME_NAME)) + if (equals(aname, Constants::ATTRNAME_NAME)) { m_qname = constructionContext.createXalanQName( atts.getValue(i), @@ -72,12 +72,12 @@ atts.getValue(i)); } } - else if(processUseAttributeSets( + else if (processUseAttributeSets( constructionContext, aname, atts, i) == false && - isAttrOK( + isAttrOK( aname, atts, i, @@ -91,7 +91,7 @@ } } - if(m_qname == 0) + if (m_qname == 0) { error( constructionContext, Index: src/xalanc/XSLT/ElemChoose.hpp =================================================================== --- src/xalanc/XSLT/ElemChoose.hpp (revision 706129) +++ src/xalanc/XSLT/ElemChoose.hpp (working copy) @@ -49,8 +49,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); // These methods are inherited from ElemTemplateElement ... Index: src/xalanc/XSLT/ElemApplyImport.hpp =================================================================== --- src/xalanc/XSLT/ElemApplyImport.hpp (revision 706129) +++ src/xalanc/XSLT/ElemApplyImport.hpp (working copy) @@ -50,8 +50,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber); + XalanFileLoc lineNumber, + XalanFileLoc columnNumber); // These methods are inherited from ElemTemplateElement ... @@ -77,7 +77,6 @@ virtual ElemTemplateElement* appendChildElem(ElemTemplateElement* newChild); - private: }; Index: src/xalanc/XSLT/ElemElement.cpp =================================================================== --- src/xalanc/XSLT/ElemElement.cpp (revision 706129) +++ src/xalanc/XSLT/ElemElement.cpp (working copy) @@ -45,8 +45,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) : + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) : ElemUse(constructionContext, stylesheetTree, lineNumber, @@ -59,9 +59,9 @@ // turn them off... // m_namespacesHandler.setProcessNamespaceAliaises(false); - const unsigned int nAttrs = atts.getLength(); + const XalanSize_t nAttrs = atts.getLength(); - for(unsigned int i = 0; i < nAttrs; i++) + for (XalanSize_t i = 0; i < nAttrs; i++) { const XalanDOMChar* const aname = atts.getName(i); @@ -125,6 +125,7 @@ } + #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) const ElemTemplateElement* ElemElement::startElement(StylesheetExecutionContext& executionContext) const Index: src/xalanc/XSLT/XalanElemApplyTemplatesAllocator.cpp =================================================================== --- src/xalanc/XSLT/XalanElemApplyTemplatesAllocator.cpp (revision 706129) +++ src/xalanc/XSLT/XalanElemApplyTemplatesAllocator.cpp (working copy) @@ -23,7 +23,9 @@ -XalanElemApplyTemplatesAllocator::XalanElemApplyTemplatesAllocator(MemoryManagerType& theManager, size_type theBlockCount) : +XalanElemApplyTemplatesAllocator::XalanElemApplyTemplatesAllocator( + MemoryManagerType& theManager, + size_type theBlockCount) : m_allocator(theManager, theBlockCount) { } @@ -41,8 +43,8 @@ StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, const AttributeListType& atts, - int lineNumber, - int columnNumber) + XalanFileLoc lineNumber, + XalanFileLoc columnNumber) { data_type* const theBlock = m_allocator.allocateBlock(); assert(theBlock != 0); Index: src/xalanc/XMLSupport/XalanIndentWriter.hpp =================================================================== --- src/xalanc/XMLSupport/XalanIndentWriter.hpp (revision 706129) +++ src/xalanc/XMLSupport/XalanIndentWriter.hpp (working copy) @@ -22,18 +22,21 @@ #include +#include #include XALAN_CPP_NAMESPACE_BEGIN -template +template< + class WhiteSpaceWriter, + class NewLineWriter> class XalanIndentWriter { public: - typedef typename XalanDOMString::size_type size_type; + + typedef FormatterListener::size_type size_type; typedef XalanVector BoolStackType; typedef typename WhiteSpaceWriter::writer_type writer_type; Index: src/xalanc/XMLSupport/XalanUTF8Writer.hpp =================================================================== --- src/xalanc/XMLSupport/XalanUTF8Writer.hpp (revision 706129) +++ src/xalanc/XMLSupport/XalanUTF8Writer.hpp (working copy) @@ -150,34 +150,40 @@ /** * Writes name chars , if not presentable, throws */ - void writeNameChar(const XalanDOMChar* data, - size_type theLength) + void + writeNameChar( + const XalanDOMChar* data, + size_type theLength) { write(data, theLength); } /** - * Writes name chars , if not presentable, throws + * Writes name chars, if not representable, throws */ - void writePIChars(const XalanDOMChar* data, - size_type theLength) + void + writePIChars( + const XalanDOMChar* data, + size_type theLength) { write(data, theLength); } /** - * Writes name chars , if not presentable, throws + * Writes name chars, if not representable, throws */ - void writeCommentChars(const XalanDOMChar* data, - size_type theLength) + void + writeCommentChars( + const XalanDOMChar* data, + size_type theLength) { write(data, theLength); } void safeWriteContent( - const XalanDOMChar* theChars, - XalanDOMString::size_type theLength) + const XalanDOMChar* theChars, + size_type theLength) { for(size_type i = 0; i < theLength; ++i) { @@ -187,8 +193,8 @@ void write( - const value_type* theChars, - XalanDOMString::size_type theLength) + const value_type* theChars, + size_type theLength) { #if defined(NDEBUG) if (theLength > sizeof(m_buffer)) @@ -214,7 +220,7 @@ m_bufferRemaining -= theLength; } #else - for(XalanDOMString::size_type i = 0; i < theLength; ++i) + for(size_type i = 0; i < theLength; ++i) { write(theChars[i]); } @@ -251,8 +257,8 @@ void write( - const XalanDOMChar* theChars, - XalanDOMString::size_type theLength) + const XalanDOMChar* theChars, + size_type theLength) { for(size_type i = 0; i < theLength; ++i) { @@ -262,13 +268,13 @@ size_type write( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar chars[], + size_type start, + size_type length) { XalanDOMChar ch = chars[start]; - if (XalanFormatterWriter::isUTF16HighSurrogate(ch) == false) + if (isUTF16HighSurrogate(ch) == false) { write((unsigned int)ch); } @@ -276,7 +282,7 @@ { if (start + 1 >= length) { - XalanFormatterWriter::throwInvalidUTF16SurrogateException( + throwInvalidUTF16SurrogateException( ch, 0, getMemoryManager()); @@ -284,7 +290,7 @@ else { write( - XalanFormatterWriter::decodeUTF16SurrogatePair( + decodeUTF16SurrogatePair( ch, chars[++start], getMemoryManager())); @@ -296,8 +302,8 @@ void writeSafe( - const XalanDOMChar* theChars, - XalanDOMString::size_type theLength) + const XalanDOMChar* theChars, + size_type theLength) { XalanDOMChar ch = 0; @@ -305,15 +311,15 @@ { ch = theChars[i]; - if (XalanFormatterWriter::isUTF16HighSurrogate(ch) == true) + if (isUTF16HighSurrogate(ch) == true) { if (i + 1 >= theLength) { - XalanFormatterWriter::throwInvalidUTF16SurrogateException(ch, 0, getMemoryManager()); + throwInvalidUTF16SurrogateException(ch, 0, getMemoryManager()); } else { - write(XalanFormatterWriter::decodeUTF16SurrogatePair(ch, theChars[i+1], getMemoryManager())); + write(decodeUTF16SurrogatePair(ch, theChars[i + 1], getMemoryManager())); ++i; } @@ -410,7 +416,7 @@ } else { - XalanFormatterWriter::throwInvalidCharacterException(theChar, getMemoryManager()); + throwInvalidCharacterException(theChar, getMemoryManager()); } } @@ -421,11 +427,11 @@ // Data members... - value_type m_buffer[kBufferSize]; + value_type m_buffer[kBufferSize]; - value_type* m_bufferPosition; + value_type* m_bufferPosition; - XalanDOMString::size_type m_bufferRemaining; + size_type m_bufferRemaining; }; Index: src/xalanc/XMLSupport/XalanFormatterWriter.hpp =================================================================== --- src/xalanc/XMLSupport/XalanFormatterWriter.hpp (revision 706129) +++ src/xalanc/XMLSupport/XalanFormatterWriter.hpp (working copy) @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -42,6 +43,9 @@ { public: + typedef FormatterListener::size_type size_type; + + template class NewLineWriterFunctor { @@ -90,14 +94,14 @@ /** * The length of the the string of characters that represents the newline */ - XalanDOMString::size_type m_newlineStringLength; + size_type m_newlineStringLength; }; template class WhiteSpaceWriterFunctor { - typedef XalanDOMString::size_type size_type; typedef typename WriterType::value_type value_type; + public: typedef WriterType writer_type; @@ -150,9 +154,6 @@ public: - typedef XalanDOMString::size_type size_type; - - XalanFormatterWriter( Writer& theWriter, MemoryManager& theMemoryManager) : @@ -313,7 +314,7 @@ /** * The length of the the string of characters that represents the newline */ - XalanDOMString::size_type m_newlineStringLength; + size_type m_newlineStringLength; /** * Format a code point as a numeric character reference. Index: src/xalanc/XMLSupport/FormatterToHTML.cpp =================================================================== --- src/xalanc/XMLSupport/FormatterToHTML.cpp (revision 706129) +++ src/xalanc/XMLSupport/FormatterToHTML.cpp (working copy) @@ -156,7 +156,7 @@ m_attrCharsMap[XalanUnicode::charLessThanSign] = 0; m_attrCharsMap[XalanUnicode::charGreaterThanSign] = 0; - for(XalanDOMString::size_type i = 160; i < SPECIALSSIZE; i++) + for(size_type i = 160; i < SPECIALSSIZE; i++) { m_attrCharsMap[i] = 'S'; } @@ -481,7 +481,7 @@ void FormatterToHTML::characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { if(length != 0) { @@ -590,7 +590,7 @@ void FormatterToHTML::cdata( const XMLCh* const ch, - const unsigned int length) + const size_type length) { if(m_isScriptOrStyleElem == true) { @@ -632,7 +632,7 @@ const XMLCh* const data) { - const XalanDOMString::size_type dataLength = length(data); + const size_type dataLength = length(data); // Use a fairly nasty hack to tell if the next node is supposed to be // unescaped text. @@ -689,13 +689,13 @@ void FormatterToHTML::writeCharacters( - const XalanDOMChar* theString, - XalanDOMString::size_type theLength) + const XalanDOMChar* theString, + size_type theLength) { assert(theString != 0); - XalanDOMString::size_type i = 0; - XalanDOMString::size_type firstIndex = 0; + size_type i = 0; + size_type firstIndex = 0; while(i < theLength) { @@ -768,13 +768,13 @@ void FormatterToHTML::writeAttrString( - const XalanDOMChar* theString, - XalanDOMString::size_type theStringLength) + const XalanDOMChar* theString, + size_type theStringLength) { assert(theString != 0); - XalanDOMString::size_type i = 0; - XalanDOMString::size_type firstIndex = 0; + size_type i = 0; + size_type firstIndex = 0; while(i < theStringLength) { @@ -853,8 +853,8 @@ void FormatterToHTML::copyEntityIntoBuffer( - const XalanDOMChar* s, - XalanDOMString::size_type theLength) + const XalanDOMChar* s, + size_type theLength) { assert(s != 0); @@ -885,11 +885,11 @@ const XalanDOMChar* value, const XalanHTMLElementsProperties::ElementProperties& elemProperties) { - const XalanDOMString::size_type nameLength = length(name); + const size_type nameLength = length(name); accumContent(XalanUnicode::charSpace); - const XalanDOMString::size_type valueLength = length(value); + const size_type valueLength = length(value); if((valueLength == 0 || equalsIgnoreCaseASCII(name, nameLength, value, valueLength)) && elemProperties.isAttribute(name, XalanHTMLElementsProperties::ATTREMPTY) == true) @@ -919,8 +919,8 @@ void FormatterToHTML::writeAttrURI( - const XalanDOMChar* theString, - XalanDOMString::size_type theStringLength) + const XalanDOMChar* theString, + size_type theStringLength) { assert(theString != 0); @@ -939,7 +939,7 @@ // causing damage. If the URL is already properly escaped, in theory, this // function should not change the string value. - for (XalanDOMString::size_type i = 0; i < theStringLength; ++i) + for (size_type i = 0; i < theStringLength; ++i) { const XalanDOMChar ch = theString[i]; @@ -1123,8 +1123,8 @@ if (m_prefixResolver != 0) { - const XalanDOMString::size_type theLength = length(theElementName); - const XalanDOMString::size_type theColonIndex = indexOf(theElementName, XalanUnicode::charColon); + const size_type theLength = length(theElementName); + const size_type theColonIndex = indexOf(theElementName, XalanUnicode::charColon); const XalanDOMString* thePrefix = &s_emptyString; Index: src/xalanc/XMLSupport/FormatterToHTML.hpp =================================================================== --- src/xalanc/XMLSupport/FormatterToHTML.hpp (revision 706129) +++ src/xalanc/XMLSupport/FormatterToHTML.hpp (working copy) @@ -118,7 +118,7 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); // These methods are inherited from FormatterToXML... @@ -135,7 +135,7 @@ virtual void cdata( const XMLCh* const ch, - const unsigned int length); + const size_type length); virtual void processingInstruction( @@ -159,19 +159,19 @@ { enum { eMaxLength = 8 }; - XalanDOMChar m_char; + XalanDOMChar m_char; - XalanDOMString::size_type m_length; + size_type m_length; - XalanDOMChar m_string[eMaxLength + 1]; + XalanDOMChar m_string[eMaxLength + 1]; }; protected: virtual void writeAttrString( - const XalanDOMChar* theString, - XalanDOMString::size_type theStringLength); + const XalanDOMChar* theString, + size_type theStringLength); virtual void accumCommentData(const XalanDOMChar* data); @@ -181,13 +181,11 @@ void writeCharacters( - const XalanDOMChar* theString, - XalanDOMString::size_type theLength); + const XalanDOMChar* theString, + size_type theLength); private: - typedef XalanDOMString::size_type size_type; - /** * The string " 0) { @@ -380,7 +380,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::s_xhtmlDocTypeStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::s_xhtmlDocTypeStringLength = FXML_SIZE(s_xhtmlDocTypeString); @@ -481,7 +481,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_doctypeHeaderStartStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_doctypeHeaderStartStringLength = FXML_SIZE(s_doctypeHeaderStartString); const char XalanXMLSerializerBase::UTF8::s_doctypeHeaderPublicString[] = @@ -498,7 +498,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_doctypeHeaderPublicStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_doctypeHeaderPublicStringLength = FXML_SIZE(s_doctypeHeaderPublicString); const char XalanXMLSerializerBase::UTF8::s_doctypeHeaderSystemString[] = @@ -515,7 +515,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_doctypeHeaderSystemStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_doctypeHeaderSystemStringLength = FXML_SIZE(s_doctypeHeaderSystemString); const char XalanXMLSerializerBase::UTF8::s_xmlHeaderStartString[] = @@ -538,7 +538,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderStartStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderStartStringLength = FXML_SIZE(s_xmlHeaderStartString); const char XalanXMLSerializerBase::UTF8::s_xmlHeaderEncodingString[] = @@ -558,7 +558,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderEncodingStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderEncodingStringLength = FXML_SIZE(s_xmlHeaderEncodingString); const char XalanXMLSerializerBase::UTF8::s_xmlHeaderStandaloneString[] = @@ -580,7 +580,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderStandaloneStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderStandaloneStringLength = FXML_SIZE(s_xmlHeaderStandaloneString); const char XalanXMLSerializerBase::UTF8::s_xmlHeaderEndString[] = @@ -591,7 +591,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderEndStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_xmlHeaderEndStringLength = FXML_SIZE(s_xmlHeaderEndString); const char XalanXMLSerializerBase::UTF8::s_defaultVersionString[] = @@ -602,7 +602,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_defaultVersionStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_defaultVersionStringLength = FXML_SIZE(s_defaultVersionString); const char XalanXMLSerializerBase::UTF8::s_cdataOpenString[] = @@ -619,7 +619,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_cdataOpenStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_cdataOpenStringLength = FXML_SIZE(s_cdataOpenString); const char XalanXMLSerializerBase::UTF8::s_cdataCloseString[] = @@ -630,7 +630,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_cdataCloseStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_cdataCloseStringLength = FXML_SIZE(s_cdataCloseString); @@ -656,7 +656,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_xhtmlDocTypeStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_xhtmlDocTypeStringLength = FXML_SIZE(s_xhtmlDocTypeString); const char XalanXMLSerializerBase::UTF8::s_lessThanEntityString[] = @@ -668,7 +668,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_lessThanEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_lessThanEntityStringLength = FXML_SIZE(s_lessThanEntityString); const char XalanXMLSerializerBase::UTF8::s_greaterThanEntityString[] = @@ -680,7 +680,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_greaterThanEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_greaterThanEntityStringLength = FXML_SIZE(s_greaterThanEntityString); const char XalanXMLSerializerBase::UTF8::s_ampersandEntityString[] = @@ -693,7 +693,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_ampersandEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_ampersandEntityStringLength = FXML_SIZE(s_ampersandEntityString); const char XalanXMLSerializerBase::UTF8::s_quoteEntityString[] = @@ -707,7 +707,7 @@ char(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF8::s_quoteEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF8::s_quoteEntityStringLength = FXML_SIZE(s_quoteEntityString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_doctypeHeaderStartString[] = @@ -725,7 +725,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_doctypeHeaderStartStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_doctypeHeaderStartStringLength = FXML_SIZE(s_doctypeHeaderStartString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_doctypeHeaderPublicString[] = @@ -742,7 +742,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_doctypeHeaderPublicStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_doctypeHeaderPublicStringLength = FXML_SIZE(s_doctypeHeaderPublicString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_doctypeHeaderSystemString[] = @@ -759,7 +759,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_doctypeHeaderSystemStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_doctypeHeaderSystemStringLength = FXML_SIZE(s_doctypeHeaderSystemString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_xmlHeaderStartString[] = @@ -782,7 +782,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderStartStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderStartStringLength = FXML_SIZE(s_xmlHeaderStartString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_xmlHeaderEncodingString[] = @@ -802,7 +802,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderEncodingStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderEncodingStringLength = FXML_SIZE(s_xmlHeaderEncodingString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_xmlHeaderStandaloneString[] = @@ -824,7 +824,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderStandaloneStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderStandaloneStringLength = FXML_SIZE(s_xmlHeaderStandaloneString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_xmlHeaderEndString[] = @@ -835,7 +835,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderEndStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_xmlHeaderEndStringLength = FXML_SIZE(s_xmlHeaderEndString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_defaultVersionString[] = @@ -846,7 +846,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_defaultVersionStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_defaultVersionStringLength = FXML_SIZE(s_defaultVersionString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_cdataOpenString[] = @@ -863,7 +863,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_cdataOpenStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_cdataOpenStringLength = FXML_SIZE(s_cdataOpenString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_cdataCloseString[] = @@ -874,7 +874,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_cdataCloseStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_cdataCloseStringLength = FXML_SIZE(s_cdataCloseString); @@ -900,7 +900,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_xhtmlDocTypeStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_xhtmlDocTypeStringLength = FXML_SIZE(s_xhtmlDocTypeString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_lessThanEntityString[] = @@ -912,7 +912,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_lessThanEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_lessThanEntityStringLength = FXML_SIZE(s_lessThanEntityString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_greaterThanEntityString[] = @@ -924,7 +924,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_greaterThanEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_greaterThanEntityStringLength = FXML_SIZE(s_greaterThanEntityString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_ampersandEntityString[] = @@ -937,7 +937,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_ampersandEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_ampersandEntityStringLength = FXML_SIZE(s_ampersandEntityString); const XalanDOMChar XalanXMLSerializerBase::UTF16::s_quoteEntityString[] = @@ -951,7 +951,7 @@ XalanDOMChar(0) }; -const XalanDOMString::size_type XalanXMLSerializerBase::UTF16::s_quoteEntityStringLength = +const XalanXMLSerializerBase::size_type XalanXMLSerializerBase::UTF16::s_quoteEntityStringLength = FXML_SIZE(s_quoteEntityString); Index: src/xalanc/XMLSupport/FormatterToText.cpp =================================================================== --- src/xalanc/XMLSupport/FormatterToText.cpp (revision 706129) +++ src/xalanc/XMLSupport/FormatterToText.cpp (working copy) @@ -187,7 +187,7 @@ void FormatterToText::characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { assert(m_writer != 0); @@ -245,7 +245,7 @@ void FormatterToText::charactersRaw( const XMLCh* const chars, - const unsigned int length) + const size_type length) { characters(chars, length); } @@ -262,7 +262,7 @@ void FormatterToText::ignorableWhitespace( const XMLCh* const chars, - const unsigned int length) + const size_type length) { if (m_handleIgnorableWhitespace == true) { @@ -301,7 +301,7 @@ void FormatterToText::cdata( const XMLCh* const ch, - const unsigned int length) + const size_type length) { characters(ch, length); } Index: src/xalanc/XMLSupport/XalanXMLSerializerBase.hpp =================================================================== --- src/xalanc/XMLSupport/XalanXMLSerializerBase.hpp (revision 706129) +++ src/xalanc/XMLSupport/XalanXMLSerializerBase.hpp (working copy) @@ -122,12 +122,12 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void charactersRaw( const XMLCh* const chars, - const unsigned int length) = 0; + const size_type length) = 0; virtual void entityReference(const XMLCh* const name) = 0; @@ -135,7 +135,7 @@ virtual void ignorableWhitespace( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void processingInstruction( @@ -151,7 +151,7 @@ virtual void cdata( const XMLCh* const ch, - const unsigned int length); + const size_type length); virtual const XalanDOMString& getDoctypeSystem() const; @@ -207,107 +207,107 @@ /** * The string "". */ - static const char s_xmlHeaderEndString[]; + static const char s_xmlHeaderEndString[]; - static const XalanDOMString::size_type s_xmlHeaderEndStringLength; + static const size_type s_xmlHeaderEndStringLength; /** * The string "1.0". */ - static const char s_defaultVersionString[]; + static const char s_defaultVersionString[]; - static const XalanDOMString::size_type s_defaultVersionStringLength; + static const size_type s_defaultVersionStringLength; /** * The string "-//W3C//DTD XHTML". */ - static const XalanDOMChar s_xhtmlDocTypeString[]; + static const XalanDOMChar s_xhtmlDocTypeString[]; - static const XalanDOMString::size_type s_xhtmlDocTypeStringLength; + static const size_type s_xhtmlDocTypeStringLength; /** * The string "". */ - static const char s_cdataCloseString[]; + static const char s_cdataCloseString[]; - static const XalanDOMString::size_type s_cdataCloseStringLength; + static const size_type s_cdataCloseStringLength; /** * The string "<". */ - static const char s_lessThanEntityString[]; + static const char s_lessThanEntityString[]; - static const XalanDOMString::size_type s_lessThanEntityStringLength; + static const size_type s_lessThanEntityStringLength; /** * The string ">". */ - static const char s_greaterThanEntityString[]; + static const char s_greaterThanEntityString[]; - static const XalanDOMString::size_type s_greaterThanEntityStringLength; + static const size_type s_greaterThanEntityStringLength; /** * The string "&". */ - static const char s_ampersandEntityString[]; + static const char s_ampersandEntityString[]; - static const XalanDOMString::size_type s_ampersandEntityStringLength; + static const size_type s_ampersandEntityStringLength; /** * The string """. */ - static const char s_quoteEntityString[]; + static const char s_quoteEntityString[]; - static const XalanDOMString::size_type s_quoteEntityStringLength; + static const size_type s_quoteEntityStringLength; }; class XALAN_XMLSUPPORT_EXPORT UTF16 @@ -322,107 +322,107 @@ /** * The string "". */ - static const XalanDOMChar s_xmlHeaderEndString[]; + static const XalanDOMChar s_xmlHeaderEndString[]; - static const XalanDOMString::size_type s_xmlHeaderEndStringLength; + static const size_type s_xmlHeaderEndStringLength; /** * The string "1.0". */ - static const XalanDOMChar s_defaultVersionString[]; + static const XalanDOMChar s_defaultVersionString[]; - static const XalanDOMString::size_type s_defaultVersionStringLength; + static const size_type s_defaultVersionStringLength; /** * The string "-//W3C//DTD XHTML". */ - static const XalanDOMChar s_xhtmlDocTypeString[]; + static const XalanDOMChar s_xhtmlDocTypeString[]; - static const XalanDOMString::size_type s_xhtmlDocTypeStringLength; + static const size_type s_xhtmlDocTypeStringLength; /** * The string "". */ - static const XalanDOMChar s_cdataCloseString[]; + static const XalanDOMChar s_cdataCloseString[]; - static const XalanDOMString::size_type s_cdataCloseStringLength; + static const size_type s_cdataCloseStringLength; /** * The string "<". */ - static const XalanDOMChar s_lessThanEntityString[]; + static const XalanDOMChar s_lessThanEntityString[]; - static const XalanDOMString::size_type s_lessThanEntityStringLength; + static const size_type s_lessThanEntityStringLength; /** * The string ">". */ - static const XalanDOMChar s_greaterThanEntityString[]; + static const XalanDOMChar s_greaterThanEntityString[]; - static const XalanDOMString::size_type s_greaterThanEntityStringLength; + static const size_type s_greaterThanEntityStringLength; /** * The string "&". */ - static const XalanDOMChar s_ampersandEntityString[]; + static const XalanDOMChar s_ampersandEntityString[]; - static const XalanDOMString::size_type s_ampersandEntityStringLength; + static const size_type s_ampersandEntityStringLength; /** * The string """. */ - static const XalanDOMChar s_quoteEntityString[]; + static const XalanDOMChar s_quoteEntityString[]; - static const XalanDOMString::size_type s_quoteEntityStringLength; + static const size_type s_quoteEntityStringLength; }; enum @@ -569,12 +569,12 @@ virtual void writeCharacters( const XMLCh* chars, - unsigned int length) = 0; + size_type length) = 0; virtual void writeCDATA( const XMLCh* chars, - unsigned int length) = 0; + size_type length) = 0; virtual void outputNewline() = 0; @@ -692,7 +692,7 @@ */ const XalanDOMString m_standalone; - const XalanDOMString m_encoding; + const XalanDOMString m_encoding; static bool isUTF16HighSurrogate(XalanDOMChar theChar) @@ -790,9 +790,9 @@ /** * The string "-//W3C//DTD XHTML". */ - static const XalanDOMChar s_xhtmlDocTypeString[]; + static const XalanDOMChar s_xhtmlDocTypeString[]; - static const XalanDOMString::size_type s_xhtmlDocTypeStringLength; + static const size_type s_xhtmlDocTypeStringLength; }; Index: src/xalanc/XMLSupport/FormatterToText.hpp =================================================================== --- src/xalanc/XMLSupport/FormatterToText.hpp (revision 706129) +++ src/xalanc/XMLSupport/FormatterToText.hpp (working copy) @@ -187,12 +187,12 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void charactersRaw( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void entityReference(const XMLCh* const name); @@ -200,7 +200,7 @@ virtual void ignorableWhitespace( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void processingInstruction( @@ -216,7 +216,7 @@ virtual void cdata( const XMLCh* const ch, - const unsigned int length); + const size_type length); private: Index: src/xalanc/XMLSupport/FormatterToXML.cpp =================================================================== --- src/xalanc/XMLSupport/FormatterToXML.cpp (revision 706129) +++ src/xalanc/XMLSupport/FormatterToXML.cpp (working copy) @@ -695,13 +695,13 @@ void FormatterToXML::accumNameArray( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar chars[], + size_type start, + size_type length) { - const XalanDOMString::size_type n = start + length; + const size_type n = start + length; - for(XalanDOMString::size_type i = start; i < n; ++i) + for(size_type i = start; i < n; ++i) { accumName(chars[i]); } @@ -711,13 +711,13 @@ void FormatterToXML::accumContentArray( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar chars[], + size_type start, + size_type length) { - const XalanDOMString::size_type n = start + length; + const size_type n = start + length; - for(XalanDOMString::size_type i = start; i < n; ++i) + for(size_type i = start; i < n; ++i) { accumContent(chars[i]); } @@ -727,13 +727,13 @@ void FormatterToXML::accumArrayUTF( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar chars[], + size_type start, + size_type length) { - const XalanDOMString::size_type n = start + length; + const size_type n = start + length; - for(XalanDOMString::size_type i = start; i < n; ++i) + for(size_type i = start; i < n; ++i) { accumCharUTF(chars[i]); } @@ -743,9 +743,9 @@ void FormatterToXML::accumArrayUTFDirect( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar chars[], + size_type start, + size_type length) { assert(m_maxCharacter >= 65535); assert(m_stream != 0); @@ -854,13 +854,13 @@ -XalanDOMString::size_type +FormatterToXML::size_type FormatterToXML::accumDefaultEscape( - XalanDOMChar ch, - XalanDOMString::size_type i, - const XalanDOMChar chars[], - XalanDOMString::size_type len, - bool escLF) + XalanDOMChar ch, + size_type i, + const XalanDOMChar chars[], + size_type len, + bool escLF) { if(!accumDefaultEntity(ch, escLF)) { @@ -1258,7 +1258,7 @@ void FormatterToXML::characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { if(length != 0) { @@ -1278,8 +1278,8 @@ m_ispreserve = true; - unsigned int i = 0; - unsigned int firstIndex = 0; + size_type i = 0; + size_type firstIndex = 0; while(i < length) { @@ -1318,7 +1318,7 @@ void FormatterToXML::charactersRaw( const XMLCh* const chars, - const unsigned int length) + const size_type length) { writeParentTagEnd(); @@ -1378,13 +1378,13 @@ void FormatterToXML::writeAttrString( - const XalanDOMChar* theString, - XalanDOMString::size_type theStringLength) + const XalanDOMChar* theString, + size_type theStringLength) { assert(theString != 0); - XalanDOMString::size_type i = 0; - XalanDOMString::size_type firstIndex = 0; + size_type i = 0; + size_type firstIndex = 0; while(i < theStringLength) { @@ -1423,14 +1423,14 @@ void FormatterToXML::writeNormalizedChars( - const XalanDOMChar ch[], - XalanDOMString::size_type start, - XalanDOMString::size_type length, - bool isCData) + const XalanDOMChar ch[], + size_type start, + size_type length, + bool isCData) { - XalanDOMString::size_type end = start + length; + size_type end = start + length; - for(XalanDOMString::size_type i = start; i < end; i++) + for(size_type i = start; i < end; ++i) { const XalanDOMChar c = ch[i]; @@ -1595,7 +1595,7 @@ void FormatterToXML::ignorableWhitespace( const XMLCh* const chars, - const unsigned int length) + const size_type length) { #if 1 // We need to do normalization, which is slower, @@ -1678,7 +1678,7 @@ void FormatterToXML::cdata( const XMLCh* const ch, - const unsigned int length) + const size_type length) { if(m_nextIsRaw == true) { @@ -1839,10 +1839,10 @@ void FormatterToXML::accumNormalizedPIData( - const XalanDOMChar* theData, - XalanDOMString::size_type theLength) + const XalanDOMChar* theData, + size_type theLength) { - for (XalanDOMString::size_type i = 0; i < theLength; ++i) + for (size_type i = 0; i < theLength; ++i) { accumContent(theData[i]); } Index: src/xalanc/XMLSupport/XalanUTF16Writer.hpp =================================================================== --- src/xalanc/XMLSupport/XalanUTF16Writer.hpp (revision 706129) +++ src/xalanc/XMLSupport/XalanUTF16Writer.hpp (working copy) @@ -56,10 +56,10 @@ size_type writeCDATAChar( - const XalanDOMChar chars[], - size_type start, - size_type /*length*/, - bool& /* outsideCDATA */) + const XalanDOMChar chars[], + size_type start, + size_type /*length*/, + bool& /* outsideCDATA */) { assert( chars != 0 ); @@ -69,28 +69,34 @@ } /** - * Writes name chars , if not presentable, throws + * Writes name chars, if not representable, throws */ - void writeNameChar(const XalanDOMChar* data, - size_type theLength) + void + writeNameChar( + const XalanDOMChar* data, + size_type theLength) { write(data, theLength); } /** - * Writes name chars , if not presentable, throws + * Writes name chars, if not representable, throws */ - void writePIChars(const XalanDOMChar* data, - size_type theLength) + void + writePIChars( + const XalanDOMChar* data, + size_type theLength) { write(data, theLength); } /** - * Writes name chars , if not presentable, throws + * Writes name chars, if not representable, throws */ - void writeCommentChars(const XalanDOMChar* data, - size_type theLength) + void + writeCommentChars( + const XalanDOMChar* data, + size_type theLength) { write(data, theLength); } Index: src/xalanc/XMLSupport/FormatterToXML.hpp =================================================================== --- src/xalanc/XMLSupport/FormatterToXML.hpp (revision 706129) +++ src/xalanc/XMLSupport/FormatterToXML.hpp (working copy) @@ -146,12 +146,12 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void charactersRaw( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void entityReference(const XMLCh* const name); @@ -159,7 +159,7 @@ virtual void ignorableWhitespace( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void processingInstruction( @@ -176,7 +176,7 @@ virtual void cdata( const XMLCh* const ch, - const unsigned int length); + const size_type length); virtual Writer* getWriter() const; @@ -294,8 +294,8 @@ typedef void (FormatterToXML::*AccumArrayFunctionType)( const XalanDOMChar[], - XalanDOMString::size_type, - XalanDOMString::size_type); + size_type, + size_type); typedef void (FormatterToXML::*FlushFunctionType)(); @@ -374,9 +374,9 @@ */ void accumName( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar chars[], + size_type start, + size_type length) { assert(m_accumNameArrayFunction != 0); @@ -392,9 +392,9 @@ */ void accumContent( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length) + const XalanDOMChar chars[], + size_type start, + size_type length) { assert(m_accumContentArrayFunction != 0); @@ -434,13 +434,13 @@ /** * Escape and accum a character. */ - XalanDOMString::size_type + size_type accumDefaultEscape( - XalanDOMChar ch, - XalanDOMString::size_type i, - const XalanDOMChar chars[], - XalanDOMString::size_type len, - bool escLF); + XalanDOMChar ch, + size_type i, + const XalanDOMChar chars[], + size_type len, + bool escLF); /** * Handle one of the default entities, return false if it @@ -513,10 +513,10 @@ */ virtual void writeNormalizedChars( - const XalanDOMChar ch[], - XalanDOMString::size_type start, - XalanDOMString::size_type length, - bool isCData); + const XalanDOMChar ch[], + size_type start, + size_type length, + bool isCData); /** * Write a number into the buffer as an entity @@ -534,8 +534,8 @@ */ virtual void writeAttrString( - const XalanDOMChar* theString, - XalanDOMString::size_type theStringLength); + const XalanDOMChar* theString, + size_type theStringLength); /** * Write the data for a comment @@ -853,9 +853,9 @@ */ void accumNameArray( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length); + const XalanDOMChar chars[], + size_type start, + size_type length); /** * Append an array of wide character to the buffer. @@ -868,9 +868,9 @@ */ void accumContentArray( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length); + const XalanDOMChar chars[], + size_type start, + size_type length); /** * Append an array of wide character to the buffer. @@ -883,9 +883,9 @@ */ void accumArrayUTF( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length); + const XalanDOMChar chars[], + size_type start, + size_type length); /** * Append an array of wide character to the output. @@ -898,9 +898,9 @@ */ void accumArrayUTFDirect( - const XalanDOMChar chars[], - XalanDOMString::size_type start, - XalanDOMString::size_type length); + const XalanDOMChar chars[], + size_type start, + size_type length); /** * Append a string to the buffer. @@ -974,8 +974,8 @@ */ void accumNormalizedPIData( - const XalanDOMChar* theData, - XalanDOMString::size_type theLength); + const XalanDOMChar* theData, + size_type theLength); // Data members... @@ -1018,7 +1018,7 @@ */ const XalanDOMString m_attrSpecialChars; - typedef XalanDOMString::size_type size_type; + //typedef XalanDOMString::size_type size_type; /** * The string " +XALAN_CPP_NAMESPACE_BEGIN + + + XERCES_CPP_NAMESPACE_USE @@ -210,6 +214,9 @@ }; -#endif //SAX2HANDLER_MSGCREATOR_1357924680 +XALAN_CPP_NAMESPACE_END + + +#endif //SAX2HANDLER_MSGCREATOR_1357924680 Index: src/xalanc/Utils/MsgCreator/MsgFileOutputStream.cpp =================================================================== --- src/xalanc/Utils/MsgCreator/MsgFileOutputStream.cpp (revision 706129) +++ src/xalanc/Utils/MsgCreator/MsgFileOutputStream.cpp (working copy) @@ -24,6 +24,9 @@ #include +XALAN_CPP_NAMESPACE_BEGIN + + static XalanFileOutputStream::HandleType openFile(const char* theFileName) { @@ -105,7 +108,7 @@ void XalanFileOutputStream::writeData( const char* theBuffer, - unsigned int theBufferLength) + XalanSize_t theBufferLength) { #if defined(WIN32) DWORD theBytesWritten; @@ -204,13 +207,13 @@ } -void XalanFileOutputStream::write(const UTF16Ch* theString, unsigned int theLength) +void XalanFileOutputStream::write(const UTF16Ch* theString, XalanSize_t theLength) { assert ( theString != 0 ); writeData((const char*)theString,theLength * sizeof(UTF16Ch) ); } -void XalanFileOutputStream::write(const char* theString, unsigned int theLength) +void XalanFileOutputStream::write(const char* theString, XalanSize_t theLength) { assert ( theString != 0 ); @@ -221,7 +224,7 @@ XMLString::release(&theUTFString); } -void XalanFileOutputStream::writeAsASCII(const UTF16Ch* theString, unsigned int theLengts) +void XalanFileOutputStream::writeAsASCII(const UTF16Ch* theString, XalanSize_t theLengts) { char* szString = XMLString::transcode(theString); writeData( szString, theLengts ); @@ -229,7 +232,7 @@ } -void XalanFileOutputStream::writeAsASCII(const char* theString, unsigned int theLengts) +void XalanFileOutputStream::writeAsASCII(const char* theString, XalanSize_t theLengts) { writeData( theString, theLengts ); } @@ -244,3 +247,7 @@ { write(s_UTF16ByteOrderMark,1); } + + + +XALAN_CPP_NAMESPACE_END Index: src/xalanc/Utils/MsgCreator/MsgFileOutputStream.hpp =================================================================== --- src/xalanc/Utils/MsgCreator/MsgFileOutputStream.hpp (revision 706129) +++ src/xalanc/Utils/MsgCreator/MsgFileOutputStream.hpp (working copy) @@ -20,6 +20,7 @@ #define XALANOUTPUTFILE_1357924680 #include +#include "xalanc/Include/PlatformDefinitions.hpp" #if defined(WIN32) @@ -32,10 +33,11 @@ -XERCES_CPP_NAMESPACE_USE +XALAN_CPP_NAMESPACE_BEGIN +XERCES_CPP_NAMESPACE_USE // Class responcible for printing into file with UTF16 @@ -111,15 +113,15 @@ void - write(const UTF16Ch* theString, unsigned int theLength); + write(const UTF16Ch* theString, XalanSize_t theLength); void - write(const char* theString, unsigned int theLength); + write(const char* theString, XalanSize_t theLength); void - writeAsASCII(const char* theString, unsigned int theLengts); + writeAsASCII(const char* theString, XalanSize_t theLengts); void - writeAsASCII(const UTF16Ch* theString, unsigned int theLengts); + writeAsASCII(const UTF16Ch* theString, XalanSize_t theLengts); void writeUTFprefix(); protected: @@ -127,7 +129,7 @@ void writeData( const char* theBuffer, - unsigned int theBufferLength); + XalanSize_t theBufferLength); void doFlush(); @@ -151,6 +153,7 @@ }; -#endif //XALANOUTPUTFILE_1357924680 +XALAN_CPP_NAMESPACE_END +#endif //XALANOUTPUTFILE_1357924680 Index: src/xalanc/Utils/MsgCreator/ICUResHandler.cpp =================================================================== --- src/xalanc/Utils/MsgCreator/ICUResHandler.cpp (revision 706129) +++ src/xalanc/Utils/MsgCreator/ICUResHandler.cpp (working copy) @@ -28,7 +28,10 @@ +XALAN_CPP_NAMESPACE_BEGIN + + // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- @@ -58,7 +61,7 @@ // change tham with \", \{ and \} void ICUResHandler::characters( const XMLCh* const chars - , const unsigned int length) + , const XalanSize_t length) { if ( m_startCollectingCharacters == true ) @@ -100,15 +103,15 @@ } -void ICUResHandler::endElement(const XMLCh* const , - const XMLCh* const localname, - const XMLCh* const ) +void ICUResHandler::endElement(const XMLCh* const /* uri */, + const XMLCh* const /* localname */, + const XMLCh* const qname) { if ( m_startCollectingCharacters == false) return; - if(!XMLString::compareString(localname,s_targetXMLCh)) + if(!XMLString::compareString(qname,s_targetXMLCh)) { m_startCollectingCharacters = false; @@ -122,13 +125,13 @@ const Attributes& attributes) { - if(!XMLString::compareString(localname,s_transUnitXMLCh)) + if(!XMLString::compareString(qname,s_transUnitXMLCh)) { // this is an elemente, SAX2Handler class is responsible to handle: // creating Index file, commom for all localization styles SAX2Handler::startElement(uri, localname, qname, attributes); } - else if(!XMLString::compareString(localname,s_targetXMLCh)) + else if(!XMLString::compareString(qname,s_targetXMLCh)) { if ( m_locale != 0 ) { @@ -196,4 +199,4 @@ } - +XALAN_CPP_NAMESPACE_END Index: src/xalanc/Utils/MsgCreator/NLSHandler.cpp =================================================================== --- src/xalanc/Utils/MsgCreator/NLSHandler.cpp (revision 706129) +++ src/xalanc/Utils/MsgCreator/NLSHandler.cpp (working copy) @@ -22,6 +22,11 @@ #include + +XALAN_CPP_NAMESPACE_BEGIN + + + // ----------------------------------------------------------------------- // Constructors // ----------------------------------------------------------------------- @@ -48,7 +53,7 @@ } void NLSHandler::characters( const XMLCh* const chars - , const unsigned int length) + , const XalanSize_t length) { if ( m_startCollectingCharacters == true ) @@ -128,3 +133,7 @@ m_fStream.writeAsASCII("^\n",2); } } + + + +XALAN_CPP_NAMESPACE_END Index: src/xalanc/Utils/MsgCreator/ICUResHandler.hpp =================================================================== --- src/xalanc/Utils/MsgCreator/ICUResHandler.hpp (revision 706129) +++ src/xalanc/Utils/MsgCreator/ICUResHandler.hpp (working copy) @@ -20,8 +20,15 @@ #include "SAX2Handler.hpp" + +XALAN_CPP_NAMESPACE_BEGIN + + + XERCES_CPP_NAMESPACE_USE + + class ICUResHandler : public SAX2Handler { public: @@ -84,5 +91,8 @@ operator==(const ICUResHandler&) const; }; + +XALAN_CPP_NAMESPACE_END + + #endif // ICURESHANDLER_MSGCREATOR_1357924680 - Index: src/xalanc/XalanDOM/XalanDOMString.hpp =================================================================== --- src/xalanc/XalanDOM/XalanDOMString.hpp (revision 706129) +++ src/xalanc/XalanDOM/XalanDOMString.hpp (working copy) @@ -50,7 +50,7 @@ typedef XalanDOMChar& reference; typedef const XalanDOMChar& const_reference; - typedef unsigned int size_type; + typedef XalanSize_t size_type; typedef XalanDOMCharVectorType::iterator iterator; typedef XalanDOMCharVectorType::const_iterator const_iterator; @@ -60,7 +60,7 @@ #if defined(XALAN_INLINE_INITIALIZATION) static const size_type npos = ~0u; #else - enum { npos = -1 }; + enum { npos = ~0u }; #endif XalanDOMString(MemoryManagerType& theManager XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR ); Index: src/xalanc/Harness/XalanDiagnosticMemoryManager.hpp =================================================================== --- src/xalanc/Harness/XalanDiagnosticMemoryManager.hpp (revision 706129) +++ src/xalanc/Harness/XalanDiagnosticMemoryManager.hpp (working copy) @@ -96,6 +96,9 @@ virtual void deallocate(void* pointer); + virtual MemoryManager* + getExceptionMemoryManager(); + bool getAssertErrors() const { Index: src/xalanc/Harness/XalanDiagnosticMemoryManager.cpp =================================================================== --- src/xalanc/Harness/XalanDiagnosticMemoryManager.cpp (revision 706129) +++ src/xalanc/Harness/XalanDiagnosticMemoryManager.cpp (working copy) @@ -157,6 +157,14 @@ +MemoryManager* +XalanDiagnosticMemoryManager::getExceptionMemoryManager() +{ + return &m_memoryManager; +} + + + void XalanDiagnosticMemoryManager::dumpStatistics( StreamType* theStream, Index: src/xalanc/XalanSourceTree/XalanSourceTreeContentHandler.hpp =================================================================== --- src/xalanc/XalanSourceTree/XalanSourceTreeContentHandler.hpp (revision 706129) +++ src/xalanc/XalanSourceTree/XalanSourceTreeContentHandler.hpp (working copy) @@ -74,7 +74,8 @@ public: typedef XalanVector ElementStackType; - typedef XalanVector LastChildStackType; + typedef XalanVector LastChildStackType; + typedef XalanSize_t size_type; enum { eDefaultStackSize = 50, eDefaultTextBufferSize = 100 }; @@ -94,7 +95,7 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void endDocument(); @@ -108,7 +109,7 @@ virtual void ignorableWhitespace( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void processingInstruction( @@ -165,7 +166,7 @@ virtual void comment( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void endCDATA(); @@ -225,8 +226,8 @@ void doCharacters( - const XMLCh* chars, - XalanDOMString::size_type length); + const XMLCh* chars, + size_type length); // Data members... Index: src/xalanc/XalanSourceTree/FormatterToSourceTree.cpp =================================================================== --- src/xalanc/XalanSourceTree/FormatterToSourceTree.cpp (revision 706129) +++ src/xalanc/XalanSourceTree/FormatterToSourceTree.cpp (working copy) @@ -259,7 +259,7 @@ void FormatterToSourceTree::characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { if (m_documentFragment != 0) { @@ -283,7 +283,7 @@ void FormatterToSourceTree::charactersRaw( const XMLCh* const chars, - const unsigned int length) + const size_type length) { assert(m_document != 0); @@ -306,7 +306,7 @@ void FormatterToSourceTree::ignorableWhitespace( const XMLCh* const chars, - const unsigned int length) + const size_type length) { assert(m_document != 0); @@ -381,7 +381,7 @@ void FormatterToSourceTree::cdata( const XMLCh* const /* ch */, - const unsigned int /* length */) + const size_type /* length */) { } @@ -402,8 +402,8 @@ void FormatterToSourceTree::doCharacters( - const XMLCh* chars, - XalanDOMString::size_type length) + const XMLCh* chars, + size_type length) { if (m_currentElement != 0) { Index: src/xalanc/XalanSourceTree/FormatterToSourceTree.hpp =================================================================== --- src/xalanc/XalanSourceTree/FormatterToSourceTree.hpp (revision 706129) +++ src/xalanc/XalanSourceTree/FormatterToSourceTree.hpp (working copy) @@ -141,7 +141,7 @@ virtual void charactersRaw( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void comment(const XMLCh* const data); @@ -149,7 +149,7 @@ virtual void cdata( const XMLCh* const ch, - const unsigned int length); + const size_type length); virtual void entityReference(const XMLCh* const name); @@ -174,12 +174,12 @@ virtual void characters( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void ignorableWhitespace( const XMLCh* const chars, - const unsigned int length); + const size_type length); virtual void processingInstruction( @@ -203,8 +203,8 @@ void doCharacters( - const XalanDOMChar* chars, - XalanDOMString::size_type length); + const XalanDOMChar* chars, + size_type length); void doProcessingInstruction( Index: src/xalanc/XalanSourceTree/XalanSourceTreeContentHandler.cpp =================================================================== --- src/xalanc/XalanSourceTree/XalanSourceTreeContentHandler.cpp (revision 706129) +++ src/xalanc/XalanSourceTree/XalanSourceTreeContentHandler.cpp (working copy) @@ -65,7 +65,7 @@ void XalanSourceTreeContentHandler::characters( const XMLCh* const chars, - const unsigned int length) + const size_type length) { assert(m_inDTD == false); @@ -194,7 +194,7 @@ void XalanSourceTreeContentHandler::ignorableWhitespace( const XMLCh* const chars, - const unsigned int length) + const size_type length) { assert(m_inDTD == false); @@ -370,7 +370,7 @@ void XalanSourceTreeContentHandler::comment( const XMLCh* const chars, - const unsigned int length) + const size_type length) { assert(m_document != 0); @@ -499,8 +499,8 @@ void XalanSourceTreeContentHandler::doCharacters( - const XMLCh* chars, - XalanDOMString::size_type length) + const XMLCh* chars, + size_type length) { assert(m_inDTD == false); Index: src/xalanc/DOMSupport/DOMSupportDefault.cpp =================================================================== --- src/xalanc/DOMSupport/DOMSupportDefault.cpp (revision 706129) +++ src/xalanc/DOMSupport/DOMSupportDefault.cpp (working copy) @@ -90,18 +90,14 @@ if (theNode != 0 && theNode->getNodeType() == XalanNode::ENTITY_NODE) { - const XalanEntity* theEntity = + const XalanEntity* const theEntity = #if defined(XALAN_OLD_STYLE_CASTS) (const XalanEntity*)theNode; #else static_cast(theNode); #endif - const XalanDOMString theNotationName( - theEntity->getNotationName(), - theMemoryManager); - - if(isEmpty(theNotationName) == false) // then it's unparsed + if(length(theEntity->getNotationName()) != 0) // then it's unparsed { // The draft says: "The XSLT processor may use the public // identifier to generate a URI for the entity instead of the URI @@ -114,7 +110,7 @@ // So I'm falling a bit short here. theURI = theEntity->getSystemId(); - if(isEmpty(theURI) == true) + if(theURI.length() == 0) { theURI = theEntity->getPublicId(); } Index: src/xalanc/DOMSupport/DOMServices.hpp =================================================================== --- src/xalanc/DOMSupport/DOMServices.hpp (revision 706129) +++ src/xalanc/DOMSupport/DOMServices.hpp (working copy) @@ -203,7 +203,7 @@ append(data, text.getData()); } - typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const unsigned int); + typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const, const FormatterListener::size_type); /** * Sends the data for a node to a FormatterListener Index: Tests/Conf/conf.cpp =================================================================== --- Tests/Conf/conf.cpp (revision 706129) +++ Tests/Conf/conf.cpp (working copy) @@ -207,7 +207,12 @@ XercesDOMParser theParser(0, &mgr); +#if XERCES_VERSION_MAJOR < 3 theParser.setDoValidation(true); +#else + theParser.setValidationScheme(XercesDOMParser::Val_Auto); +#endif + theParser.setDoNamespaces(true); theParser.parse(xmlInput); @@ -308,7 +313,9 @@ // const XalanDOMString& currentDir = dirs[j]; - if (length(h.args.sub) == 0 || equals(currentDir, h.args.sub) == true) + if ((length(h.args.sub) == 0 || + equals(currentDir, h.args.sub) == true) && + currentDir[0] != XalanUnicode::charFullStop) { // Check that output directory is there. // Index: samples/SimpleTransform/XalanMemoryManagerImpl.hpp =================================================================== --- samples/SimpleTransform/XalanMemoryManagerImpl.hpp (revision 706129) +++ samples/SimpleTransform/XalanMemoryManagerImpl.hpp (working copy) @@ -96,7 +96,13 @@ } - virtual + MemoryManager* + getExceptionMemoryManager() + { + return this; + } + + virtual ~XalanMemoryManagerImpl() { if( 0 == HeapDestroy(m_heapHandle) )