diff --git a/Projects/Win32/Unsupported/IntVC6/CoreTests/CoreTests.dsp b/Projects/Win32/Unsupported/IntVC6/CoreTests/CoreTests.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..d85531d8fcc8dbbb63e8dacf132746f46f552834
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/CoreTests/CoreTests.dsp
@@ -0,0 +1,152 @@
+# Microsoft Developer Studio Project File - Name="CoreTests" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=CoreTests - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "CoreTests.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "CoreTests.mak" CFG="CoreTests - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "CoreTests - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "CoreTests - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "CoreTests - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib /nologo /version:2.4 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "CoreTests - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib /nologo /version:2.4 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "CoreTests - Win32 Release"
+# Name "CoreTests - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_BitSet.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_CountedPointer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_RefArray.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_RefHashTable.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_RefStack.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_RefVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_String.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_Transcoders.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_URL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_ValueArray.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_ValueStack.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests_ValueVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTestsMain.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\UtilTests\CoreTests.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/DOM/DOM.dsp b/Projects/Win32/Unsupported/IntVC6/DOM/DOM.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..0769e8f813f19a5822350cc0a21592b4177226f4
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/DOM/DOM.dsp
@@ -0,0 +1,489 @@
+# Microsoft Developer Studio Project File - Name="DOM" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=DOM - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DOM.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DOM.mak" CFG="DOM - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DOM - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "DOM - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "DOM - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release\"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\DOM" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "PROJ_DOM" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib /nologo /base:"0x15000000" /version:3.0 /dll /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Release\IXDOM.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "DOM - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /YX /FD /GZ  /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\DOM" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "PROJ_DOM" /FD /GZ  /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib /nologo /base:"0x15000000" /version:3.0 /dll /debug /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Debug/IXDOM.dll" /pdbtype:sept /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "DOM - Win32 Release"
+# Name "DOM - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\AttrImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\CDATASectionImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\CharacterDataImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\CommentImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DeepNodeListImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DocumentFragmentImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DocumentImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DocumentTypeImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Attr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_CDATASection.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_CharacterData.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Comment.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Document.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DocumentFragment.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DocumentType.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DOMException.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DOMImplementation.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Element.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Entity.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_EntityReference.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NamedNodeMap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Node.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NodeFilter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NodeIterator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NodeList.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Notation.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_ProcessingInstruction.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Text.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_TreeWalker.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DomMemDebug.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOMString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DStringPool.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\ElementDefinitionImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\ElementImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\EntityImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\EntityReferenceImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NamedNodeMapImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeFilterImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeIteratorImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeListImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NotationImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\ProcessingInstructionImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\RefCountedImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\TextImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\TreeWalkerImpl.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\AttrImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\CDATASectionImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\CharacterDataImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\CommentImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DeepNodeListImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DocumentFragmentImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DocumentImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DocumentTypeImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Attr.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_CDATASection.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_CharacterData.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Comment.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Document.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DocumentFragment.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DocumentType.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DOMException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_DOMImplementation.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Element.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Entity.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_EntityReference.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NamedNodeMap.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Node.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NodeFilter.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NodeIterator.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_NodeList.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Notation.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_ProcessingInstruction.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_Text.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOM_TreeWalker.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DomMemDebug.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DOMString.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DStringPool.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\ElementDefinitionImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\ElementImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\EntityImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\EntityReferenceImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\MemDebug.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NamedNodeMapImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NameNodeFilter.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeFilterImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeIteratorImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeListImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NodeVector.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\NotationImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\ProcessingInstructionImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\RefCountedImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\TextImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\TreeWalkerImpl.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/DOMCount/DOMCount.dsp b/Projects/Win32/Unsupported/IntVC6/DOMCount/DOMCount.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..51f5e4548ff51256939dbe06bd47915d20a454b6
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/DOMCount/DOMCount.dsp
@@ -0,0 +1,104 @@
+# Microsoft Developer Studio Project File - Name="DOMCount" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=DOMCount - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMCount.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMCount.mak" CFG="DOMCount - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DOMCount - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "DOMCount - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "DOMCount - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release\"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\dom" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib IXDOM.lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "DOMCount - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\dom" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib IXDOM.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "DOMCount - Win32 Release"
+# Name "DOMCount - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\DOMCount\DOMCount.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\DOMCount\DOMCount.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/DOMPrint/DOMPrint.dsp b/Projects/Win32/Unsupported/IntVC6/DOMPrint/DOMPrint.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..a721dedce41ba551007e713a725fb47d35633d23
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/DOMPrint/DOMPrint.dsp
@@ -0,0 +1,109 @@
+# Microsoft Developer Studio Project File - Name="DOMPrint" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=DOMPrint - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMPrint.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMPrint.mak" CFG="DOMPrint - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DOMPrint - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "DOMPrint - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "DOMPrint - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release\"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\dom" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib IXDOM.lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "DOMPrint - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\dom" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib IXDOM.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "DOMPrint - Win32 Release"
+# Name "DOMPrint - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\DOMPrint\DOMPrint.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\DOMPrint\DOMTreeErrorReporter.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\DOMPrint\DOMTreeErrorReporter.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/DOMTest/DOMTest.dsp b/Projects/Win32/Unsupported/IntVC6/DOMTest/DOMTest.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..10a7c747a4b8c7843c782fc6d1cbcd5c0e567134
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/DOMTest/DOMTest.dsp
@@ -0,0 +1,108 @@
+# Microsoft Developer Studio Project File - Name="DOMTest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=DOMTest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMTest.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMTest.mak" CFG="DOMTest - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DOMTest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "DOMTest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "DOMTest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\DOM" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXDom.lib IXUtil.lib icuuc.lib /nologo /version:2.4 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release" /libpath:"\ICU\Lib\Release"
+
+!ELSEIF  "$(CFG)" == "DOMTest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /I "..\..\..\..\..\src\DOM" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXDom.lib IXUtil.lib icuuc.lib /nologo /version:2.4 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug" /libpath:"\ICU\Lib\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "DOMTest - Win32 Release"
+# Name "DOMTest - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DomTest\DTest.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\dom\DomTest\DTest.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/EnumVal/EnumVal.dsp b/Projects/Win32/Unsupported/IntVC6/EnumVal/EnumVal.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..f3a833058505cbfb19d927f53539d9b67a3bfaf4
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/EnumVal/EnumVal.dsp
@@ -0,0 +1,97 @@
+# Microsoft Developer Studio Project File - Name="EnumVal" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=EnumVal - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "EnumVal.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "EnumVal.mak" CFG="EnumVal - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "EnumVal - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "EnumVal - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "EnumVal - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib IXVal.Lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ELSEIF  "$(CFG)" == "EnumVal - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib IXVal.Lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "EnumVal - Win32 Release"
+# Name "EnumVal - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\EnumVal\EnumVal.cpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/MemParse/MemParse.dsp b/Projects/Win32/Unsupported/IntVC6/MemParse/MemParse.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..bfcb76d1e64fdfee27b53bc3e95e196cc2c23c4d
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/MemParse/MemParse.dsp
@@ -0,0 +1,112 @@
+# Microsoft Developer Studio Project File - Name="MemParse" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=MemParse - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "MemParse.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "MemParse.mak" CFG="MemParse - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "MemParse - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "MemParse - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "MemParse - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "MemParse - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G5 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "MemParse - Win32 Release"
+# Name "MemParse - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\MemParse\MemParse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\MemParse\MemParseHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\MemParse\MemParse.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\MemParse\MemParseHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/NLSXlat/NLSXlat.dsp b/Projects/Win32/Unsupported/IntVC6/NLSXlat/NLSXlat.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..7d3ed50679359c57f7b8bd8d2f6893ae62691588
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/NLSXlat/NLSXlat.dsp
@@ -0,0 +1,140 @@
+# Microsoft Developer Studio Project File - Name="NLSXlat" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=NLSXlat - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "NLSXlat.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "NLSXlat.mak" CFG="NLSXlat - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "NLSXlat - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "NLSXlat - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "NLSXlat - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release\"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /I "\ICU\Include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXDom.lib IXUtil.lib IXPar.lib IXSAX.lib icuuc.lib /nologo /version:3.0 /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release" /libpath:"\ICU\Lib\Release"
+
+!ELSEIF  "$(CFG)" == "NLSXlat - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /GX /Zi /Od /I "..\..\..\..\..\src" /I "\ICU\Include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXDom.lib IXUtil.lib IXPar.lib IXSAX.lib icuuc.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug" /libpath:"\ICU\Lib\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "NLSXlat - Win32 Release"
+# Name "NLSXlat - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_CppSrc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_MsgCatalog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_Win32RC.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_CppSrc.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_ErrHandler.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_Formatter.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_MsgCatalog.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_Types.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\Tools\NLS\Xlat\Xlat_Win32RC.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/PParse/PParse.dsp b/Projects/Win32/Unsupported/IntVC6/PParse/PParse.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..ff6b1b2834250819aa7f714c1331b3c277120e1b
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/PParse/PParse.dsp
@@ -0,0 +1,113 @@
+# Microsoft Developer Studio Project File - Name="PParse" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=PParse - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "PParse.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "PParse.mak" CFG="PParse - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "PParse - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "PParse - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "PParse - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:2.4 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ELSEIF  "$(CFG)" == "PParse - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:2.4 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "PParse - Win32 Release"
+# Name "PParse - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\PParse\PParse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\PParse\PParseHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\PParse\PParse.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\PParse\PParseHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/ParserTest/ParserTest.dsp b/Projects/Win32/Unsupported/IntVC6/ParserTest/ParserTest.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..0b1dcf68374805b96011070ac159990ceb57fe55
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/ParserTest/ParserTest.dsp
@@ -0,0 +1,116 @@
+# Microsoft Developer Studio Project File - Name="ParserTest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ParserTest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "ParserTest.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "ParserTest.mak" CFG="ParserTest - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "ParserTest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "ParserTest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "ParserTest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "PROJ_PARSERTEST" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXCore.Lib IXVal.Lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "ParserTest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "PROJ_PARSERTEST" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXCore.Lib IXVal.Lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "ParserTest - Win32 Release"
+# Name "ParserTest - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\ParserTest\ParserTest.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\ParserTest\ParserTest_Parser.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\ParserTest\ParserTest.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\tests\ParserTest\ParserTest_Parser.hpp
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/Parsers/Parsers.dsp b/Projects/Win32/Unsupported/IntVC6/Parsers/Parsers.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..00107e2db374ecce0ae71a89ce76278ef54492a8
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/Parsers/Parsers.dsp
@@ -0,0 +1,119 @@
+# Microsoft Developer Studio Project File - Name="Parsers" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=Parsers - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Parsers.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Parsers.mak" CFG="Parsers - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Parsers - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "Parsers - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Parsers - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PARSERS_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "PROJ_PARSERS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXDOM.lib /nologo /base:"0x14000000" /version:3.0 /dll /map /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Release/IXPar.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+# SUBTRACT LINK32 /profile
+
+!ELSEIF  "$(CFG)" == "Parsers - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PARSERS_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "PROJ_PARSERS" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXDOM.lib /nologo /base:"0x14000000" /version:3.0 /dll /debug /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Debug/IXPar.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Parsers - Win32 Release"
+# Name "Parsers - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\parsers\DOMParser.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\parsers\SAXParser.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\parsers\DOMParser.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\parsers\SAXParser.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/Redirect/Redirect.dsp b/Projects/Win32/Unsupported/IntVC6/Redirect/Redirect.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..16851d2d5d134eb26b482278d631f35b2f8bb9c3
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/Redirect/Redirect.dsp
@@ -0,0 +1,112 @@
+# Microsoft Developer Studio Project File - Name="Redirect" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Redirect - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Redirect.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Redirect.mak" CFG="Redirect - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Redirect - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Redirect - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Redirect - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "Redirect - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Redirect - Win32 Release"
+# Name "Redirect - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\Redirect\Redirect.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\Redirect\RedirectHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\Redirect\Redirect.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\Redirect\RedirectHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/SAX4C/SAX4C.dsp b/Projects/Win32/Unsupported/IntVC6/SAX4C/SAX4C.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..0a28f11cb468f37000fd53ee08474766c125b61e
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/SAX4C/SAX4C.dsp
@@ -0,0 +1,159 @@
+# Microsoft Developer Studio Project File - Name="SAX4C" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=SAX4C - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SAX4C.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SAX4C.mak" CFG="SAX4C - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SAX4C - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "SAX4C - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "SAX4C - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SAX4C_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_SAX4C" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib /nologo /base:"0x13000000" /version:3.0 /dll /map /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Release/IXSAX.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+# SUBTRACT LINK32 /profile
+
+!ELSEIF  "$(CFG)" == "SAX4C - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SAX4C_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_SAX4C" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib /nologo /base:"0x13000000" /version:3.0 /dll /debug /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Debug/IXSAX.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "SAX4C - Win32 Release"
+# Name "SAX4C - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\Dummy.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\InputSource.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\SAXParseException.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\AttributeList.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\DocumentHandler.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\DTDHandler.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\EntityResolver.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\ErrorHandler.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\HandlerBase.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\InputSource.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\Locator.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\Parser.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\SAXException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\sax\SAXParseException.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/SAXCount/SAXCount.dsp b/Projects/Win32/Unsupported/IntVC6/SAXCount/SAXCount.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..6c2180f6eeaa3c58beeffcf453cb04a7cbf74fe6
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/SAXCount/SAXCount.dsp
@@ -0,0 +1,113 @@
+# Microsoft Developer Studio Project File - Name="SAXCount" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SAXCount - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXCount.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXCount.mak" CFG="SAXCount - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SAXCount - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "SAXCount - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "SAXCount - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ELSEIF  "$(CFG)" == "SAXCount - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "SAXCount - Win32 Release"
+# Name "SAXCount - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXCount\SAXCount.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXCount\SAXCountHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXCount\SAXCount.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXCount\SAXCountHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/SAXPrint/SAXPrint.dsp b/Projects/Win32/Unsupported/IntVC6/SAXPrint/SAXPrint.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..85874841556f20cf300b2e8a095e1b19ac5a066e
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/SAXPrint/SAXPrint.dsp
@@ -0,0 +1,112 @@
+# Microsoft Developer Studio Project File - Name="SAXPrint" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SAXPrint - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXPrint.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXPrint.mak" CFG="SAXPrint - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SAXPrint - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "SAXPrint - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "SAXPrint - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+
+!ELSEIF  "$(CFG)" == "SAXPrint - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "SAXPrint - Win32 Release"
+# Name "SAXPrint - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXPrint\SAXPrint.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXPrint\SAXPrintHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXPrint\SAXPrint.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\SAXPrint\SAXPrintHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/StdInParse/StdInParse.dsp b/Projects/Win32/Unsupported/IntVC6/StdInParse/StdInParse.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..0ce9ab7678904086235099bb53dc7d9a88999706
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/StdInParse/StdInParse.dsp
@@ -0,0 +1,113 @@
+# Microsoft Developer Studio Project File - Name="StdInParse" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=StdInParse - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "StdInParse.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "StdInParse.mak" CFG="StdInParse - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "StdInParse - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "StdInParse - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "StdInParse - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:2.4 /subsystem:console /map /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+# SUBTRACT LINK32 /profile /pdb:none
+
+!ELSEIF  "$(CFG)" == "StdInParse - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXSAX.Lib IXCore.Lib IXPar.Lib /nologo /version:2.4 /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "StdInParse - Win32 Release"
+# Name "StdInParse - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\StdInParse\StdInParse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\StdInParse\StdInParseHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\StdInParse\StdInParse.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\samples\StdInParse\StdInParseHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/Validators/Validators.dsp b/Projects/Win32/Unsupported/IntVC6/Validators/Validators.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..4f73b370078a209b8aab7b134439a03c49793a31
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/Validators/Validators.dsp
@@ -0,0 +1,207 @@
+# Microsoft Developer Studio Project File - Name="Validators" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=Validators - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Validators.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Validators.mak" CFG="Validators - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Validators - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "Validators - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Validators - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release\"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj\"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VALIDATORS_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_VALIDATORS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXCore.Lib IXSAX.Lib /nologo /base:"0x12000000" /version:3.0 /dll /map /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Release\IXVal.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Release"
+# SUBTRACT LINK32 /profile
+
+!ELSEIF  "$(CFG)" == "Validators - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj\"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VALIDATORS_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_VALIDATORS" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib IXCore.Lib IXSAX.Lib /nologo /base:"0x12000000" /version:3.0 /dll /debug /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Debug\IXVal.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug" /libpath:"\ICU\Lib\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Validators - Win32 Release"
+# Name "Validators - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\CMBinaryOp.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\CMUnaryOp.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\ContentSpecNode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DFAContentModel.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDAttDef.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDAttDefList.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDElementDecl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDValidator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDValidator2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\MixedContentModel.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\SimpleContentModel.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\CMBinaryOp.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\CMLeaf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\CMNode.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\CMStateSet.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\CMUnaryOp.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\ContentSpecNode.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DFAContentModel.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DocTypeHandler.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDAttDef.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDAttDefList.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDElementDecl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDEntityDecl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\DTDValidator.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\MixedContentModel.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\validators\DTD\SimpleContentModel.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/XML4C3.dsw b/Projects/Win32/Unsupported/IntVC6/XML4C3.dsw
new file mode 100644
index 0000000000000000000000000000000000000000..1243a0329b27bfcce47c83700756062813857d05
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/XML4C3.dsw
@@ -0,0 +1,326 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "CoreTests"=".\CoreTests\CoreTests.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name XMLUtil
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "DOM"=".\DOM\DOM.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name XMLUtil
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name XML4CParser
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name SAX4C
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "DOMCount"=".\DOMCount\DOMCount.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "DOMPrint"=".\DOMPrint\DOMPrint.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "EnumVal"=".\EnumVal\EnumVal.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "MemParse"=".\MemParse\MemParse.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "NLSXlat"=".\NLSXlat\NLSXlat.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "PParse"=".\PParse\PParse.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ParserTest"=".\ParserTest\ParserTest.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name SAX4C
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name XML4CParser
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name XMLUtil
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name Validators
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "Parsers"=".\Parsers\Parsers.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name SAX4C
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name XML4CParser
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name XMLUtil
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name Validators
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name DOM
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "Redirect"=".\Redirect\Redirect.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "SAX4C"=".\SAX4C\SAX4C.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name XMLUtil
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "SAXCount"=".\SAXCount\SAXCount.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name SAX4C
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "SAXPrint"=".\SAXPrint\SAXPrint.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name SAX4C
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "StdInParse"=".\StdInParse\StdInParse.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name Parsers
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "Validators"=".\Validators\Validators.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name XML4CParser
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name XMLUtil
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "XML4CParser"=".\XML4CParser\XML4CParser.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name SAX4C
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name XMLUtil
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "XMLUtil"=".\XMLUtil\XMLUtil.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name convert
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Projects/Win32/Unsupported/IntVC6/XML4CParser/XML4CParser.dsp b/Projects/Win32/Unsupported/IntVC6/XML4CParser/XML4CParser.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..007609c1ab277f2c5d1d671537d38788618394ec
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/XML4CParser/XML4CParser.dsp
@@ -0,0 +1,299 @@
+# Microsoft Developer Studio Project File - Name="XML4CParser" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=XML4CParser - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "XML4CParser.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "XML4CParser.mak" CFG="XML4CParser - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "XML4CParser - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "XML4CParser - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "XML4CParser - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XML4CPARSER_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_XMLPARSER" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib /nologo /base:"0x11000000" /version:3.0 /dll /map /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Release/IXCore.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Release" /libpath:"\ICU\Lib\Release"
+# SUBTRACT LINK32 /profile
+
+!ELSEIF  "$(CFG)" == "XML4CParser - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XML4CPARSER_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_XMLPARSER" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXUtil.Lib /nologo /base:"0x11000000" /version:3.0 /dll /debug /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Debug/IXCore.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug" /libpath:"\ICU\Lib\Debug"
+# SUBTRACT LINK32 /profile /map
+
+!ENDIF 
+
+# Begin Target
+
+# Name "XML4CParser - Win32 Release"
+# Name "XML4CParser - Win32 Debug"
+# Begin Group "Framework Source Files"
+
+# PROP Default_Filter "cpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLAttDef.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLAttr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLBufferMgr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLContentModel.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLElementDecl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLEntityDecl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLNotationDecl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLRecognizer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLValidator.cpp
+# End Source File
+# End Group
+# Begin Group "Framework Header Files"
+
+# PROP Default_Filter "hpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLAttDef.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLAttDefList.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLAttr.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLBuffer.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLBufferMgr.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLContentModel.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLDocumentHandler.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLElementDecl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLEntityDecl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLEntityHandler.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLErrorCodes.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLErrorReporter.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLNotationDecl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLPScanToken.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLRecognizer.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLRefInfo.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLValidator.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\framework\XMLValidityCodes.hpp
+# End Source File
+# End Group
+# Begin Group "Internal Source Files"
+
+# PROP Default_Filter "cpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\ElemStack.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\MemBufInputSource.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\ReaderMgr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\StdInInputSource.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\URLInputSource.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\VecAttrListImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\XMLReader.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\XMLScanner.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\XMLScanner2.cpp
+# End Source File
+# End Group
+# Begin Group "Internal Header Files"
+
+# PROP Default_Filter "hpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\CharTypeTables.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\ElemStack.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\EndOfEntityException.Hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\MemBufInputSource.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\ReaderMgr.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\StdInInputSource.Hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\URLInputSource.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\VecAttrListImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\XMLReader.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\internal\XMLScanner.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/Unsupported/IntVC6/XMLUtil/XMLUtil.dsp b/Projects/Win32/Unsupported/IntVC6/XMLUtil/XMLUtil.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..b0501efeb99d50d538db7bf030b7bd2979de2ad4
--- /dev/null
+++ b/Projects/Win32/Unsupported/IntVC6/XMLUtil/XMLUtil.dsp
@@ -0,0 +1,422 @@
+# Microsoft Developer Studio Project File - Name="XMLUtil" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=XMLUtil - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "XMLUtil.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "XMLUtil.mak" CFG="XMLUtil - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "XMLUtil - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "XMLUtil - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "XMLUtil - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Release"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Release\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLUTIL_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /Za /W3 /GX /O2 /Ob2 /I "..\..\..\..\..\src" /I "\icu\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_XMLUTIL" /D "XML_USE_ICU_TRANSCODER" /D "XML_USE_WIN32_MSGLOADER" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib icuuc.lib /nologo /base:"0x10000000" /version:3.0 /dll /map /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Release/IXUtil.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Release" /libpath:"\ICU\Lib\Release"
+# SUBTRACT LINK32 /profile
+
+!ELSEIF  "$(CFG)" == "XMLUtil - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\Build\Win32\VC6\Debug"
+# PROP Intermediate_Dir "..\..\..\..\..\Build\Win32\VC6\Debug\Obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLUTIL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MDd /Za /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\src" /I "\icu\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "PROJ_XMLUTIL" /D "XML_USE_ICU_TRANSCODER" /D "XML_USE_INMEMORY_MSGLOADER" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib icuuc.lib /nologo /base:"0x10000000" /version:3.0 /dll /debug /machine:I386 /out:"..\..\..\..\..\Build\Win32\VC6\Debug/IXUtil.dll" /libpath:"..\..\..\..\..\Build\Win32\VC6\Debug" /libpath:"\ICU\Lib\Debug"
+# SUBTRACT LINK32 /profile
+
+!ENDIF 
+
+# Begin Target
+
+# Name "XMLUtil - Win32 Release"
+# Name "XMLUtil - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BinFileInputStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BinInputStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BinMemInputStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BitSet.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\HeaderDummy.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\KVStringPair.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Mutexes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\PlatformUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\StdOut.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\StringPool.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\TextOutputStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\URL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Platforms\Win32\Win32PlatformUtils.cpp
+# ADD CPP /Ze
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLException.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLUni.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\ArrayIndexOutOfBoundsException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\AutoSense.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BinFileInputStream.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BinInputStream.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BinMemInputStream.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BitOps.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\BitSet.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\CountedPointer.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\EmptyStackException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\FlagJanitor.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\IllegalArgumentException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\InvalidCastException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\IOException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Janitor.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\KeyValuePair.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\KVStringPair.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Mutexes.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\NameIdPool.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\NoSuchElementException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\NullPointerException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\PlatformUtils.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\RefArrayOf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\RefHashTableOf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\RefStackOf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\RefVectorOf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\RuntimeException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\StdOut.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\StringPool.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\TextOutputStream.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\TranscodingException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\TransService.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\UnexpectedEOFException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\UnsupportedEncodingException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\URL.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\UTFDataFormatException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\ValueArrayOf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\ValueStackOf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\ValueVectorOf.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Compilers\VCPPDefs.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Platforms\Win32\Win32Defs.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XML4CDefs.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLEnumerator.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLException.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLExceptMsgs.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLMsgLoader.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLNetAccessor.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLString.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\XMLUni.hpp
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Platforms\Win32\Version.rc
+# End Source File
+# End Group
+# Begin Group "Transcoder Header Files"
+
+# PROP Default_Filter "hpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Transcoders\ICU\ICUTransService.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Transcoders\Win32\Win32TransService.hpp
+# End Source File
+# End Group
+# Begin Group "Transcoder Source Files"
+
+# PROP Default_Filter "cpp; c"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Transcoders\ICU\ICUTransService.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\Transcoders\Win32\Win32TransService.cpp
+# ADD CPP /Ze
+# End Source File
+# End Group
+# Begin Group "MsgLoader Header Files"
+
+# PROP Default_Filter "Hpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\MsgLoaders\InMemory\CppErrMsgs_EN_US.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\MsgLoaders\InMemory\InMemMsgLoader.Hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\MsgLoaders\Win32\Win32MsgLoader.Hpp
+# End Source File
+# End Group
+# Begin Group "MsgLoader Source Files"
+
+# PROP Default_Filter "cpp; c"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\MsgLoaders\InMemory\InMemMsgLoader.Cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\util\MsgLoaders\Win32\Win32MsgLoader.Cpp
+# ADD CPP /Ze
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Projects/Win32/VACPP40/XML4C2X.icc b/Projects/Win32/VACPP40/XML4C2X.icc
new file mode 100644
index 0000000000000000000000000000000000000000..54c920e6a2e5b511c3096c0001e74fcd79585c29
--- /dev/null
+++ b/Projects/Win32/VACPP40/XML4C2X.icc
@@ -0,0 +1,121 @@
+option ProjectOptions = link(libsearchpath, "..\\..\\..\\..\\icu\\bin\\debug")
+{
+   option  incl(searchpath, "..\\..\\..\\..\\icu\\source\\common"),
+   incl(searchpath, "..\\..\\..\\src\\com\\ibm\\xml"), incl(searchpath, "..\\..\\..\\src"),
+   link(subsystem, "windows"),link(winmain, "yes"),
+   macros(global, "yes"), macros(redefine, "yes")
+   {
+      target "..\\..\\..\\Build\\Win32\\VACPP40\\XML4C2XX.dll"
+      {
+         source "..\\..\\..\\..\\icu\\bin\\debug\\icuuc.lib"
+         source type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\AttrImpl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\CDATASectionImpl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\CharacterDataImpl.cpp"
+         source  type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\CommentImpl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOMString.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Attr.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_CDATASection.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_CharacterData.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Comment.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_DOMException.cpp"
+         source  type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_DOMImplementation.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Document.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_DocumentFragment.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_DocumentType.cpp"
+
+         source    type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Element.cpp"
+         source    type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Entity.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_EntityReference.cpp"
+         source     type(cpp)   "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_NamedNodeMap.cpp"
+         source   type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Node.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_NodeList.cpp"
+         source     type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Notation.cpp"
+         source
+                 type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_ProcessingInstruction.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DOM_Text.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DStringPool.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DeepNodeListImpl.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DocumentFragmentImpl.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DocumentImpl.cpp"
+         source   type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DocumentTypeImpl.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\DomMemDebug.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\ElementDefinitionImpl.cpp"
+         source   type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\ElementImpl.cpp"
+         source    type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\EntityImpl.cpp"
+         source    type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\EntityReferenceImpl.cpp"
+         source     type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\NamedNodeMapImpl.cpp"
+         source   type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\NodeImpl.cpp"
+         source   type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\NodeListImpl.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\NodeVector.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\NotationImpl.cpp"
+         source
+                type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\dom\\ProcessingInstructionImpl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\RefCountedImpl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\dom\\TextImpl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\framework\\AttDef.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\framework\\Attr.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\framework\\ContentSpecNode.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\framework\\ElementDecl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\framework\\EntityDecl.cpp"
+         source
+                 type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\framework\\XMLValidationHandler.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\CMBinaryOp.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\CMUnaryOp.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\DFAContentModel.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\DefaultValidator.cpp"
+         source  type(cpp)  "..\\..\\..\\src\\com\\ibm\\xml\\internal\\ElemStack.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\MemBufInputSource.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\MixedContentModel.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\MsgLoader.cpp"
+         source   type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\NameBasedPool.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\ReaderMgr.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\SimpleContentModel.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\StdInInputSource.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\URLInputSource.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\VecAttrListImpl.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\XMLBufferMgr.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\XMLReader.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\XMLRecognizer.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\XMLScanner.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\XMLScanner2.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\internal\\XMLScanner3.cpp"
+         source
+                 type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\parsers\\NonValidatingDOMParser.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\parsers\\NonValidatingParser.cpp"
+         source
+                 type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\parsers\\NonValidatingSAXParser.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\parsers\\ValidatingDOMParser.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\parsers\\ValidatingSAXParser.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\BinFileInputStream.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\BinInputStream.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\BinMemInputStream.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\BitSet.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\CSetDefs.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\CountedPointer.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\Exception.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\FlagJanitor.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\HeaderDummy.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\Janitor.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\KeyValuePair.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\Mutexes.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\RefArrayOf.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\RefHashTableOf.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\RefStackOf.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\RefVectorOf.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\StdOut.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\String.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\TextOutputStream.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\URL.cpp"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\ValueArrayOf.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\ValueStackOf.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\ValueVectorOf.c"
+         source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\XMLUni.cpp"
+       source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\PlatformUtils.cpp"
+       source  type(cpp) "..\\..\\..\\src\\com\\ibm\\xml\\util\\Win32PlatformUtils.cpp"
+       source type("cpp") "..\\..\\..\\src\\sax\\Dummy.cpp",
+              "..\\..\\..\\src\\sax\\InputSource.cpp",
+              "..\\..\\..\\src\\sax\\SAXParseException.cpp"
+       source type("cpp") "..\\..\\..\\src\\sax\\helper\\ParserFactory.cpp"
+      }
+   }
+}
diff --git a/doc/blueb.gif b/doc/blueb.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e9bfd77a08646131105f6c3714995579e90acca9
Binary files /dev/null and b/doc/blueb.gif differ
diff --git a/doc/tail.html b/doc/tail.html
new file mode 100644
index 0000000000000000000000000000000000000000..ced18b5261877838f9579ebc1791da29662da0ac
--- /dev/null
+++ b/doc/tail.html
@@ -0,0 +1,16 @@
+<CENTER>
+<P>
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%">
+	<TR>
+		<TD WIDTH="50%" VALIGN="TOP"><B>XML Parser for C++ 2.0</B><BR>
+			Copyright &copy; IBM Corp, 1999<BR>
+			Center for Java Technology<BR>
+			10275 N. De Anza Blvd.<BR>
+			Cupertino CA 95014 USA<BR>
+			Email: <A HREF="mailto:xml4c@us.ibm.com">xml4c@us.ibm.com</A></TD>
+		<TD WIDTH="50%">
+			<P ALIGN="RIGHT"><IMG SRC="IBMLogo.gif" ALIGN="BOTTOM" ALT="IBM Logo" BORDER="0">
+		</TD>
+	</TR>
+</TABLE>
+</CENTER>
diff --git a/obj/Makefile.in b/obj/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..67d9f67b1c342d628835f0600dae3c1693dd6bb2
--- /dev/null
+++ b/obj/Makefile.in
@@ -0,0 +1,174 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:10:49  twl
+# Initial revision
+#
+# Revision 1.2  1999/11/08 20:43:14  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+PREFIX = @prefix@
+
+include ../src/Makefile.incl
+
+LIB=${XML4CROOT}/lib
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET = "//'${LOADMOD}(XML4C30)'"
+endif
+LIBNAME=libIXXML4C
+THISLIB=${LIB}/${LIBNAME}
+VER=3_0
+
+ALL_OBJECTS_DIR=${XML4CROOT}/obj
+ALL_OBJECTS=$(wildcard $(ALL_OBJECTS_DIR)/*.o)
+
+#######################################################
+#  HP-UX with CC compiler is awkward since it does    #
+#  not instantiate templates automatically. To do so  #
+#  you need to invoke the linker. So, just for this   #
+#  compiler, we try to create a dummy executable      #
+#  before we create the shared library.  This will    #
+#  force all templates to be instantiated and the     #
+#  shared library is created with all template        #
+#  instantiations in place.                           #
+#######################################################
+
+ifeq (${PLATFORM},HPUX)
+  ifeq (${COMPILER},CC)
+    ######  Start HP-UX  CC compiler specific stuff #######
+    DUMMYEXE=$(XML_LIB_DIR)/dummyExe
+    TEMPLATESOBJS=$(wildcard $(TEMPLATESREPOSITORY)/*.o)
+
+    all: $(DUMMYEXE) ${THISLIB}${VER}${SHLIBSUFFIX}
+	\rm -f $(DUMMYEXE)
+
+    $(DUMMYEXE): $(ALL_OBJECTS)
+	${MAKE_SHARED} -o ${@} $(PLATFORM_LIBRARIES) $^ $(ALLLIBS)
+
+    ######  End HP-UX  CC compiler specific stuff #######
+  else
+    all: ${THISLIB}${VER}${SHLIBSUFFIX}
+  endif
+else
+## OS390BATCH
+  ifeq (${OS390BATCH},1)
+all: ${BATCH_TARGET}
+  else
+all: ${THISLIB}${VER}${SHLIBSUFFIX}
+  endif
+endif
+
+########################################################
+#                                                      #
+# OS/390 works pretty much the same way as Windows NT  #
+# as far as linking goes. The runtime library is       #
+# called .dll, and the link-time libraries have a .x   #
+# extension. You need the .x files to link             #
+# your application at build time and need the .dll     #
+# file to run it. So, we need to copy over the .x      #
+# file to the lib directory as well, so that you can   #
+# link your application.                               #
+########################################################
+
+${THISLIB}${VER}${SHLIBSUFFIX}:	$(ALL_OBJECTS)
+	@echo Building ${THISLIB}${VER}${SHLIBSUFFIX}
+	${MAKE_SHARED} -o ${@} $(PLATFORM_LIBRARIES) $(EXTRA_LINK_OPTIONS) $^ $(TEMPLATESOBJS) $(ALLLIBS)
+## OS390
+ifeq (${PLATFORM},OS390)
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+${BATCH_TARGET}:        $(ALL_OBJECTS)
+	@echo Building ${BATCH_TARGET}
+	${MAKE_SHARED} -o ${@} $(PLATFORM_LIBRARIES) $(EXTRA_LINK_OPTIONS) $^ $(TEMPLATESOBJS) $(ALLLIBS)
+else
+	$(CP) ${LIBNAME}${VER}${OS390SIDEDECK} ${LIB}
+endif
+endif
+
+clean:
+	@echo "Making clean in obj ..."
+	-rm -f $(ALL_OBJECTS) ${THISLIB}${VER}${SHLIBSUFFIX}
+
+distclean:	clean
+	rm -f Makefile
+
+install:
+ifeq (${OS390BATCH},1)
+	@echo "Nothing to do for OS390BATCH ..."
+else
+	-mkdir -p ${PREFIX}/lib
+	$(CP) ${THISLIB}${VER}${SHLIBSUFFIX} $(PREFIX)/lib
+ifeq (${PLATFORM},OS390)
+	$(CP) ${LIBNAME}${VER}${OS390SIDEDECK} $(PREFIX)/lib
+endif
+endif
+
diff --git a/samples/DOMCount/DOMCount.cpp b/samples/DOMCount/DOMCount.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b39d3652b98ce5a20984bff363ddeed51fc586b9
--- /dev/null
+++ b/samples/DOMCount/DOMCount.cpp
@@ -0,0 +1,293 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:52  twl
+ * Initial revision
+ *
+ * Revision 1.8  1999/11/08 20:43:34  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/PlatformUtils.hpp>
+#include <sax/SAXException.hpp>
+#include <sax/SAXParseException.hpp>
+#include <parsers/DOMParser.hpp>
+#include "DOMCount.hpp"
+#include <string.h>
+#include <stdlib.h>
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple program which invokes the DOMParser to build a DOM
+//  tree for the specified input file. It then walks the tree and counts
+//  the number of elements. The element count is then printed.
+// ---------------------------------------------------------------------------
+void usage()
+{
+    cout << "\nUsage:\n"
+         << "    DOMCount [-v] {XML file}\n"
+         << "This program invokes the XML4C DOM parser, builds "
+         << "the DOM tree, and then prints the number of elements "
+         << "found in the input XML file.\n\n"
+         << "Options:\n"
+         << "        -v  Do validation in this parse.\n\n"
+         << endl;
+}
+
+
+int main(int argc, char* args[])
+{
+    // Initialize the XML4C system
+	try
+    {
+        XMLPlatformUtils::Initialize();
+    }
+
+    catch (const XMLException& toCatch)
+    {
+         cerr << "Error during initialization! :\n"
+              << StrX(toCatch.getMessage()) << endl;
+         return 1;
+    }
+
+    // Check command line and extract arguments.
+    if (argc < 2)
+    {
+        usage();
+        return -1;
+    }
+
+    const char* xmlFile         = args[1];
+    bool        doValidation    = false;
+
+    // See if non validating dom parser configuration is requested.
+    if (!strncmp(xmlFile, "-?", 2))
+    {
+        usage();
+        return 0;
+    }
+     else if (!strncmp(xmlFile, "-v", 2))
+    {
+        doValidation = true;
+        if (argc < 3)
+        {
+            usage();
+            return -1;
+        }
+        xmlFile = args[2];
+    }
+     else if (xmlFile[0] == '-')
+    {
+        usage();
+        return -1;
+    }
+
+    // Instantiate the DOM parser.
+    DOMParser parser;
+
+    // And create our error handler and install it
+    DOMCount elementCounter;
+    parser.setErrorHandler(&elementCounter);
+
+    //
+    //  Get the starting time and kick off the parse of the indicated
+    //  file. Catch any exceptions that might propogate out of it.
+    //
+    unsigned long duration;
+    try
+    {
+        const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
+        parser.parse(xmlFile);
+        const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
+        duration = endMillis - startMillis;
+    }
+
+    catch (const XMLException& toCatch)
+    {
+        cerr << "\nError during parsing: '" << xmlFile << "'\n"
+                << "Exception message is:  \n"
+                << StrX(toCatch.getMessage()) << "\n" << endl;
+        return -1;
+    }
+
+    //
+    //  Extract the DOM tree, get the list of all the elements and report the
+    //  length as the count of elements.
+    //
+    DOM_Document doc = parser.getDocument();
+    unsigned int elementCount = doc.getElementsByTagName("*").getLength();
+
+    // Print out the stats that we collected and time taken.
+    cout << xmlFile << ": " << duration << " ms ("
+            << elementCount << " elems)." << endl;
+
+    return 0;
+}
+
+
+DOMCount::DOMCount()
+{
+}
+
+DOMCount::~DOMCount()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  DOMCountHandlers: Overrides of the SAX ErrorHandler interface
+// ---------------------------------------------------------------------------
+void DOMCount::error(const SAXParseException& e)
+{
+    cerr << "\nError at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void DOMCount::fatalError(const SAXParseException& e)
+{
+    cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void DOMCount::warning(const SAXParseException& e)
+{
+    cerr << "\nWarning at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void DOMCount::resetErrors()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/DOMCount/DOMCount.hpp b/samples/DOMCount/DOMCount.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..b5742ab153cd99a217a9d37d83bde5a995ed5d40
--- /dev/null
+++ b/samples/DOMCount/DOMCount.hpp
@@ -0,0 +1,159 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:52  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:35  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/ErrorHandler.hpp>
+#include <iostream.h>
+
+class SAXParseException;
+
+
+// ---------------------------------------------------------------------------
+//  Simple error handler deriviative to install on parser
+// ---------------------------------------------------------------------------
+class DOMCount : public ErrorHandler
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    DOMCount();
+    ~DOMCount();
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the SAX ErrorHandler interface
+    // -----------------------------------------------------------------------
+    void warning(const SAXParseException& e);
+    void error(const SAXParseException& e);
+    void fatalError(const SAXParseException& e);
+    void resetErrors();
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    DOMCount(const DOMCount&);
+    void operator=(const DOMCount&);
+};
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/DOMCount/Makefile.in b/samples/DOMCount/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..330d456b380f1e106897102d4e2cafc0a5d36bc6
--- /dev/null
+++ b/samples/DOMCount/Makefile.in
@@ -0,0 +1,114 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:53  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:43:35  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+include ../Makefile.incl
+
+APP_NAME=DOMCount
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/DOMCount.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS}
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/DOMCount.o: ${SRC}/DOMCount.cpp
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/DOMCount.o ${SRC}/DOMCount.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/DOMPrint/DOMPrint.cpp b/samples/DOMPrint/DOMPrint.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c9e98fcc3b7fde277bd64a1363d0c4e1a52c3cab
--- /dev/null
+++ b/samples/DOMPrint/DOMPrint.cpp
@@ -0,0 +1,450 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:51  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:43:35  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  This sample program which invokes the DOMParser to build a DOM tree for
+//  the specified input file. It then walks the tree, and prints out the data
+//  as an XML file.
+//
+//  The parameters are:
+//
+//      [-?]            - Show usage and exit
+//      [-v]            - Do validation
+//      [-NoEscape]     - Don't escape characters like '<' or '&'.
+//      filename        - The path to the XML file to parse
+//
+//  These are non-case sensitive
+// ---------------------------------------------------------------------------
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/PlatformUtils.hpp>
+#include <parsers/DOMParser.hpp>
+#include <dom/DOM_Node.hpp>
+#include <dom/DOM_NamedNodeMap.hpp>
+#include "DOMTreeErrorReporter.hpp"
+#include <string.h>
+#include <stdlib.h>
+
+
+
+// ---------------------------------------------------------------------------
+//  Local data
+//
+//  xmlFile
+//      The path to the file to parser. Set via command line.
+//
+//  doValidation
+//      Indicates whether validation should be done. The default is not
+//      to validate, but -v overrides that.
+//
+//  doEscapes
+//      Indicates whether special chars should be escaped in the output.
+//      Defaults to doing escapes, -NoEscape overrides.
+// ---------------------------------------------------------------------------
+static char*	xmlFile         = 0;
+static bool     doValidation    = false;
+static bool     doEscapes       = true;
+
+
+// ---------------------------------------------------------------------------
+//  Forward references
+// ---------------------------------------------------------------------------
+void          outputContent(ostream& target, const DOMString &s);
+void          usage();
+ostream& operator<<(ostream& target, const DOMString& toWrite);
+ostream& operator<<(ostream& target, DOM_Node& toWrite);
+
+
+
+// ---------------------------------------------------------------------------
+//
+//  main
+//
+// ---------------------------------------------------------------------------
+int main(int argC, char* argV[])
+{
+    // Initialize the XML4C2 system
+    try
+    {
+        XMLPlatformUtils::Initialize();
+    }
+
+    catch(const XMLException& toCatch)
+    {
+        cerr << "Error during XML4C2 Initialization.\n"
+             << "  Exception message:"
+             << StrX(toCatch.getMessage()) << endl;
+        return 1;
+    }
+
+    // Check command line and extract arguments.
+    if (argC < 2)
+    {
+        usage();
+        return 1;
+    }
+
+    // Watch for special case help request
+    if (strcmp(argV[1], "-?") == 0)
+    {
+        usage();
+        return 0;
+    }
+
+    // See if non validating dom parser configuration is requested.
+    int parmInd;
+    for (parmInd = 1; parmInd < argC; parmInd++)
+    {
+        // Break out on first parm not starting with a dash
+        if (argV[parmInd][0] != '-')
+            break;
+
+        if (!strcmp(argV[parmInd], "-v")
+        ||  !strcmp(argV[parmInd], "-V"))
+        {
+            doValidation = true;
+        }
+         else if (!strcmp(argV[parmInd], "-NoEscape"))
+        {
+            doEscapes = false;
+        }
+         else
+        {
+            usage();
+            return 1;
+        }
+    }
+
+    //
+    //  And now we have to have only one parameter left and it must be
+    //  the file name.
+    //
+    if (parmInd + 1 != argC)
+    {
+        usage();
+        return 1;
+    }
+    xmlFile = argV[parmInd];
+
+    //
+    //  Create our validator, then attach an error handler to the parser.
+    //  The parser will call back to methods of the ErrorHandler if it
+    //  discovers errors during the course of parsing the XML document.
+    //
+    DOMParser parser;
+    ErrorHandler *errReporter = new DOMTreeErrorReporter();
+    parser.setErrorHandler(errReporter);
+
+    //
+    //  Parse the XML file, catching any XML exceptions that might propogate
+    //  out of it.
+    //
+    bool errorsOccured = false;
+    try
+    {
+        parser.parse(xmlFile);
+    }
+
+    catch (const XMLException& e)
+    {
+        cerr << "An error occured during parsing\n   Message: "
+             << StrX(e.getMessage()) << endl;
+        errorsOccured = true;
+    }
+
+    // If the parse was successful, output the document data from the DOM tree
+    if (!errorsOccured)
+    {
+        DOM_Node doc = parser.getDocument();
+		cout << doc << endl;
+    }
+
+    //
+    //  Clean up the element counter object. The parser does not adopt handlers
+    //  since they could be many objects or one object installed for multiple
+    //  handlers.
+    //
+    delete errReporter;
+
+    //
+	//  The DOM document and its contents are reference counted, and need
+	//	no explicit deletion.
+    //
+    return 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//
+//  Usage()
+//
+// ---------------------------------------------------------------------------
+void usage()
+{
+    cout << "\nUsage: DOMPrint [options] file\n"
+            "   This program invokes the XML4C DOM parser and builds the DOM tree.\n"
+            "   It then traverses the DOM tree and prints the contents of the tree\n"
+            "   Options are case insensitive\n\n"
+            "   Options:\n"
+            "     -v          Validate the data according to the DTD\n"
+            "     -NoEscape   Don't escape special characters in output\n"
+            "     -?          Show this help (must be the only parameter)\n"
+          <<  endl;
+}
+
+
+
+
+// ---------------------------------------------------------------------------
+//
+//  ostream << DOM_Node   
+//
+//                Stream out a DOM node, and, recursively, all of its children.
+//                This function is the heart of writing a DOM tree out as
+//                XML source.  Give it a document node and it will do the whole thing.
+//
+// ---------------------------------------------------------------------------
+ostream& operator<<(ostream& target, DOM_Node& toWrite)
+{
+    // Get the name and value out for convenience
+    DOMString   nodeName = toWrite.getNodeName();
+    DOMString   nodeValue = toWrite.getNodeValue();
+
+	switch (toWrite.getNodeType())
+    {
+		case DOM_Node::TEXT_NODE:
+        {
+            outputContent(target, nodeValue);
+            break;
+        }
+
+        case DOM_Node::PROCESSING_INSTRUCTION_NODE :
+        {
+            target  << "<?"
+                    << nodeName
+                    << ' '
+                    << nodeValue
+                    << "?>";
+            break;
+        }
+
+        case DOM_Node::DOCUMENT_NODE :
+        {
+            target << "<?xml version='1.0' encoding='utf-8' ?>\n";
+            DOM_Node child = toWrite.getFirstChild();
+            while( child != 0)
+            {
+                target << child << endl;
+                child = child.getNextSibling();
+            }
+
+            break;
+        }
+
+        case DOM_Node::ELEMENT_NODE :
+        {
+            // Output the element start tag.
+            target << '<' << nodeName;
+
+            // Output any attributes on this element
+            DOM_NamedNodeMap attributes = toWrite.getAttributes();
+            int attrCount = attributes.getLength();
+            for (int i = 0; i < attrCount; i++)
+            {
+                DOM_Node  attribute = attributes.item(i);
+
+                target  << ' ' << attribute.getNodeName()
+                        << " = \"";
+                        //  Note that "<" must be escaped in attribute values.
+                        outputContent(target, attribute.getNodeValue());
+                        target << '"';
+            }
+
+            //
+            //  Test for the presence of children, which includes both
+            //  text content and nested elements.
+            //
+            DOM_Node child = toWrite.getFirstChild();
+            if (child != 0)
+            {
+                // There are children. Close start-tag, and output children.
+                target << ">";
+                while( child != 0)
+                {
+                    target << child;
+                    child = child.getNextSibling();
+                }
+
+                // Done with children.  Output the end tag.
+                target << "</" << nodeName << ">";
+            }
+            else
+            {
+                //
+                //  There were no children.  Output the short form close of the
+                //  element start tag, making it an empty-element tag.
+                //
+                target << "/>";
+            }
+            break;
+        }
+
+        case DOM_Node::ENTITY_REFERENCE_NODE:
+        {
+            DOM_Node child;
+            for (child = toWrite.getFirstChild(); child != 0; child = child.getNextSibling())
+                target << child;
+            break;
+        }
+
+        case DOM_Node::CDATA_SECTION_NODE:
+        {
+            target << "<![CDATA[" << nodeValue << "]]>";
+            break;
+        }
+
+        case DOM_Node::COMMENT_NODE:
+        {
+            target << "<!--" << nodeValue << "-->";
+            break;
+        }
+
+        default:
+            cerr << "Unrecognized node type = "
+                 << (long)toWrite.getNodeType() << endl;
+    }
+	return target;
+}
+
+
+// ---------------------------------------------------------------------------
+//
+//  outputContent  - Write document content from a DOMString to a C++ ostream.
+//                   Escape the XML special characters (<, &, etc.) unless this
+//                   is suppressed by the command line option.
+//
+// ---------------------------------------------------------------------------
+void outputContent(ostream& target, const DOMString &toWrite)
+{
+    
+    if (doEscapes == false)
+    {
+        target << toWrite;
+    }
+     else
+    {
+        int            length = toWrite.length();
+        const XMLCh*   chars  = toWrite.rawBuffer();
+        
+        int index;
+        for (index = 0; index < length; index++)
+        {
+            switch (chars[index])
+            {
+            case chAmpersand :
+                target << "&amp;";
+                break;
+                
+            case chOpenAngle :
+                target << "&lt;";
+                break;
+                
+            case chCloseAngle:
+                target << "&gt;";
+                break;
+                
+            case chDoubleQuote :
+                target << "&quot;";
+                break;
+                
+            default:
+                // If it is none of the special characters, print it as such
+                target << StrX(&chars[index], 1);
+                break;
+            }
+        }
+    }
+
+    return;
+}
+
+
+// ---------------------------------------------------------------------------
+//
+//  ostream << DOMString      Stream out a DOM string.
+//
+// ---------------------------------------------------------------------------
+ostream& operator<<(ostream& target, const DOMString& s)
+{
+    if (s.length() > 0)
+        target << StrX(s.rawBuffer(), s.length());
+    return target;
+}
diff --git a/samples/DOMPrint/DOMTreeErrorReporter.cpp b/samples/DOMPrint/DOMTreeErrorReporter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8d7534fbdb2506468baeccc2e136f13d4a439725
--- /dev/null
+++ b/samples/DOMPrint/DOMTreeErrorReporter.cpp
@@ -0,0 +1,172 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:51  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:43:35  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/SAXParseException.hpp>
+#include "DOMTreeErrorReporter.hpp"
+#include <iostream.h>
+#include <stdlib.h>
+#include <memory.h>
+
+
+void DOMTreeErrorReporter::warning(const SAXParseException&)
+{
+    //
+    // Ignore all warnings.
+    //
+}
+
+void DOMTreeErrorReporter::error(const SAXParseException& toCatch)
+{
+    cerr << "Error at file \"" << StrX(toCatch.getSystemId())
+		 << "\", line " << toCatch.getLineNumber()
+		 << ", column " << toCatch.getColumnNumber()
+         << "\n   Message: " << StrX(toCatch.getMessage()) << endl;
+}
+
+void DOMTreeErrorReporter::fatalError(const SAXParseException& toCatch)
+{
+    cerr << "Fatal Error at file \"" << StrX(toCatch.getSystemId())
+		 << "\", line " << toCatch.getLineNumber()
+		 << ", column " << toCatch.getColumnNumber()
+         << "\n   Message: " << StrX(toCatch.getMessage()) << endl;
+}
+
+void DOMTreeErrorReporter::resetErrors()
+{
+    // No-op in this case
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/DOMPrint/DOMTreeErrorReporter.hpp b/samples/DOMPrint/DOMTreeErrorReporter.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..708691249e6c8ae05cb922f8f78729a5f2a38946
--- /dev/null
+++ b/samples/DOMPrint/DOMTreeErrorReporter.hpp
@@ -0,0 +1,149 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:51  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:43:36  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include <util/XML4CDefs.hpp>
+#include <sax/ErrorHandler.hpp>
+#include <iostream.h>
+
+class DOMTreeErrorReporter : public ErrorHandler
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    DOMTreeErrorReporter()
+    {
+    }
+
+    ~DOMTreeErrorReporter()
+    {
+    } 
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the error handler interface
+    // -----------------------------------------------------------------------
+    void warning(const SAXParseException& toCatch);
+    void error(const SAXParseException& toCatch);
+    void fatalError(const SAXParseException& toCatch);
+    void resetErrors();
+};
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/DOMPrint/Makefile.in b/samples/DOMPrint/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..4f9fbeecf51cc7b70719609f0abc6706274224a0
--- /dev/null
+++ b/samples/DOMPrint/Makefile.in
@@ -0,0 +1,118 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:52  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:43:36  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+include ../Makefile.incl
+
+APP_NAME=DOMPrint
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/DOMPrint.o ${OUTDIR}/DOMTreeErrorReporter.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+HEADER_FILES=${SRC}/DOMTreeErrorReporter.hpp
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/DOMPrint.o: ${SRC}/DOMPrint.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/DOMPrint.o ${SRC}/DOMPrint.cpp
+
+$(OUTDIR)/DOMTreeErrorReporter.o: ${SRC}/DOMTreeErrorReporter.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/DOMTreeErrorReporter.o ${SRC}/DOMTreeErrorReporter.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/Makefile.in b/samples/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..61cb1c146e029d20c693f8842e890023f6070e5e
--- /dev/null
+++ b/samples/Makefile.in
@@ -0,0 +1,137 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:25  twl
+# Initial revision
+#
+# Revision 1.4  1999/11/08 20:43:33  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+SAXPrint_DIR=SAXPrint
+SAXCount_DIR=SAXCount
+DOMPrint_DIR=DOMPrint
+DOMCount_DIR=DOMCount
+Redirect_DIR=Redirect
+MemParse_DIR=MemParse
+PParse_DIR=PParse
+StdInParse_DIR=StdInParse
+LIB_DIR=${XML4CROOT}/lib
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+all:	saxprint saxcount domprint domcount redirect memparse pparse stdinparse
+
+saxprint:
+	@echo Building "SAXPrint"
+	cd $(SAXPrint_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+saxcount:
+	@echo Building "SAXCount"
+	cd $(SAXCount_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+domprint:
+	@echo Building "DOMPrint"
+	cd $(DOMPrint_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+domcount:
+	@echo Building "DOMCount"
+	cd $(DOMCount_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+memparse:
+	@echo Building "MemParse"
+	cd $(MemParse_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+redirect:
+	@echo Building "Redirect"
+	cd $(Redirect_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+pparse:
+	@echo Building "PParse"
+	cd $(PParse_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+stdinparse:
+	@echo Building "StdInParse"
+	cd $(StdInParse_DIR) ; $(MAKE) $(MAKE_FLAGS) ; cd ..
+
+clean:
+	cd $(SAXPrint_DIR) && $(MAKE) $@ && cd ..
+	cd $(SAXCount_DIR) && $(MAKE) $@ && cd ..
+	cd $(DOMPrint_DIR) && $(MAKE) $@ && cd ..
+	cd $(DOMCount_DIR) && $(MAKE) $@ && cd ..
+	cd $(MemParse_DIR) && $(MAKE) $@ && cd ..
+	cd $(Redirect_DIR) && $(MAKE) $@ && cd ..
+	cd $(PParse_DIR) && $(MAKE) $@ && cd ..
+	cd $(StdInParse_DIR) && $(MAKE) $@ && cd ..
+
+distclean:
+	cd $(SAXPrint_DIR) && $(MAKE) $@ && cd ..
+	cd $(SAXCount_DIR) && $(MAKE) $@ && cd ..
+	cd $(DOMPrint_DIR) && $(MAKE) $@ && cd ..
+	cd $(DOMCount_DIR) && $(MAKE) $@ && cd ..
+	cd $(MemParse_DIR) && $(MAKE) $@ && cd ..
+	cd $(Redirect_DIR) && $(MAKE) $@ && cd ..
+	cd $(PParse_DIR) && $(MAKE) $@ && cd ..
+	cd $(StdInParse_DIR) && $(MAKE) $@ && cd ..
+	rm -f Makefile config.cache config.log config.status
+	rm -f *~ core
+
diff --git a/samples/Makefile.incl b/samples/Makefile.incl
new file mode 100644
index 0000000000000000000000000000000000000000..c9a6c50adc572c3c440f698e235e5908a1668474
--- /dev/null
+++ b/samples/Makefile.incl
@@ -0,0 +1,204 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:25  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:43:34  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+################## LIBRARY NAMES AND DIRECTORIES ##################
+
+INCLUDES= -I. -I${XML4CROOT}/include
+LIB_DIR=${XML4CROOT}/lib
+LIBNAME=IXXML4C
+THISLIB=${LIB_DIR}/${LIBNAME}
+VER=3_0
+ifdef ICUROOT
+   ICU_LIB_DIR=${ICUROOT}/lib
+   ICU_LIBNAME=icu-uc
+   LIBRARY_NAMES=-l${ICU_LIBNAME} -l${LIBNAME}${VER}
+   LIBRARY_SEARCH_PATHS=-L${ICU_LIB_DIR} -L${LIB_DIR}
+else
+   LIBRARY_NAMES=-l${LIBNAME}${VER}
+   LIBRARY_SEARCH_PATHS=-L${LIB_DIR}
+endif
+
+####################### PLATFORM DEPENDENCIES #####################
+
+#=============== SOLARIS SPECIFIC OPTIONS =========================
+ifeq (${PLATFORM}, SOLARIS)
+  ifeq (${COMPILER}, g++)
+	CMP= -c ${CXXFLAGS}
+	CC= g++ -c -D${PLATFORM} -D_REENTRANT -fpic -instances=static
+	LINK = g++ -D${PLATFORM} -fpic
+	PLATFORM_LIB_LINK_OPTIONS=-L/usr/lib -L/usr/local/lib
+	EXTRA_LINK_OPTIONS=-lc
+  else
+	CMP= -c ${CXXFLAGS}
+	CC= CC -c -D${PLATFORM}
+	LINK =  CC -D${PLATFORM}
+	PLATFORM_LIB_LINK_OPTIONS=-L/usr/lib
+	EXTRA_LINK_OPTIONS=-lC -lc -lgen
+  endif
+  SHLIBSUFFIX=.so
+endif
+
+#================= AIX SPECIFIC OPTIONS ===========================
+ifeq (${PLATFORM}, AIX)
+CMP= -c ${CXXFLAGS}
+CC=xlC_r -D${PLATFORM}
+LINK =  ${CC}
+PLATFORM_LIB_LINK_OPTIONS=-L/usr/lpp/xlC/lib
+EXTRA_LINK_OPTIONS=-lC
+SHLIBSUFFIX=.a
+endif
+
+#=============== LINUX SPECIFIC OPTIONS =========================
+ifeq (${PLATFORM}, LINUX)
+CMP= -c ${CXXFLAGS}
+CC= g++ -c -D${PLATFORM} -D_REENTRANT -fpic -instances=static
+LINK =  g++ -D${PLATFORM} -fpic
+PLATFORM_LIB_LINK_OPTIONS=-L/usr/lib -L/usr/local/lib
+EXTRA_LINK_OPTIONS=-lc
+SHLIBSUFFIX=.so
+endif
+
+#================= HP SPECIFIC OPTIONS ===========================
+ifeq (${PLATFORM}, HPUX)
+  ifeq (${COMPILER}, aCC)
+    CMP = -c $(CXXFLAGS) -D_HP_UX -DHPaCC +DAportable -w +z
+    CC = aCC
+    LINK =  ${CC} -Wl,+s
+    PLATFORM_LIB_LINK_OPTIONS=-L/opt/aCC/lib -L/usr/ccs/lib
+    SHLIBSUFFIX=.sl
+  else
+    ifneq (${DEBUG}, 1)
+      CXXFLAGS = -w +O1
+    endif
+    APPL_NAME = $(notdir $(shell pwd))
+    TEMPLATESDIR = $(XML4CROOT)/bin/obj/$(APPL_NAME)/ptrepository
+    COMMON_CMP = $(CXXFLAGS) -D_HP_UX -DHPCC +DAportable -w +eh +z -z \
+        -ptr$(TEMPLATESDIR)
+    CMP = -c $(COMMON_CMP)
+    CC = CC
+    LINK =  ${CC} $(COMMON_CMP) -Wl,+s
+    PLATFORM_LIB_LINK_OPTIONS=-L/opt/CC/lib -L/usr/lib
+    SHLIBSUFFIX=.sl
+  endif
+endif
+
+#================= OS390 SPECIFIC OPTIONS ===========================
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# Before you try to run the Makefile, make sure you have two      #
+# environment variables set.                                      #
+#                                                                 #
+#   export XML4CROOT=<the directory where you installed XML4C>    #
+# XML4C can be built in two ways (1) using ICU and                #
+#                                (2) using Iconv (not ICU)        #
+#                                                                 #
+# To use ICU, you must:                                           #
+#   export ICUROOT=<the directory where you installed ICU>        #
+# To disable ICU and use Iconv instead:                           #
+#   unset ICUROOT                                                 #
+#                                                                 #
+# Also, to enable debugging, you must type:                       #
+#   export DEBUG=1                                                #
+# To disable debugging, you must type:                            #
+#   unset DEBUG                                                   #
+#                                                                 #
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+# Also, search for the LOADMOD variable and set it to your        #
+# LOADMOD dataset. Make sure you have at least UPDATE access to   #
+# the dataset.                                                    #
+###################################################################
+
+ifeq (${PLATFORM}, OS390)
+CMP= -c -DOS390 ${CXXFLAGS}
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+CC = _CXX_CXXSUFFIX="cpp" _CXX_STEPS="-1" c++ -W0,"langlvl(extended)" -DOS390 -DOPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -DOS390BATCH
+else
+CC = _CXX_CXXSUFFIX="cpp" _CXX_STEPS="-1" c++ -W0,"langlvl(extended)" -DOS390 -DOPEN_THREADS -D_XOPEN_SOURCE_EXTENDED
+endif
+LINK =  ${CC}
+PLATFORM_LIB_LINK_OPTIONS=
+EXTRA_LINK_OPTIONS =
+SHLIBSUFFIX=.dll
+OS390SIDEDECK=.x
+ifneq (${DEBUG}, 1)
+  CXXFLAGS = -2
+endif
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+LOADMOD = USERID.LOAD
+LOADEXP = USERID.EXP
+LIBRARY_NAMES="//'${LOADEXP}(XML4C30)'"
+else
+LIBRARY_NAMES=${LIB_DIR}/lib${LIBNAME}${VER}${OS390SIDEDECK}
+endif
+LIBRARY_SEARCH_PATHS=
+endif
+
diff --git a/samples/MemParse/Makefile.in b/samples/MemParse/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..86b10d643b2cf4a9740386bdf1dfef5236dc1539
--- /dev/null
+++ b/samples/MemParse/Makefile.in
@@ -0,0 +1,118 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:49  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:43:36  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+include ../Makefile.incl
+
+APP_NAME=MemParse
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/MemParse.o ${OUTDIR}/MemParseHandlers.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+HEADER_FILES= ${SRC}/MemParse.hpp ${SRC}/MemParseHandlers.hpp
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/MemParse.o: ${SRC}/MemParse.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/MemParse.o ${SRC}/MemParse.cpp
+
+$(OUTDIR)/MemParseHandlers.o: ${SRC}/MemParseHandlers.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/MemParseHandlers.o ${SRC}/MemParseHandlers.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/MemParse/MemParse.cpp b/samples/MemParse/MemParse.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..815e8f728bd1640abeb840b433977fea801854a5
--- /dev/null
+++ b/samples/MemParse/MemParse.cpp
@@ -0,0 +1,318 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+
+/**
+ * This sample program illustrates how one can use a memory buffer as the
+ * input to parser. The memory buffer contains raw bytes representing XML
+ * statements.
+ *
+ * Look at the API documentation for 'MemBufInputSource' for more information
+ * on parameters to the constructor.
+ *
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:49  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:43:36  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <parsers/SAXParser.hpp>
+#include <internal/MemBufInputSource.hpp>
+#include "MemParse.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  Local const data
+//
+//  gXMLInMemBuf
+//      Defines the memory buffer contents here which parsed by the XML
+//      parser. This is the cheap way to do it, instead of reading it from
+//      somewhere. For this demo, its fine.
+//
+//      NOTE: This will NOT work if your compiler's default char type is not
+//      ASCII, since we indicate in the encoding that its ascii.
+//
+//  gMemBufId
+//      A simple name to give as the system id for the memory buffer. This
+//      just for indentification purposes in case of errors. Its not a real
+//      system id (and the parser knows that.)
+// ---------------------------------------------------------------------------
+static const char*  gXMLInMemBuf =
+"\
+<?xml version='1.0' encoding='ascii'?>\n\
+<!DOCTYPE company [\n\
+<!ELEMENT company     (product,category,developedAt)>\n\
+<!ELEMENT product     (#PCDATA)>\n\
+<!ELEMENT category    (#PCDATA)>\n\
+<!ATTLIST category idea CDATA #IMPLIED>\n\
+<!ELEMENT developedAt (#PCDATA)>\n\
+]>\n\n\
+<company>\n\
+    <product>XML4C</product>\n\
+    <category idea='great'>XML Parsing Tools</category>\n\
+    <developedAt>\n\
+      IBM Center for Java Technology, Silicon Valley, Cupertino, CA\n\
+    </developedAt>\n\
+</company>\
+";
+
+static const char*  gMemBufId = "prodInfo";
+
+
+
+// ---------------------------------------------------------------------------
+//  Local helper methods
+// ---------------------------------------------------------------------------
+void usage()
+{
+    cout << "\nUsage:\n"
+         << "    MemParse [-nv]\n"
+         << "This program uses the SAX Parser to parse a memory buffer\n"
+         << "containing XML statements, and reports the number of\n"
+         << "elements and attributes found.\n"
+         << "\nOptions:\n"
+         << "    -v  Do a validating parse. Default is non-validating.\n\n"
+         << endl;
+}
+
+
+// ---------------------------------------------------------------------------
+//  Program entry point
+// ---------------------------------------------------------------------------
+int main(int argc, char* args[])
+{
+    // Initialize the XML4C2 system
+    try
+    {
+         XMLPlatformUtils::Initialize();
+    }
+    catch (const XMLException& toCatch)
+    {
+         cerr << "Error during initialization! Message:\n"
+              << StrX(toCatch.getMessage()) << endl;
+         return 1;
+    }
+
+    const char* options = args[1];
+    bool  doValidation = false;
+
+    if (argc > 1)
+    {
+        // Check for some special cases values of the parameter
+        if (!strncmp(options, "-?", 2))
+        {
+            usage();
+            return 0;
+        }
+        else if (!strncmp(options, "-v", 3))
+        {
+            doValidation = true;
+        }
+        else if (options[0] == '-')
+        {
+            usage();
+            return -1;
+        }
+    }
+
+    //
+    //  Create a SAX parser object. Then, according to what we were told on
+    //  the command line, set it to validate or not.
+    //
+    SAXParser parser;
+    parser.setDoValidation(doValidation);
+
+    //
+    //  Create our SAX handler object and install it on the parser, as the
+    //  document and error handlers.
+    //
+    MemParseHandlers handler;
+    parser.setDocumentHandler(&handler);
+    parser.setErrorHandler(&handler);
+
+    //
+    //  Create MemBufferInputSource from the buffer containing the XML
+    //  statements.
+    //
+    //  NOTE: We are using strlen() here, since we know that the chars in
+    //  our hard coded buffer are single byte chars!!! The parameter wants
+    //  the number of BYTES, not chars, so when you create a memory buffer
+    //  give it the byte size (which just happens to be the same here.)
+    //
+    MemBufInputSource* memBufIS = new MemBufInputSource
+    (
+        (const XMLByte*)gXMLInMemBuf
+        , strlen(gXMLInMemBuf)
+        , gMemBufId
+        , false
+    );
+
+    //
+    //  Get the starting time and kick off the parse of the indicated
+    //  file. Catch any exceptions that might propogate out of it.
+    //
+    unsigned long duration;
+    try
+    {
+        const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
+        parser.parse(*memBufIS);
+        const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
+        duration = endMillis - startMillis;
+    }
+
+    catch (const XMLException& e)
+    {
+        cerr << "\nError during parsing memory stream:\n"
+             << "Exception message is:  \n"
+             << StrX(e.getMessage()) << "\n" << endl;
+        return -1;
+    }
+
+    // Print out the stats that we collected and time taken.
+    cout << "\nFinished parsing the memory buffer containing the following "
+         << "XML statements:\n\n"
+         << gXMLInMemBuf
+         << "\n\n\n"
+         << "Parsing took " << duration << " ms ("
+         << handler.getElementCount() << " elements, "
+         << handler.getAttrCount() << " attributes, "
+         << handler.getSpaceCount() << " spaces, "
+         << handler.getCharacterCount() << " characters).\n" << endl;
+
+    if (doValidation == false)
+    {
+        cout << "You can also invoke it with '-v' parameter to turn "
+             << "on validation.\n";
+    }
+
+    return 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/MemParse/MemParse.hpp b/samples/MemParse/MemParse.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..a9aebc46abcff3a4366487de5f9a4a99633097ce
--- /dev/null
+++ b/samples/MemParse/MemParse.hpp
@@ -0,0 +1,132 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:50  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:37  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes for all the program files to see
+// ---------------------------------------------------------------------------
+#include <string.h>
+#include <stdlib.h>
+#include <iostream.h>
+#include <util/PlatformUtils.hpp>
+#include "MemParseHandlers.hpp"
+
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/MemParse/MemParseHandlers.cpp b/samples/MemParse/MemParseHandlers.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9970e890c5659dd2a5569251b974d158f4030fb9
--- /dev/null
+++ b/samples/MemParse/MemParseHandlers.cpp
@@ -0,0 +1,156 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:50  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:43:37  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include "MemParse.hpp"
+#include <memory.h>
+#include <sax/AttributeList.hpp>
+#include <sax/SAXParseException.hpp>
+#include <sax/SAXException.hpp>
+
+
+
+// ---------------------------------------------------------------------------
+//  MemParseHandlers: Constructors and Destructor
+// ---------------------------------------------------------------------------
+MemParseHandlers::MemParseHandlers() :
+
+    fElementCount(0)
+    , fAttrCount(0)
+    , fCharacterCount(0)
+    , fSpaceCount(0)
+{
+}
+
+MemParseHandlers::~MemParseHandlers()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  MemParseHandlers: Implementation of the SAX DocumentHandler interface
+// ---------------------------------------------------------------------------
+void MemParseHandlers::startElement(const   XMLCh* const    name
+                                    ,       AttributeList&  attributes)
+{
+    fElementCount++;
+    fAttrCount += attributes.getLength();
+}
+
+void MemParseHandlers::characters(  const   XMLCh* const    chars
+                                    , const unsigned int    length)
+{
+    fCharacterCount += length;
+}
+
+void MemParseHandlers::ignorableWhitespace( const   XMLCh* const chars
+                                            , const unsigned int length)
+{
+    fSpaceCount += length;
+}
+
+void MemParseHandlers::resetDocument()
+{
+    fAttrCount = 0;
+    fCharacterCount = 0;
+    fElementCount = 0;
+    fSpaceCount = 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  MemParseHandlers: Overrides of the SAX ErrorHandler interface
+// ---------------------------------------------------------------------------
+void MemParseHandlers::error(const SAXParseException& e)
+{
+    cerr << "\nError at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void MemParseHandlers::fatalError(const SAXParseException& e)
+{
+    cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void MemParseHandlers::warning(const SAXParseException& e)
+{
+    cerr << "\nWarning at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+
diff --git a/samples/MemParse/MemParseHandlers.hpp b/samples/MemParse/MemParseHandlers.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..558cd1810f806694ec53da8d24861b33477f045d
--- /dev/null
+++ b/samples/MemParse/MemParseHandlers.hpp
@@ -0,0 +1,142 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:50  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:43:37  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/HandlerBase.hpp>
+class AttributeList;
+
+
+class MemParseHandlers : public HandlerBase
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    MemParseHandlers();
+    ~MemParseHandlers();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getElementCount()
+    {
+        return fElementCount;
+    }
+
+    unsigned int getAttrCount()
+    {
+        return fAttrCount;
+    }
+
+    unsigned int getCharacterCount()
+    {
+        return fCharacterCount;
+    }
+
+    unsigned int getSpaceCount()
+    {
+        return fSpaceCount;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX DocumentHandler interface
+    // -----------------------------------------------------------------------
+    void startElement(const XMLCh* const name, AttributeList& attributes);
+    void characters(const XMLCh* const chars, const unsigned int length);
+    void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
+    void resetDocument();
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX ErrorHandler interface
+    // -----------------------------------------------------------------------
+    void warning(const SAXParseException& exception);
+    void error(const SAXParseException& exception);
+    void fatalError(const SAXParseException& exception);
+
+
+
+private:
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fAttrCount
+    //  fCharacterCount
+    //  fElementCount
+    //  fSpaceCount
+    //      These are just counters that are run upwards based on the input
+    //      from the document handlers.
+    // -----------------------------------------------------------------------
+    unsigned int    fAttrCount;
+    unsigned int    fCharacterCount;
+    unsigned int    fElementCount;
+    unsigned int    fSpaceCount;
+};
diff --git a/samples/PParse/Makefile.in b/samples/PParse/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..73feeff09843696db9259e6ebcafbb64a13dcf5b
--- /dev/null
+++ b/samples/PParse/Makefile.in
@@ -0,0 +1,118 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:45  twl
+# Initial revision
+#
+# Revision 1.2  1999/11/08 20:43:37  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+include ../Makefile.incl
+
+APP_NAME=PParse
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/PParse.o ${OUTDIR}/PParseHandlers.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+HEADER_FILES=${SRC}/PParse.hpp ${SRC}/PParseHandlers.hpp
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/PParse.o: ${SRC}/PParse.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/PParse.o ${SRC}/PParse.cpp
+
+$(OUTDIR)/PParseHandlers.o: ${SRC}/PParseHandlers.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/PParseHandlers.o ${SRC}/PParseHandlers.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/PParse/PParse.cpp b/samples/PParse/PParse.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f108b4b4a8a47fe214c6209b3e2d125ab795ead9
--- /dev/null
+++ b/samples/PParse/PParse.cpp
@@ -0,0 +1,272 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:45  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:38  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  This sample program demonstrates the progressive parse capabilities of
+//  the parser system. It allows you to do a scanFirst() call followed by
+//  a loop which calls scanNext(). You can drop out when you've found what
+//  ever it is you want. In our little test, our event handler looks for
+//  16 new elements then sets a flag to indicate its found what it wants.
+//  At that point, our progressive parse loop below exits.
+//
+//  The parameters are:
+//
+//      [-?]            - Show usage and exit
+//      filename        - The path to the XML file to parse
+//
+//  These are non-case sensitive
+// ---------------------------------------------------------------------------
+
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/PlatformUtils.hpp>
+#include <internal/URLInputSource.hpp>
+#include <framework/XMLPScanToken.hpp>
+#include <parsers/SAXParser.hpp>
+#include "PParse.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  Local data
+//
+//  xmlFile
+//      The path to the file to parser. Set via command line.
+// ---------------------------------------------------------------------------
+static char* xmlFile    = 0;
+
+
+
+// ---------------------------------------------------------------------------
+//  Local helper methods
+// ---------------------------------------------------------------------------
+static void usage()
+{
+    cout <<  "\nUsage: PParse file\n"
+         <<  "   This program demonstrates progressive parsing\n"
+         <<  endl;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  Program entry point
+// ---------------------------------------------------------------------------
+int main(int argC, char* argV[])
+{
+    // Initialize the XML4C system
+    try
+    {
+         XMLPlatformUtils::Initialize();
+    }
+
+    catch (const XMLException& toCatch)
+    {
+         cerr << "Error during initialization! :\n"
+              << StrX(toCatch.getMessage()) << endl;
+         return 1;
+    } 
+
+
+    // Check command line and extract arguments.
+    if (argC < 2)
+    {
+        usage();
+        return 1;
+    }
+
+    // Watch for special case help request
+    if (strcmp(argV[1], "-?") == 0)
+    {
+        usage();
+        return 0;
+    }
+
+    // Its not the help request so its got to be the file name
+    xmlFile = argV[1];
+
+
+    //
+    //  Create a SAX parser object to use and create our SAX event handlers
+    //  and plug them in.
+    //
+    SAXParser parser;
+    PParseHandlers handler;
+    parser.setDocumentHandler(&handler);
+    parser.setErrorHandler(&handler);
+
+    //
+    //  Ok, lets do the progressive parse loop. On each time around the
+    //  loop, we look and see if the handler has found what its looking
+    //  for. When it does, we fall out then.
+    //
+    try
+    {
+        // Create a progressive scan token
+        XMLPScanToken token;
+
+        if (!parser.parseFirst(xmlFile, token))
+        {
+            cerr << "scanFirst() failed\n" << endl;
+            return 1;
+        }
+
+        //
+        //  We started ok, so lets call scanNext() until we find what we want
+        //  or hit the end.
+        //
+        bool gotMore = true;
+        while (gotMore && !handler.getDone())
+            gotMore = parser.parseNext(token);
+    }
+
+    catch (const XMLException& toCatch)
+    {
+        cerr << "\nAn error occured: '" << xmlFile << "'\n"
+             << "Exception message is: \n"
+             << StrX(toCatch.getMessage())
+             << "\n" << endl;
+        return -1;
+    }
+
+    if (handler.getDone())
+        cout << "Got the required 16 elements\n" << endl;
+    else
+        cout << "Did not get the required 16 elements\n" << endl;
+
+    return 0;
+}
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/PParse/PParse.hpp b/samples/PParse/PParse.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..fa1bd99644f9e437ac459a9e0bcbe162685f9fe1
--- /dev/null
+++ b/samples/PParse/PParse.hpp
@@ -0,0 +1,130 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:45  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:43:38  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes for all the program files to see
+// ---------------------------------------------------------------------------
+#include <iostream.h>
+#include <string.h>
+#include <stdlib.h>
+#include "PParseHandlers.hpp"
+
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/PParse/PParseHandlers.cpp b/samples/PParse/PParseHandlers.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a088d83ac8e0604fdde84e1a47f5437c8f9590ad
--- /dev/null
+++ b/samples/PParse/PParseHandlers.cpp
@@ -0,0 +1,130 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:45  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:43:38  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/XMLUni.hpp>
+#include <sax/AttributeList.hpp>
+#include "PParse.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  PParseHandlers: Constructors and Destructor
+// ---------------------------------------------------------------------------
+PParseHandlers::PParseHandlers() :
+
+    fCount(0)
+    , fDone(false)
+{
+}
+
+PParseHandlers::~PParseHandlers()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  PParseHandlers: Overrides of the SAX DocumentHandler interface
+// ---------------------------------------------------------------------------
+void PParseHandlers::startElement(  const   XMLCh* const    name
+                                    ,       AttributeList&  attributes)
+{
+    // Bump up the count of elements, and set done if we hit 16
+    fCount++;
+    fDone = (fCount == 16);
+}
+
+
+// ---------------------------------------------------------------------------
+//  PParseHandlers: Overrides of the SAX ErrorHandler interface
+// ---------------------------------------------------------------------------
+void PParseHandlers::error(const SAXParseException& e)
+{
+    cerr << "\nError at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void PParseHandlers::fatalError(const SAXParseException& e)
+{
+    cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void PParseHandlers::warning(const SAXParseException& e)
+{
+    cerr << "\nWarning at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
diff --git a/samples/PParse/PParseHandlers.hpp b/samples/PParse/PParseHandlers.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..a0f68dc61921718af1502e0df89c8488d008d26e
--- /dev/null
+++ b/samples/PParse/PParseHandlers.hpp
@@ -0,0 +1,120 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:46  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:43:38  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include    <sax/HandlerBase.hpp>
+
+class PParseHandlers : public HandlerBase
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors
+    // -----------------------------------------------------------------------
+    PParseHandlers();
+    ~PParseHandlers();
+
+
+    // -----------------------------------------------------------------------
+    //  Implementations of the SAX DocumentHandler interface
+    // -----------------------------------------------------------------------
+    void startElement(const XMLCh* const name, AttributeList& attributes);
+
+
+
+    // -----------------------------------------------------------------------
+    //  Implementations of the SAX ErrorHandler interface
+    // -----------------------------------------------------------------------
+    void warning(const SAXParseException& exception);
+    void error(const SAXParseException& exception);
+    void fatalError(const SAXParseException& exception);
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    bool getDone() const;
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fCount
+    //      This is a counter that we use to count elements. When it hits
+    //      16, we set our done flag.
+    //
+    //  fDone
+    //      This flag is set once we find what we are looking for.
+    // -----------------------------------------------------------------------
+    unsigned int    fCount;
+    bool            fDone;
+};
+
+
+inline bool PParseHandlers::getDone() const
+{
+    return fDone;
+}
diff --git a/samples/Projects/Win32/VC6/DOMCount/DOMCount.dsp b/samples/Projects/Win32/VC6/DOMCount/DOMCount.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..b02634eec03529c640d2c6da28c99e592c268fd1
--- /dev/null
+++ b/samples/Projects/Win32/VC6/DOMCount/DOMCount.dsp
@@ -0,0 +1,75 @@
+# Microsoft Developer Studio Project File - Name="DOMCount" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=DOMCount - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMCount.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMCount.mak" CFG="DOMCount - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DOMCount - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\bin"
+# PROP Intermediate_Dir "..\..\..\..\..\bin\obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G5 /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /I "..\..\..\..\..\include\dom" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "DEVENV_VCPP" /D "PROJ_DOMCOUNT" /D "PLATFORM_WIN32" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXXML4C3.lib /nologo /version:2.0 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\lib"
+# Begin Target
+
+# Name "DOMCount - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\DOMCount\DOMCount.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\DOMCount\DOMCount.hpp
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/samples/Projects/Win32/VC6/DOMPrint/DOMPrint.dsp b/samples/Projects/Win32/VC6/DOMPrint/DOMPrint.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..0661ccd0b96d9ec1f9c2defd6de343ea474cd208
--- /dev/null
+++ b/samples/Projects/Win32/VC6/DOMPrint/DOMPrint.dsp
@@ -0,0 +1,83 @@
+# Microsoft Developer Studio Project File - Name="DOMPrint" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=DOMPrint - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMPrint.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "DOMPrint.mak" CFG="DOMPrint - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "DOMPrint - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\bin"
+# PROP Intermediate_Dir "..\..\..\..\..\bin\obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G5 /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /I "..\..\..\..\..\include\dom" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "DEVENV_VCPP" /D "PROJ_DOMPRINT" /D "PLATFORM_WIN32" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXXML4C3.lib /nologo /version:2.0 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\lib"
+# Begin Target
+
+# Name "DOMPrint - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\DOMPrint\DOMPrint.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\DOMPrint\DomTreeErrorReporter.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\DOMPrint\DOMPrint.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\DOMPrint\DomTreeErrorReporter.hpp
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/samples/Projects/Win32/VC6/MemParse/MemParse.dsp b/samples/Projects/Win32/VC6/MemParse/MemParse.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..e49f9504842c97c4ac3c712855972412d399be61
--- /dev/null
+++ b/samples/Projects/Win32/VC6/MemParse/MemParse.dsp
@@ -0,0 +1,79 @@
+# Microsoft Developer Studio Project File - Name="MemParse" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=MemParse - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "MemParse.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "MemParse.mak" CFG="MemParse - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "MemParse - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\bin"
+# PROP Intermediate_Dir "..\..\..\..\..\bin\obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G5 /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "DEVENV_VCPP" /D "PROJ_MEMPARSE" /D "PLATFORM_WIN32" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXXML4C3.lib /nologo /version:2.0 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\lib"
+# Begin Target
+
+# Name "MemParse - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "*.cpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\MemParse\MemParse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\MemParse\MemParseHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "*.hpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\MemParse\MemParse.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\MemParse\MemParseHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/samples/Projects/Win32/VC6/Redirect/Redirect.dsp b/samples/Projects/Win32/VC6/Redirect/Redirect.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..b61809d017fdada43719ae8a679f68b03893c0f9
--- /dev/null
+++ b/samples/Projects/Win32/VC6/Redirect/Redirect.dsp
@@ -0,0 +1,79 @@
+# Microsoft Developer Studio Project File - Name="Redirect" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Redirect - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Redirect.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Redirect.mak" CFG="Redirect - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Redirect - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\bin"
+# PROP Intermediate_Dir "..\..\..\..\..\bin\obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G5 /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "DEVENV_VCPP" /D "PROJ_REDIRECT" /D "PLATFORM_WIN32" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXXML4C3.lib /nologo /version:2.0 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\lib"
+# Begin Target
+
+# Name "Redirect - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "*.cpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\Redirect\Redirect.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\Redirect\RedirectHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "*.hpp"
+# Begin Source File
+
+SOURCE=..\..\..\..\Redirect\Redirect.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\Redirect\RedirectHandlers.hpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/samples/Projects/Win32/VC6/SAXCount/SAXCount.dsp b/samples/Projects/Win32/VC6/SAXCount/SAXCount.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..e02d82ffcc6e99c47de84189429eed01e54d32a1
--- /dev/null
+++ b/samples/Projects/Win32/VC6/SAXCount/SAXCount.dsp
@@ -0,0 +1,83 @@
+# Microsoft Developer Studio Project File - Name="SAXCount" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SAXCount - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXCount.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXCount.mak" CFG="SAXCount - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SAXCount - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\bin"
+# PROP Intermediate_Dir "..\..\..\..\..\bin\obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G5 /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "DEVENV_VCPP" /D "PROJ_SAXCOUNT" /D "PLATFORM_WIN32" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXXML4C3.lib /nologo /version:2.0 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\lib"
+# Begin Target
+
+# Name "SAXCount - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXCount\SAXCount.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXCount\SAXCountHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXCount\SAXCount.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXCount\SAXCountHandlers.hpp
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/samples/Projects/Win32/VC6/SAXPrint/SAXPrint.dsp b/samples/Projects/Win32/VC6/SAXPrint/SAXPrint.dsp
new file mode 100644
index 0000000000000000000000000000000000000000..81d2e5033cbf871de5adc71b3f7c8fb7f4a767a1
--- /dev/null
+++ b/samples/Projects/Win32/VC6/SAXPrint/SAXPrint.dsp
@@ -0,0 +1,83 @@
+# Microsoft Developer Studio Project File - Name="SAXPrint" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SAXPrint - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXPrint.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "SAXPrint.mak" CFG="SAXPrint - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "SAXPrint - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\..\..\bin"
+# PROP Intermediate_Dir "..\..\..\..\..\bin\obj"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G5 /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "DEVENV_VCPP" /D "PROJ_SAXPRINT" /D "PLATFORM_WIN32" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib IXXML4C3.lib /nologo /version:2.0 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\lib"
+# Begin Target
+
+# Name "SAXPrint - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXPrint\SAXPrint.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXPrint\SAXPrintHandlers.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXPrint\SAXPrint.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\SAXPrint\SAXPrintHandlers.hpp
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/samples/Projects/Win32/VC6/samples.dsw b/samples/Projects/Win32/VC6/samples.dsw
new file mode 100644
index 0000000000000000000000000000000000000000..270b2771d22162eab28e8eb412516f875afbb0cb
--- /dev/null
+++ b/samples/Projects/Win32/VC6/samples.dsw
@@ -0,0 +1,89 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "DOMCount"=.\DOMCount\DOMCount.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "DOMPrint"=.\DOMPrint\DOMPrint.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "MemParse"=.\MemParse\MemParse.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "Redirect"=.\Redirect\Redirect.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "SAXCount"=.\SAXCount\SAXCount.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "SAXPrint"=.\SAXPrint\SAXPrint.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/samples/Redirect/Makefile.in b/samples/Redirect/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..7940ec535d07ec7cc67d638cdedae84baff9eda9
--- /dev/null
+++ b/samples/Redirect/Makefile.in
@@ -0,0 +1,118 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:36  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:43:38  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+include ../Makefile.incl
+
+APP_NAME=Redirect
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/Redirect.o ${OUTDIR}/RedirectHandlers.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+HEADER_FILES=${SRC}/Redirect.hpp ${SRC}/RedirectHandlers.hpp
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/Redirect.o: ${SRC}/Redirect.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/Redirect.o ${SRC}/Redirect.cpp
+
+$(OUTDIR)/RedirectHandlers.o: ${SRC}/RedirectHandlers.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/RedirectHandlers.o ${SRC}/RedirectHandlers.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/Redirect/Redirect.cpp b/samples/Redirect/Redirect.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..023c3b011dc4d5427185d7adb84eb302c39aef1c
--- /dev/null
+++ b/samples/Redirect/Redirect.cpp
@@ -0,0 +1,273 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+
+/**
+ *
+ * This simplistic sample illustrates how an XML application can use
+ * the SAX entityResolver handler to provide customized handling for
+ * external entities.
+ *
+ * It registers an entity resolver with the parser. When ever the parser
+ * comes across an external entity, like a reference to an external DTD
+ * file, it calls the 'resolveEntity()' callback. This callback in this
+ * sample checks to see if the external entity to be resolved is the file
+ * 'personal.dtd'.
+ *
+ * If it is then, it redirects the input stream to the file 'redirect.dtd',
+ * which is then read instead of 'personal.dtd'.
+ *
+ * If the external entity to be resolved was not the file 'personal.dtd', the
+ * callback returns NULL indicating that do the default behaviour which is
+ * to read the contents of 'personal.dtd'.
+ *
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:37  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:43:39  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <parsers/SAXParser.hpp>
+#include "Redirect.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  Local helper methods
+// ---------------------------------------------------------------------------
+void usage()
+{
+    cout << "\nUsage:\n"
+         << "    Redirect [-v] <XML file>\n"
+         << "    -v  Invoke the Validating SAX Parser.\n\n"
+         << "This program installs an entity resolver, traps the call to\n"
+         << "the external DTD file and redirects it to another application\n"
+         << "specific file which contains the actual dtd.\n\n"
+         << "The program then counts and reports the number of elements and\n"
+         << "attributes in the given XML file.\n" << endl;
+}
+
+
+// ---------------------------------------------------------------------------
+//  Program entry point
+// ---------------------------------------------------------------------------
+int main(int argc, char* args[])
+{
+    // Initialize the XML4C system
+    try
+    {
+         XMLPlatformUtils::Initialize();
+    }
+    catch (const XMLException& toCatch)
+    {
+         cerr << "Error during initialization! Message:\n"
+              << StrX(toCatch.getMessage()) << endl;
+         return 1;
+    }
+
+    // We only have one parameter, which is the file to process
+    if (argc < 2)
+    {
+        usage();
+        return -1;
+    }
+    const char* xmlFile = args[1];
+    bool  doValidation = false;
+
+    // Check for some special cases values of the parameter
+    if (!strncmp(xmlFile, "-?", 2))
+    {
+        usage();
+        return 0;
+    }
+     else if (!strncmp(xmlFile, "-v", 2))
+    {
+        doValidation = true;
+        if (argc < 3)
+        {
+            usage();
+            return -1;
+        }
+        xmlFile = args[2];
+    }
+     else if (xmlFile[0] == '-')
+    {
+        usage();
+        return -1;
+    }
+
+
+    //
+    //  Create a SAX parser object. Then, according to what we were told on
+    //  the command line, set it to validate or not.
+    //
+    SAXParser parser;
+    parser.setDoValidation(doValidation);
+
+    //
+    //  Create our SAX handler object and install it on the parser, as the
+    //  document, entity and error handlers.
+    //
+    RedirectHandlers handler;
+    parser.setDocumentHandler(&handler);
+    parser.setErrorHandler(&handler);
+    parser.setEntityResolver(&handler);
+
+    //
+    //  Get the starting time and kick off the parse of the indicated file.
+    //  Catch any exceptions that might propogate out of it.
+    //
+    unsigned long duration;
+    try
+    {
+        const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
+        parser.parse(xmlFile);
+        const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
+        duration = endMillis - startMillis;
+    }
+
+    catch (const XMLException& e)
+    {
+        cerr << "\nError during parsing: '" << xmlFile << "'\n"
+                << "Exception message is:  \n"
+                << StrX(e.getMessage()) << "\n" << endl;
+        return -1;
+    }
+
+    // Print out the stats that we collected and time taken.
+    cout << xmlFile << ": " << duration << " ms ("
+         << handler.getElementCount() << " elems, "
+         << handler.getAttrCount() << " attrs, "
+         << handler.getSpaceCount() << " spaces, "
+         << handler.getCharacterCount() << " chars)" << endl;
+
+    return 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/Redirect/Redirect.hpp b/samples/Redirect/Redirect.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..d601b0ed016b0e842e627ad5455687097b0eaf2c
--- /dev/null
+++ b/samples/Redirect/Redirect.hpp
@@ -0,0 +1,131 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:38  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:39  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes for all the program files to see
+// ---------------------------------------------------------------------------
+#include <stdlib.h>
+#include <string.h>
+#include <iostream.h>
+#include <util/PlatformUtils.hpp>
+#include "RedirectHandlers.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/Redirect/RedirectHandlers.cpp b/samples/Redirect/RedirectHandlers.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..82e916c63a3e27a85ce0f805af9073c4f5a8d051
--- /dev/null
+++ b/samples/Redirect/RedirectHandlers.cpp
@@ -0,0 +1,214 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:38  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:43:39  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/XMLUni.hpp>
+#include <internal/URLInputSource.hpp>
+#include <sax/AttributeList.hpp>
+#include <sax/SAXParseException.hpp>
+#include <sax/SAXException.hpp>
+#include <memory.h>
+#include "Redirect.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  Local constant data
+//
+//  gFileToTrap
+//      This is the file that we are looking for in the entity handler, to
+//      redirect to another file.
+//
+//  gRedirectToFile
+//      This is the file that we are going to redirect the parser to.
+// ---------------------------------------------------------------------------
+static const XMLCh  gFileToTrap[] =
+{
+        chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_o, chLatin_n
+    ,   chLatin_a, chLatin_l, chPeriod,  chLatin_d, chLatin_t, chLatin_d, chNull
+};
+
+static const XMLCh  gRedirectToFile[] =
+{
+        chLatin_r, chLatin_e, chLatin_d, chLatin_i, chLatin_r, chLatin_e
+    ,   chLatin_c, chLatin_t, chPeriod,  chLatin_d, chLatin_t, chLatin_d, chNull
+};
+
+
+// ---------------------------------------------------------------------------
+//  RedirectHandlers: Constructors and Destructor
+// ---------------------------------------------------------------------------
+RedirectHandlers::RedirectHandlers() :
+
+    fElementCount(0)
+    , fAttrCount(0)
+    , fCharacterCount(0)
+    , fSpaceCount(0)
+{
+}
+
+RedirectHandlers::~RedirectHandlers()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  RedirectHandlers: Implementation of the SAX DocumentHandler interface
+// ---------------------------------------------------------------------------
+void RedirectHandlers::startElement(const   XMLCh* const    name
+                                    ,       AttributeList&  attributes)
+{
+    fElementCount++;
+    fAttrCount += attributes.getLength();
+}
+
+void RedirectHandlers::characters(  const   XMLCh* const    chars
+                                    , const unsigned int    length)
+{
+    fCharacterCount += length;
+}
+
+void RedirectHandlers::ignorableWhitespace( const   XMLCh* const chars
+                                            , const unsigned int length)
+{
+    fSpaceCount += length;
+}
+
+void RedirectHandlers::resetDocument()
+{
+    fAttrCount = 0;
+    fCharacterCount = 0;
+    fElementCount = 0;
+    fSpaceCount = 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  RedirectHandlers: Overrides of the SAX ErrorHandler interface
+// ---------------------------------------------------------------------------
+void RedirectHandlers::error(const SAXParseException& e)
+{
+    cerr << "\nError at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void RedirectHandlers::fatalError(const SAXParseException& e)
+{
+    cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void RedirectHandlers::warning(const SAXParseException& e)
+{
+    cerr << "\nWarning at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+
+// -----------------------------------------------------------------------
+//  Handlers for the SAX EntityResolver interface
+// -----------------------------------------------------------------------
+InputSource* RedirectHandlers::resolveEntity(const   XMLCh* const    publicId
+                                             , const XMLCh* const    systemId)
+{
+    //
+    //  If its our file, then create a new URL input source for the file that
+    //  we want to really be used. Otherwise, just return zero to let the
+    //  default action occur.
+    //
+    //  We cannot assume that the XMLCh type is ok to pass to wcscmp(), so
+    //  just do a comparison ourselves.
+    //
+    const XMLCh* s1 = publicId;
+    const XMLCh* s2 = systemId;
+    while (true)
+    {
+        // Break out on any difference
+        if (*s1 != *s2)
+            return 0;
+
+        // If one is null, then both were null, so they are equal
+        if (!*s1)
+            break;
+
+        // Else get the next char
+        s1++;
+        s2++;
+    }
+
+    // They were equal, so redirect to our other file
+    return new URLInputSource(gRedirectToFile);
+}
diff --git a/samples/Redirect/RedirectHandlers.hpp b/samples/Redirect/RedirectHandlers.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..bd14660d6ec3ee56a507f54095491758792196c0
--- /dev/null
+++ b/samples/Redirect/RedirectHandlers.hpp
@@ -0,0 +1,151 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:38  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:43:39  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/HandlerBase.hpp>
+class AttributeList;
+
+
+class RedirectHandlers : public HandlerBase
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    RedirectHandlers();
+    ~RedirectHandlers();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getElementCount()
+    {
+        return fElementCount;
+    }
+
+    unsigned int getAttrCount()
+    {
+        return fAttrCount;
+    }
+
+    unsigned int getCharacterCount()
+    {
+        return fCharacterCount;
+    }
+
+    unsigned int getSpaceCount()
+    {
+        return fSpaceCount;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX DocumentHandler interface
+    // -----------------------------------------------------------------------
+    void startElement(const XMLCh* const name, AttributeList& attributes);
+    void characters(const XMLCh* const chars, const unsigned int length);
+    void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
+    void resetDocument();
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX ErrorHandler interface
+    // -----------------------------------------------------------------------
+    void warning(const SAXParseException& exception);
+    void error(const SAXParseException& exception);
+    void fatalError(const SAXParseException& exception);
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX EntityResolver interface
+    // -----------------------------------------------------------------------
+    InputSource* resolveEntity
+    (
+        const   XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    );
+
+
+private:
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fAttrCount
+    //  fCharacterCount
+    //  fElementCount
+    //  fSpaceCount
+    //      These are just counters that are run upwards based on the input
+    //      from the document handlers.
+    // -----------------------------------------------------------------------
+    unsigned int    fAttrCount;
+    unsigned int    fCharacterCount;
+    unsigned int    fElementCount;
+    unsigned int    fSpaceCount;
+};
diff --git a/samples/SAXCount/Makefile.in b/samples/SAXCount/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..fe5ef5a7a0fca04943a8276a4bc39bee2b0c6e05
--- /dev/null
+++ b/samples/SAXCount/Makefile.in
@@ -0,0 +1,118 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:30  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:43:40  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+include ../Makefile.incl
+
+APP_NAME=SAXCount
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/SAXCount.o ${OUTDIR}/SAXCountHandlers.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+HEADER_FILES=${SRC}/SAXCount.hpp ${SRC}/SAXCountHandlers.hpp
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/SAXCount.o: ${SRC}/SAXCount.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/SAXCount.o ${SRC}/SAXCount.cpp
+
+$(OUTDIR)/SAXCountHandlers.o: ${SRC}/SAXCountHandlers.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/SAXCountHandlers.o ${SRC}/SAXCountHandlers.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/SAXCount/SAXCount.cpp b/samples/SAXCount/SAXCount.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8c7eff6734e3f555558949022ed1fc361863a4d9
--- /dev/null
+++ b/samples/SAXCount/SAXCount.cpp
@@ -0,0 +1,250 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:30  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:43:40  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include "SAXCount.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  Local helper methods
+// ---------------------------------------------------------------------------
+void usage()
+{
+    cout << "\nUsage:\n"
+         << "    SAXCount [-v] <XML file>\n"
+         << "    -v  Do a validating parse. Defaults to non-validating.\n"
+         << "This program prints the number of elements, attributes,\n"
+         << "white spaces and other non-white space characters in the "
+         << "input file.\n" << endl;
+}
+
+
+// ---------------------------------------------------------------------------
+//  Program entry point
+// ---------------------------------------------------------------------------
+int main(int argc, char* args[])
+{
+    // Initialize the XML4C2 system
+    try
+    {
+         XMLPlatformUtils::Initialize();
+    }
+
+    catch (const XMLException& toCatch)
+    {
+         cerr << "Error during initialization! Message:\n"
+              << StrX(toCatch.getMessage()) << endl;
+         return 1;
+    }
+
+    // We only have one required parameter, which is the file to process
+    if (argc < 2)
+    {
+        usage();
+        return -1;
+    }
+    const char* xmlFile = args[1];
+    bool  doValidation = false;
+
+    // Check for some special cases values of the parameter
+    if (!strncmp(xmlFile, "-?", 2))
+    {
+        usage();
+        return 0;
+    }
+     else if (!strncmp(xmlFile, "-v", 2))
+    {
+        doValidation = true;
+        if (argc < 3)
+        {
+            usage();
+            return -1;
+        }
+        xmlFile = args[2];
+    }
+     else if (xmlFile[0] == '-')
+    {
+        usage();
+        return -1;
+    }
+
+    //
+    //  Create a SAX parser object. Then, according to what we were told on
+    //  the command line, set it to validate or not.
+    //
+    SAXParser parser;
+    parser.setDoValidation(doValidation);
+
+    //
+    //  Create our SAX handler object and install it on the parser, as the
+    //  document and error handler.
+    //
+    SAXCountHandlers handler;
+    parser.setDocumentHandler(&handler);
+    parser.setErrorHandler(&handler);
+
+    //
+    //  Get the starting time and kick off the parse of the indicated
+    //  file. Catch any exceptions that might propogate out of it.
+    //
+    unsigned long duration;
+    try
+    {
+        const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
+        parser.parse(xmlFile);
+        const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
+        duration = endMillis - startMillis;
+    }
+
+    catch (const XMLException& e)
+    {
+        cerr << "\nError during parsing: '" << xmlFile << "'\n"
+             << "Exception message is:  \n"
+             << StrX(e.getMessage()) << "\n" << endl;
+        return -1;
+    }
+
+    // Print out the stats that we collected and time taken
+    cout << xmlFile << ": " << duration << " ms ("
+         << handler.getElementCount() << " elems, "
+         << handler.getAttrCount() << " attrs, "
+         << handler.getSpaceCount() << " spaces, "
+         << handler.getCharacterCount() << " chars)" << endl;
+
+    return 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/SAXCount/SAXCount.hpp b/samples/SAXCount/SAXCount.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..6ef3f01df8e76c3b0266a5cc850537b71a058eba
--- /dev/null
+++ b/samples/SAXCount/SAXCount.hpp
@@ -0,0 +1,132 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:31  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:40  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes for all the program files to see
+// ---------------------------------------------------------------------------
+#include <stdlib.h>
+#include <string.h>
+#include <iostream.h>
+#include <util/PlatformUtils.hpp>
+#include <parsers/SAXParser.hpp>
+#include "SAXCountHandlers.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/SAXCount/SAXCountHandlers.cpp b/samples/SAXCount/SAXCountHandlers.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2a06e7b23eee58ddb7e8b46c8601d4bfcc7d262e
--- /dev/null
+++ b/samples/SAXCount/SAXCountHandlers.cpp
@@ -0,0 +1,150 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:31  twl
+ * Initial revision
+ *
+ * Revision 1.8  1999/11/08 20:43:40  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include "SAXCount.hpp"
+#include <sax/AttributeList.hpp>
+#include <sax/SAXParseException.hpp>
+#include <sax/SAXException.hpp>
+
+
+
+// ---------------------------------------------------------------------------
+//  SAXCountHandlers: Constructors and Destructor
+// ---------------------------------------------------------------------------
+SAXCountHandlers::SAXCountHandlers() :
+
+    fElementCount(0)
+    , fAttrCount(0)
+    , fCharacterCount(0)
+    , fSpaceCount(0)
+{
+}
+
+SAXCountHandlers::~SAXCountHandlers()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXCountHandlers: Implementation of the SAX DocumentHandler interface
+// ---------------------------------------------------------------------------
+void SAXCountHandlers::startElement(const   XMLCh* const    name
+                                    ,       AttributeList&  attributes)
+{
+    fElementCount++;
+    fAttrCount += attributes.getLength();
+}
+
+void SAXCountHandlers::characters(  const   XMLCh* const    chars
+								    , const unsigned int    length)
+{
+    fCharacterCount += length;
+}
+
+void SAXCountHandlers::ignorableWhitespace( const   XMLCh* const chars
+										    , const unsigned int length)
+{
+    fSpaceCount += length;
+}
+
+void SAXCountHandlers::resetDocument()
+{
+    fAttrCount = 0;
+    fCharacterCount = 0;
+    fElementCount = 0;
+    fSpaceCount = 0;
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXCountHandlers: Overrides of the SAX ErrorHandler interface
+// ---------------------------------------------------------------------------
+void SAXCountHandlers::error(const SAXParseException& e)
+{
+    cerr << "\nError at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void SAXCountHandlers::fatalError(const SAXParseException& e)
+{
+    cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void SAXCountHandlers::warning(const SAXParseException& e)
+{
+    cerr << "\nWarning at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
diff --git a/samples/SAXCount/SAXCountHandlers.hpp b/samples/SAXCount/SAXCountHandlers.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..664cb86dd2ecca655e0eb46f3aa3710d52c7d16c
--- /dev/null
+++ b/samples/SAXCount/SAXCountHandlers.hpp
@@ -0,0 +1,143 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:32  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:43:41  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/HandlerBase.hpp>
+
+class AttributeList;
+
+class SAXCountHandlers : public HandlerBase
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    SAXCountHandlers();
+    ~SAXCountHandlers();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getElementCount()
+    {
+        return fElementCount;
+    }
+
+    unsigned int getAttrCount()
+    {
+        return fAttrCount;
+    }
+
+    unsigned int getCharacterCount()
+    {
+        return fCharacterCount;
+    }
+
+    unsigned int getSpaceCount()
+    {
+        return fSpaceCount;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX DocumentHandler interface
+    // -----------------------------------------------------------------------
+	void startElement(const XMLCh* const name, AttributeList& attributes);
+    void characters(const XMLCh* const chars, const unsigned int length);
+    void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
+    void resetDocument();
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX ErrorHandler interface
+    // -----------------------------------------------------------------------
+	void warning(const SAXParseException& exception);
+    void error(const SAXParseException& exception);
+    void fatalError(const SAXParseException& exception);
+
+
+private:
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fAttrCount
+    //  fCharacterCount
+    //  fElementCount
+    //  fSpaceCount
+    //      These are just counters that are run upwards based on the input
+    //      from the document handlers.
+    // -----------------------------------------------------------------------
+    unsigned int    fAttrCount;
+    unsigned int    fCharacterCount;
+    unsigned int    fElementCount;
+    unsigned int    fSpaceCount;
+
+
+};
diff --git a/samples/SAXPrint/Makefile.in b/samples/SAXPrint/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..ea08292999b831cc53eb2a7c2c921f834a7c1fd3
--- /dev/null
+++ b/samples/SAXPrint/Makefile.in
@@ -0,0 +1,118 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:28  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:43:41  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+include ../Makefile.incl
+
+APP_NAME=SAXPrint
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/SAXPrint.o ${OUTDIR}/SAXPrintHandlers.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+HEADER_FILES=${SRC}/SAXPrint.hpp ${SRC}/SAXPrintHandlers.hpp
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/SAXPrint.o: ${SRC}/SAXPrint.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/SAXPrint.o ${SRC}/SAXPrint.cpp
+
+$(OUTDIR)/SAXPrintHandlers.o: ${SRC}/SAXPrintHandlers.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/SAXPrintHandlers.o ${SRC}/SAXPrintHandlers.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/SAXPrint/SAXPrint.cpp b/samples/SAXPrint/SAXPrint.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e4c9865ceedb2beec16d043122e0c9ac8aae0b80
--- /dev/null
+++ b/samples/SAXPrint/SAXPrint.cpp
@@ -0,0 +1,275 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:28  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:43:41  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/PlatformUtils.hpp>
+#include <internal/URLInputSource.hpp>
+#include <parsers/SAXParser.hpp>
+#include "SAXPrint.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  Local data
+//
+//  xmlFile
+//      The path to the file to parser. Set via command line.
+//
+//  doValidation
+//      Indicates whether the validating or non-validating parser should be
+//      used. Defaults to validating, -NV overrides.
+// ---------------------------------------------------------------------------
+static char*    xmlFile         = 0;
+static bool     doEscapes       = true;
+static bool     doValidation    = false;
+
+
+// ---------------------------------------------------------------------------
+//  Local helper methods
+// ---------------------------------------------------------------------------
+static void usage()
+{
+    cout <<  "\nUsage: SAXPrint [options] file\n"
+         <<  "   This program prints the data returned by various SAX\n"
+         <<  "   handlers for the specified input file.\n\n"
+         <<  "   Options:\n"
+         <<  "     -NoEscape   Don't escape special characters in output\n"
+         <<  "     -v          Invoke the Validating SAX Parser.\n"
+         <<  "     -?          Show this help\n"
+         <<  endl;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  Program entry point
+// ---------------------------------------------------------------------------
+int main(int argC, char* argV[])
+{
+    unsigned int parmInd = 0;
+
+    // Initialize the XML4C2 system
+    try
+    {
+         XMLPlatformUtils::Initialize();
+    }
+
+    catch (const XMLException& toCatch)
+    {
+         cerr << "Error during initialization! :\n"
+              << StrX(toCatch.getMessage()) << endl;
+         return 1;
+    }
+
+    // Check command line and extract arguments.
+    if (argC < 2)
+    {
+        usage();
+        return 1;
+    }
+
+    // Watch for special case help request
+    if (strcmp(argV[1], "-?") == 0)
+    {
+        usage();
+        return 0;
+    }
+
+    for (parmInd = 1; parmInd < (unsigned int)argC; parmInd++)
+    {
+        // Break out on first parm not starting with a dash
+        if (argV[parmInd][0] != '-')
+            break;
+
+        if (!strcmp(argV[parmInd], "-v")
+        ||  !strcmp(argV[parmInd], "-V"))
+        {
+            doValidation = true;
+        }
+         else if (!strcmp(argV[parmInd], "-NoEscape"))
+        {
+            doEscapes = false;
+        }
+         else
+        {
+            usage();
+            return 1;
+        }
+    }
+
+    //
+    //  And now we have to have only one parameter left and it must be
+    //  the file name.
+    //
+    if (parmInd + 1 != (unsigned int)argC)
+    {
+        usage();
+        return 1;
+    }
+    xmlFile = argV[parmInd];
+
+    //
+    //  Create a SAX parser object. Then, according to what we were told on
+    //  the command line, set it to validate or not.
+    //
+    SAXParser parser;
+    parser.setDoValidation(doValidation);
+
+    //
+    //  Create the handler object and install it as the document and error
+    //  handler for the parser.
+    //
+    SAXPrintHandlers handler(doEscapes);
+    parser.setDocumentHandler(&handler);
+    parser.setErrorHandler(&handler);
+
+    // Parse the file and catch any exceptions that propogate out
+    try
+    {
+        parser.parse(xmlFile);
+    }
+
+    catch (const XMLException& toCatch)
+    {
+        cerr << "\nFile not found: '" << xmlFile << "'\n"
+             << "Exception message is: \n"
+             << StrX(toCatch.getMessage())
+             << "\n" << endl;
+        return -1;
+    }
+
+    return 0;
+}
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/SAXPrint/SAXPrint.hpp b/samples/SAXPrint/SAXPrint.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..84782854886c4cafff9f1c0dc92cfd385a3e559d
--- /dev/null
+++ b/samples/SAXPrint/SAXPrint.hpp
@@ -0,0 +1,129 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:29  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:43:41  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes for all the program files to see
+// ---------------------------------------------------------------------------
+#include <string.h>
+#include <iostream.h>
+#include <stdlib.h>
+#include "SAXPrintHandlers.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/SAXPrint/SAXPrintHandlers.cpp b/samples/SAXPrint/SAXPrintHandlers.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c0127f90e947e23e17bb64c1ac74fe4623c66db1
--- /dev/null
+++ b/samples/SAXPrint/SAXPrintHandlers.cpp
@@ -0,0 +1,230 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:29  twl
+ * Initial revision
+ *
+ * Revision 1.11  1999/11/08 20:43:42  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/XMLUni.hpp>
+#include <sax/AttributeList.hpp>
+#include "SAXPrint.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  SAXPrintHandlers: Constructors and Destructor
+// ---------------------------------------------------------------------------
+SAXPrintHandlers::SAXPrintHandlers(const bool doEscapes) :
+
+    fDoEscapes(doEscapes)
+{
+}
+
+SAXPrintHandlers::~SAXPrintHandlers()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXPrintHandlers: Overrides of the SAX ErrorHandler interface
+// ---------------------------------------------------------------------------
+void SAXPrintHandlers::error(const SAXParseException& e)
+{
+    cerr << "\nError at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void SAXPrintHandlers::fatalError(const SAXParseException& e)
+{
+    cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void SAXPrintHandlers::warning(const SAXParseException& e)
+{
+    cerr << "\nWarning at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXPrintHandlers: Overrides of the SAX DTDHandler interface
+// ---------------------------------------------------------------------------
+void SAXPrintHandlers::unparsedEntityDecl(const     XMLCh* const name
+                                          , const   XMLCh* const publicId
+                                          , const   XMLCh* const systemId
+                                          , const   XMLCh* const notationName)
+{
+    // Not used at this time
+}
+
+
+void SAXPrintHandlers::notationDecl(                                               const   XMLCh* const name
+                                    , const XMLCh* const publicId
+                                    , const XMLCh* const systemId)
+{
+    // Not used at this time
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXPrintHandlers: Overrides of the SAX DocumentHandler interface
+// ---------------------------------------------------------------------------
+void SAXPrintHandlers::characters(const     XMLCh* const    chars
+                                  , const   unsigned int    length)
+{
+    // Transcode to UTF-8 for portable display
+    StrX tmpXCode(chars, length);
+	const char* tmpText = tmpXCode.localForm();
+
+    //
+    //  If we were asked to escape special chars, then do that. Else just
+    //  display it as normal text.
+    //
+    if (fDoEscapes)
+    {
+        for (unsigned int index = 0; index < length; index++)
+        {
+            switch (tmpText[index])
+            {
+            case chAmpersand :
+                cout << "&amp;";
+                break;
+
+            case chOpenAngle :
+                cout << "&lt;";
+                break;
+
+            case chCloseAngle:
+                cout << "&gt;";
+                break;
+
+            case chDoubleQuote :
+                cout << "&quot;";
+                break;
+
+            default:
+                cout << tmpText[index];
+                break;
+            }
+        }
+    }
+     else
+    {
+        cout << tmpText;
+    }
+}
+
+
+void SAXPrintHandlers::endDocument()
+{
+}
+
+void SAXPrintHandlers::endElement(const XMLCh* const name)
+{
+    cout << "</" << StrX(name) << ">";
+}
+
+void SAXPrintHandlers::ignorableWhitespace( const   XMLCh* const chars
+                                            ,const  unsigned int length)
+{
+    cout << StrX(chars, length);
+}
+
+void SAXPrintHandlers::processingInstruction(const  XMLCh* const target
+                                            , const XMLCh* const data)
+{
+    cout << "<?" << StrX(target);
+    if (data)
+        cout << " " << StrX(data);
+    cout << "?>\n";
+}
+
+void SAXPrintHandlers::startDocument()
+{
+}
+
+void SAXPrintHandlers::startElement(const   XMLCh* const    name
+                                    ,       AttributeList&  attributes)
+{
+    cout << "<" << StrX(name);
+    unsigned int len = attributes.getLength();
+
+    for (unsigned int index = 0; index < len; index++)
+    {
+        cout << " " << StrX(attributes.getName(index)) << "=\"";
+		cout << StrX(attributes.getValue(index)) << "\"";
+    }
+    cout << ">";
+}
+
+
diff --git a/samples/SAXPrint/SAXPrintHandlers.hpp b/samples/SAXPrint/SAXPrintHandlers.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..d55572468aebf5e2465299e745c16d3bc883105a
--- /dev/null
+++ b/samples/SAXPrint/SAXPrintHandlers.hpp
@@ -0,0 +1,144 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:29  twl
+ * Initial revision
+ *
+ * Revision 1.8  1999/11/08 20:43:42  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include    <sax/HandlerBase.hpp>
+
+class SAXPrintHandlers : public HandlerBase
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors
+    // -----------------------------------------------------------------------
+    SAXPrintHandlers(const bool doEscapes);
+    ~SAXPrintHandlers();
+
+
+    // -----------------------------------------------------------------------
+    //  Implementations of the SAX DocumentHandler interface
+    // -----------------------------------------------------------------------
+    void endDocument();
+
+    void endElement(const XMLCh* const name);
+
+    void characters(const XMLCh* const chars, const unsigned int length);
+
+    void ignorableWhitespace
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+    );
+
+    void processingInstruction
+    (
+        const   XMLCh* const    target
+        , const XMLCh* const    data
+    );
+
+    void startDocument();
+
+    void startElement(const XMLCh* const name, AttributeList& attributes);
+
+
+
+    // -----------------------------------------------------------------------
+    //  Implementations of the SAX ErrorHandler interface
+    // -----------------------------------------------------------------------
+    void warning(const SAXParseException& exception);
+    void error(const SAXParseException& exception);
+    void fatalError(const SAXParseException& exception);
+
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the SAX DTDHandler interface
+    // -----------------------------------------------------------------------
+    void notationDecl
+    (
+        const   XMLCh* const    name
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    );
+
+    void unparsedEntityDecl
+    (
+        const   XMLCh* const    name
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+        , const XMLCh* const    notationName
+    );
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fDoEscapes
+    //      Indicates whether characters should be escaped via char refs if
+    //      they would normally be in that place in a legal XML file.
+    // -----------------------------------------------------------------------
+    bool    fDoEscapes;
+};
diff --git a/samples/StdInParse/Makefile.in b/samples/StdInParse/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..fbd221553e11a7e5bd0f1818fca54a33a4213d6b
--- /dev/null
+++ b/samples/StdInParse/Makefile.in
@@ -0,0 +1,118 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:26  twl
+# Initial revision
+#
+# Revision 1.2  1999/11/08 20:43:42  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+###################################################################
+#                    IMPORTANT NOTE                               #
+###################################################################
+# If you are going to do the OS390BATCH build, make sure you have #
+# the OS390BATCH environment variable set.                        #
+#                                                                 #
+#   export OS390BATCH=1                                           #
+#                                                                 #
+###################################################################
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+
+include ../Makefile.incl
+
+APP_NAME=StdInParse
+
+OUTDIR= ${XML4CROOT}/bin/obj/${APP_NAME}
+EXEC=	${XML4CROOT}/bin
+OBJS=	${OUTDIR}/StdInParse.o ${OUTDIR}/StdInParseHandlers.o
+SRC=	${XML4CROOT}/samples/${APP_NAME}
+HEADER_FILES=${SRC}/StdInParse.hpp ${SRC}/StdInParseHandlers.hpp
+
+## OS390BATCH
+ifeq (${OS390BATCH},1)
+BATCH_TARGET= "//'${LOADMOD}(${APP_NAME})'"
+all: makedir ${BATCH_TARGET}
+else
+all: makedir ${EXEC}/${APP_NAME}
+endif
+
+makedir:
+	-mkdir -p $(OUTDIR)
+
+${EXEC}/${APP_NAME}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+${BATCH_TARGET}: ${OBJS}
+	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS} 
+
+$(OUTDIR)/StdInParse.o: ${SRC}/StdInParse.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/StdInParse.o ${SRC}/StdInParse.cpp
+
+$(OUTDIR)/StdInParseHandlers.o: ${SRC}/StdInParseHandlers.cpp ${HEADER_FILES}
+	${CC} ${CMP} $(INCLUDES) -o $(OUTDIR)/StdInParseHandlers.o ${SRC}/StdInParseHandlers.cpp
+
+clean:
+	rm -f ${OBJS} ${EXEC}/${APP_NAME}
+
+distclean:	clean
+	rm -f Makefile
diff --git a/samples/StdInParse/StdInParse.cpp b/samples/StdInParse/StdInParse.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a1a20d894d139efcb2d426c512247ac68de27446
--- /dev/null
+++ b/samples/StdInParse/StdInParse.cpp
@@ -0,0 +1,259 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:27  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:43  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <internal/StdInInputSource.hpp>
+#include <parsers/SAXParser.hpp>
+#include "StdInParse.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  Local data
+//
+//  doNamespaces
+//      Indicates whether namespace processing should be enabled or not.
+//      The default is no, but -ns overrides that.
+//
+//  doValidation
+//      Indicates whether validation should be done. The default is not
+//      to validate, but -v overrides that.
+// ---------------------------------------------------------------------------
+static bool     doNamespaces    = false;
+static bool     doValidation    = false;
+
+
+
+// ---------------------------------------------------------------------------
+//  Local helper methods
+// ---------------------------------------------------------------------------
+void usage()
+{
+    cout << "\nUsage:\n"
+         << "    StdInParse [options]\n"
+         << "    -v  Do a validating parse. Defaults to non-validating.\n"
+         << "    -ns Enable namespace processing.\n\n"
+         << "This program allows you to redirect a file into the program\n"
+         << "to be parsed. It will count the elements, characters, and \n"
+         << "spaces and display these stats at the end\n"
+         << endl;
+}
+
+
+// ---------------------------------------------------------------------------
+//  Program entry point
+// ---------------------------------------------------------------------------
+int main(int argC, char* argV[])
+{
+    // Initialize the XML4C system
+    try
+    {
+         XMLPlatformUtils::Initialize();
+    }
+
+    catch (const XMLException& toCatch)
+    {
+         cerr << "Error during initialization! Message:\n"
+              << StrX(toCatch.getMessage()) << endl;
+         return 1;
+    }
+
+    unsigned int parmInd;
+    for (parmInd = 1; parmInd < (unsigned int)argC; parmInd++)
+    {
+        if (!strcmp(argV[parmInd], "-v")
+        ||  !strcmp(argV[parmInd], "-V"))
+        {
+            doValidation = true;
+        }
+         else if (!strcmp(argV[parmInd], "-NS")
+              ||  !strcmp(argV[parmInd], "-ns"))
+        {
+            doNamespaces = true;
+        }
+         else
+        {
+            usage();
+            return 1;
+        }
+    }
+
+    //
+    //  Create a SAX parser object. Then, according to what we were told on
+    //  the command line, set the options.
+    //
+    SAXParser parser;
+    parser.setDoValidation(doValidation);
+    parser.setDoNamespaces(doNamespaces);
+
+
+    //
+    //  Create our SAX handler object and install it on the parser, as the
+    //  document and error handler. We are responsible for cleaning them
+    //  up, but since its just stack based here, there's nothing special
+    //  to do.
+    //
+    StdInParseHandlers handler;
+    parser.setDocumentHandler(&handler);
+    parser.setErrorHandler(&handler);
+
+    //
+    //  Kick off the parse and catch any exceptions. Create a standard
+    //  input input source and tell the parser to parse from that.
+    //
+    try
+    {
+        StdInInputSource src;
+        parser.parse(src);
+    }
+
+    catch (const XMLException& e)
+    {
+        cerr << "\nError during parsing: \n"
+             << StrX(e.getMessage())
+             << "\n" << endl;
+        return -1;
+    }
+
+    // Print out the stats that we collected and time taken
+    cout << handler.getElementCount() << " elems, "
+         << handler.getAttrCount() << " attrs, "
+         << handler.getSpaceCount() << " spaces, "
+         << handler.getCharacterCount() << " chars)" << endl;
+
+    return 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  StrX: Private helper methods
+// ---------------------------------------------------------------------------
+void StrX::transcode(const XMLCh* const toTranscode, const unsigned int len)
+{
+    // Short circuit if its a null pointer
+    if (!toTranscode || (!toTranscode[0]))
+    {
+        fLocalForm = new char[1];
+        fLocalForm[0] = 0;
+        return;
+	}
+
+    // See if our XMLCh and wchar_t as the same on this platform
+    const bool isSameSize = (sizeof(XMLCh) == sizeof(wchar_t));
+
+    //
+    //  Get the actual number of chars. If the passed len is zero, its null
+    //  terminated. Else we have to use the len.
+    //
+    wchar_t realLen = (wchar_t)len;
+    if (!realLen)
+    {
+        //
+        //  We cannot just assume we can use wcslen() because we don't know
+        //  if our XMLCh is the same as wchar_t on this platform.
+        //
+        const XMLCh* tmpPtr = toTranscode;
+        while (*(tmpPtr++))
+            realLen++;
+    }
+
+    //
+    //  If either the passed length was non-zero or our char sizes are not 
+    //  same, we have to use a temp buffer. Since this is common in these
+    //  samples, we just do it anyway.
+    //
+    wchar_t* tmpSource = new wchar_t[realLen + 1];
+    if (isSameSize)
+    {
+        memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
+    }
+     else
+    {
+        for (unsigned int index = 0; index < realLen; index++)
+            tmpSource[index] = (wchar_t)toTranscode[index];
+    }
+    tmpSource[realLen] = 0;
+
+    // See now many chars we need to transcode this guy
+    const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
+
+    // Allocate out storage member
+    fLocalForm = new char[targetLen + 1];
+
+    //
+    //  And transcode our temp source buffer to the local buffer. Cap it
+    //  off since the converter won't do it (because the null is beyond
+    //  where the target will fill up.)
+    //
+    ::wcstombs(fLocalForm, tmpSource, targetLen);
+    fLocalForm[targetLen] = 0;
+
+    // Don't forget to delete our temp buffer
+    delete [] tmpSource;
+}
diff --git a/samples/StdInParse/StdInParse.hpp b/samples/StdInParse/StdInParse.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..8259064f72b68e5a9bd07a4637118dd702a16f5e
--- /dev/null
+++ b/samples/StdInParse/StdInParse.hpp
@@ -0,0 +1,134 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:27  twl
+ * Initial revision
+ *
+ * Revision 1.1  1999/11/08 23:03:21  rahul
+ * Changed extension from .Hpp to .hpp
+ *
+ * Revision 1.4  1999/11/08 20:43:42  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes for all the program files to see
+// ---------------------------------------------------------------------------
+#include <string.h>
+#include <stdlib.h>
+#include <iostream.h>
+#include <util/PlatformUtils.hpp>
+#include "StdInParseHandlers.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  This is a simple class that lets us do easy (though not terribly efficient)
+//  trancoding of XMLCh data to local code page for display.
+// ---------------------------------------------------------------------------
+class StrX
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+	StrX(const XMLCh* const toTranscode, const unsigned int len = 0) :
+
+        fLocalForm(0)
+    {
+        // Call the private transcoding method
+        transcode(toTranscode, len);
+    }
+
+    ~StrX()
+    {
+        delete [] fLocalForm;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const char* localForm() const
+    {
+        return fLocalForm;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+	void transcode (const XMLCh* const toTranscode, const unsigned int len);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fLocalForm
+    //      This is the local code page form of the string.
+    // -----------------------------------------------------------------------
+    char*   fLocalForm;
+};
+
+inline ostream& operator<<(ostream& target, const StrX& toDump)
+{
+    target << toDump.localForm();
+    return target;
+}
diff --git a/samples/StdInParse/StdInParseHandlers.cpp b/samples/StdInParse/StdInParseHandlers.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..70fd359ebbbd0e40a8d8a9b410ebcff61c826dc6
--- /dev/null
+++ b/samples/StdInParse/StdInParseHandlers.cpp
@@ -0,0 +1,157 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:27  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:43  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/AttributeList.hpp>
+#include <sax/SAXParseException.hpp>
+#include <sax/SAXException.hpp>
+#include "StdInParse.hpp"
+
+
+// ---------------------------------------------------------------------------
+//  StdInParseHandlers: Constructors and Destructor
+// ---------------------------------------------------------------------------
+StdInParseHandlers::StdInParseHandlers() :
+
+    fElementCount(0)
+    , fAttrCount(0)
+    , fCharacterCount(0)
+    , fSpaceCount(0)
+{
+}
+
+StdInParseHandlers::~StdInParseHandlers()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  StdInParseHandlers: Implementation of the SAX DocumentHandler interface
+// ---------------------------------------------------------------------------
+void StdInParseHandlers::endElement(const XMLCh* const name)
+{
+}
+
+void
+StdInParseHandlers::startElement(   const   XMLCh* const    name
+                                    ,       AttributeList&  attributes)
+{
+    fElementCount++;
+    fAttrCount += attributes.getLength();
+}
+
+void StdInParseHandlers::characters(const   XMLCh* const    chars
+								    , const unsigned int    length)
+{
+    fCharacterCount += length;
+}
+
+void StdInParseHandlers::ignorableWhitespace(const  XMLCh* const chars
+										    , const unsigned int length)
+{
+    fSpaceCount += length;
+}
+
+void StdInParseHandlers::resetDocument()
+{
+    fAttrCount = 0;
+    fCharacterCount = 0;
+    fElementCount = 0;
+    fSpaceCount = 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  StdInParseHandlers: Overrides of the SAX ErrorHandler interface
+// ---------------------------------------------------------------------------
+void StdInParseHandlers::error(const SAXParseException& e)
+{
+    cerr << "\nError at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void StdInParseHandlers::fatalError(const SAXParseException& e)
+{
+    cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
+
+void StdInParseHandlers::warning(const SAXParseException& e)
+{
+    cerr << "\nWarning at (file " << StrX(e.getSystemId())
+		 << ", line " << e.getLineNumber()
+		 << ", char " << e.getColumnNumber()
+         << "): " << StrX(e.getMessage()) << endl;
+}
diff --git a/samples/StdInParse/StdInParseHandlers.hpp b/samples/StdInParse/StdInParseHandlers.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..971f22eeedf886a197cd94a668124ff55dc44ac2
--- /dev/null
+++ b/samples/StdInParse/StdInParseHandlers.hpp
@@ -0,0 +1,142 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:28  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:43:43  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/HandlerBase.hpp>
+class AttributeList;
+
+
+class StdInParseHandlers : public HandlerBase
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    StdInParseHandlers();
+    ~StdInParseHandlers();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getElementCount()
+    {
+        return fElementCount;
+    }
+
+    unsigned int getAttrCount()
+    {
+        return fAttrCount;
+    }
+
+    unsigned int getCharacterCount()
+    {
+        return fCharacterCount;
+    }
+
+    unsigned int getSpaceCount()
+    {
+        return fSpaceCount;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX DocumentHandler interface
+    // -----------------------------------------------------------------------
+    void endElement(const XMLCh* const name);
+	void startElement(const XMLCh* const name, AttributeList& attributes);
+    void characters(const XMLCh* const chars, const unsigned int length);
+    void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
+    void resetDocument();
+
+
+    // -----------------------------------------------------------------------
+    //  Handlers for the SAX ErrorHandler interface
+    // -----------------------------------------------------------------------
+	void warning(const SAXParseException& exception);
+    void error(const SAXParseException& exception);
+    void fatalError(const SAXParseException& exception);
+
+
+private:
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fAttrCount
+    //  fCharacterCount
+    //  fElementCount
+    //  fSpaceCount
+    //      These are just counters that are run upwards based on the input
+    //      from the document handlers.
+    // -----------------------------------------------------------------------
+    unsigned int    fAttrCount;
+    unsigned int    fCharacterCount;
+    unsigned int    fElementCount;
+    unsigned int    fSpaceCount;
+};
diff --git a/samples/config.guess b/samples/config.guess
new file mode 100644
index 0000000000000000000000000000000000000000..8d0d2d27feadb5d9a9f9d86886ecad8e533505bf
--- /dev/null
+++ b/samples/config.guess
@@ -0,0 +1,977 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# The master version of this file is at the FSF in /home/gd/gnu/lib.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit system type (host/target name).
+#
+# Only a few systems have been added to this list; please add others
+# (but try to keep the structure clean).
+#
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 8/24/94.)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+        PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    alpha:OSF1:*:*)
+        if test $UNAME_RELEASE = "V4.0"; then
+                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+        fi
+        # A Vn.n version is a released version.
+        # A Tn.n version is a released field test version.
+        # A Xn.n version is an unreleased experimental baselevel.
+        # 1.2 uses "1.2" for uname -r.
+        cat <<EOF >$dummy.s
+        .globl main
+        .ent main
+main:
+        .frame \$30,0,\$26,0
+        .prologue 0
+        .long 0x47e03d80 # implver $0
+        lda \$2,259
+        .long 0x47e20c21 # amask $2,$1
+        srl \$1,8,\$2
+        sll \$2,2,\$2
+        sll \$0,3,\$0
+        addl \$1,\$0,\$0
+        addl \$2,\$0,\$0
+        ret \$31,(\$26),1
+        .end main
+EOF
+        ${CC-cc} $dummy.s -o $dummy 2>/dev/null
+        if test "$?" = 0 ; then
+                ./$dummy
+                case "$?" in
+                        7)
+                                UNAME_MACHINE="alpha"
+                                ;;
+                        15)
+                                UNAME_MACHINE="alphaev5"
+                                ;;
+                        14)
+                                UNAME_MACHINE="alphaev56"
+                                ;;
+                        10)
+                                UNAME_MACHINE="alphapca56"
+                                ;;
+                        16)
+                                UNAME_MACHINE="alphaev6"
+                                ;;
+                esac
+        fi
+        rm -f $dummy.s $dummy
+        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
+        exit 0 ;;
+    21064:Windows_NT:50:3)
+        echo alpha-dec-winnt3.5
+        exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+        echo m68k-cbm-sysv4
+        exit 0;;
+    amiga:NetBSD:*:*)
+      echo m68k-cbm-netbsd${UNAME_RELEASE}
+      exit 0 ;;
+    amiga:OpenBSD:*:*)
+        echo m68k-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+        echo ${UNAME_MACHINE}-unknown-amigaos
+        exit 0 ;;
+    arc64:OpenBSD:*:*)
+        echo mips64el-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    arc:OpenBSD:*:*)
+        echo mipsel-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    hkmips:OpenBSD:*:*)
+        echo mips-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    pmax:OpenBSD:*:*)
+        echo mipsel-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    sgi:OpenBSD:*:*)
+        echo mips-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+        echo mipsel-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+        echo arm-acorn-riscix${UNAME_RELEASE}
+        exit 0;;
+    arm32:NetBSD:*:*)
+        echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+        exit 0 ;;
+    SR2?01:HI-UX/MPP:*:*)
+        echo hppa1.1-hitachi-hiuxmpp
+        exit 0;;
+    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
+        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+        if test "`(/bin/universe) 2>/dev/null`" = att ; then
+                echo pyramid-pyramid-sysv3
+        else
+                echo pyramid-pyramid-bsd
+        fi
+        exit 0 ;;
+    NILE:*:*:dcosx)
+        echo pyramid-pyramid-svr4
+        exit 0 ;;
+    sun4H:SunOS:5.*:*)
+        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+        exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+        exit 0 ;;
+    i86pc:SunOS:5.*:*)
+        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+        exit 0 ;;
+    sun4*:SunOS:6*:*)
+        # According to config.sub, this is the proper way to canonicalize
+        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+        # it's likely to be more like Solaris than SunOS4.
+        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+        exit 0 ;;
+    sun4*:SunOS:*:*)
+        case "`/usr/bin/arch -k`" in
+            Series*|S4*)
+                UNAME_RELEASE=`uname -v`
+                ;;
+        esac
+        # Japanese Language versions have a version number like `4.1.3-JL'.
+        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+        exit 0 ;;
+    sun3*:SunOS:*:*)
+        echo m68k-sun-sunos${UNAME_RELEASE}
+        exit 0 ;;
+    sun*:*:4.2BSD:*)
+        UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+        case "`/bin/arch`" in
+            sun3)
+                echo m68k-sun-sunos${UNAME_RELEASE}
+                ;;
+            sun4)
+                echo sparc-sun-sunos${UNAME_RELEASE}
+                ;;
+        esac
+        exit 0 ;;
+    aushp:SunOS:*:*)
+        echo sparc-auspex-sunos${UNAME_RELEASE}
+        exit 0 ;;
+    atari*:NetBSD:*:*)
+        echo m68k-atari-netbsd${UNAME_RELEASE}
+        exit 0 ;;
+    atari*:OpenBSD:*:*)
+        echo m68k-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    sun3*:NetBSD:*:*)
+        echo m68k-sun-netbsd${UNAME_RELEASE}
+        exit 0 ;;
+    sun3*:OpenBSD:*:*)
+        echo m68k-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    mac68k:NetBSD:*:*)
+        echo m68k-apple-netbsd${UNAME_RELEASE}
+        exit 0 ;;
+    mac68k:OpenBSD:*:*)
+        echo m68k-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+        echo m68k-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+        echo m88k-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    powerpc:machten:*:*)
+        echo powerpc-apple-machten${UNAME_RELEASE}
+        exit 0 ;;
+    macppc:NetBSD:*:*)
+        echo powerpc-apple-netbsd${UNAME_RELEASE}
+        exit 0 ;;
+    RISC*:Mach:*:*)
+        echo mips-dec-mach_bsd4.3
+        exit 0 ;;
+    RISC*:ULTRIX:*:*)
+        echo mips-dec-ultrix${UNAME_RELEASE}
+        exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+        echo vax-dec-ultrix${UNAME_RELEASE}
+        exit 0 ;;
+    2020:CLIX:*:*)
+        echo clipper-intergraph-clix${UNAME_RELEASE}
+        exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+        sed 's/^        //' << EOF >$dummy.c
+        int main (argc, argv) int argc; char **argv; {
+        #if defined (host_mips) && defined (MIPSEB)
+        #if defined (SYSTYPE_SYSV)
+          printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+        #endif
+        #if defined (SYSTYPE_SVR4)
+          printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+        #endif
+        #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+          printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+        #endif
+        #endif
+          exit (-1);
+        }
+EOF
+        ${CC-cc} $dummy.c -o $dummy \
+          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+          && rm $dummy.c $dummy && exit 0
+        rm -f $dummy.c $dummy
+        echo mips-mips-riscos${UNAME_RELEASE}
+        exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+        echo powerpc-harris-powerunix
+        exit 0 ;;
+    m88k:CX/UX:7*:*)
+        echo m88k-harris-cxux7
+        exit 0 ;;
+    m88k:*:4*:R4*)
+        echo m88k-motorola-sysv4
+        exit 0 ;;
+    m88k:*:3*:R3*)
+        echo m88k-motorola-sysv3
+        exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+        if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+             -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+                echo m88k-dg-dgux${UNAME_RELEASE}
+        else
+                echo m88k-dg-dguxbcs${UNAME_RELEASE}
+        fi
+        else echo i586-dg-dgux${UNAME_RELEASE}
+        fi
+        exit 0 ;;
+    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+        echo m88k-dolphin-sysv3
+        exit 0 ;;
+    M88*:*:R3*:*)
+        # Delta 88k system running SVR3
+        echo m88k-motorola-sysv3
+        exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+        echo m88k-tektronix-sysv3
+        exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+        echo m68k-tektronix-bsd
+        exit 0 ;;
+    *:IRIX*:*:*)
+        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+        exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+        echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+        exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i?86:AIX:*:*)
+        echo i386-ibm-aix
+        exit 0 ;;
+    *:AIX:2:3)
+        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+                sed 's/^                //' << EOF >$dummy.c
+                #include <sys/systemcfg.h>
+
+                main()
+                        {
+                        if (!__power_pc())
+                                exit(1);
+                        puts("powerpc-ibm-aix3.2.5");
+                        exit(0);
+                        }
+EOF
+                ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+                rm -f $dummy.c $dummy
+                echo rs6000-ibm-aix3.2.5
+        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+                echo rs6000-ibm-aix3.2.4
+        else
+                echo rs6000-ibm-aix3.2
+        fi
+        exit 0 ;;
+    *:AIX:*:4)
+        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+        if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
+                IBM_ARCH=rs6000
+        else
+                IBM_ARCH=powerpc
+        fi
+        if [ -x /usr/bin/oslevel ] ; then
+                IBM_REV=`/usr/bin/oslevel`
+        else
+                IBM_REV=4.${UNAME_RELEASE}
+        fi
+        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+        exit 0 ;;
+    *:AIX:*:*)
+        echo rs6000-ibm-aix
+        exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+        echo romp-ibm-bsd4.4
+        exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
+        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+        exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+        echo rs6000-bull-bosx
+        exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+        echo m68k-bull-sysv3
+        exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+        echo m68k-hp-bsd
+        exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+        echo m68k-hp-bsd4.4
+        exit 0 ;;
+    9000/[34678]??:HP-UX:*:*)
+        case "${UNAME_MACHINE}" in
+            9000/31? )            HP_ARCH=m68000 ;;
+            9000/[34]?? )         HP_ARCH=m68k ;;
+            9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
+              sed 's/^              //' << EOF >$dummy.c
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+                {
+                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+                    switch (bits)
+                        {
+                        case 64: puts ("hppa2.0w"); break;
+                        /* case 32: puts ("hppa2.0n"); break; */
+                        case 32: puts ("hppa2.0"); break;  /* modification for HPUX-11 */
+                        default: puts ("hppa2.0"); break;
+                        } break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+                    puts ("hppa2.0"); break;
+              #endif
+                default: puts ("hppa1.0"); break;
+                }
+                  exit (0);
+              }
+EOF
+        (${CC-cc} $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+        rm -f $dummy.c $dummy
+        esac
+        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+        exit 0 ;;
+    3050*:HI-UX:*:*)
+        sed 's/^        //' << EOF >$dummy.c
+        #include <unistd.h>
+        int
+        main ()
+        {
+          long cpu = sysconf (_SC_CPU_VERSION);
+          /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+             true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+             results, however.  */
+          if (CPU_IS_PA_RISC (cpu))
+            {
+              switch (cpu)
+                {
+                  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                  default: puts ("hppa-hitachi-hiuxwe2"); break;
+                }
+            }
+          else if (CPU_IS_HP_MC68K (cpu))
+            puts ("m68k-hitachi-hiuxwe2");
+          else puts ("unknown-hitachi-hiuxwe2");
+          exit (0);
+        }
+EOF
+        ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+        rm -f $dummy.c $dummy
+        echo unknown-hitachi-hiuxwe2
+        exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+        echo hppa1.1-hp-bsd
+        exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+        echo hppa1.0-hp-bsd
+        exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+        echo hppa1.1-hp-osf
+        exit 0 ;;
+    hp8??:OSF1:*:*)
+        echo hppa1.0-hp-osf
+        exit 0 ;;
+    i?86:OSF1:*:*)
+        if [ -x /usr/sbin/sysversion ] ; then
+            echo ${UNAME_MACHINE}-unknown-osf1mk
+        else
+            echo ${UNAME_MACHINE}-unknown-osf1
+        fi
+        exit 0 ;;
+    parisc*:Lites*:*:*)
+        echo hppa1.1-hp-lites
+        exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+        echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+        if getsysinfo -f scalar_acc
+        then echo c32-convex-bsd
+        else echo c2-convex-bsd
+        fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+        echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+        echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+        echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*X-MP:*:*:*)
+        echo xmp-cray-unicos
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+        echo ymp-cray-unicos${UNAME_RELEASE}
+        exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+        exit 0 ;;
+    CRAY*TS:*:*:*)
+        echo t90-cray-unicos${UNAME_RELEASE}
+        exit 0 ;;
+    CRAY*T3E:*:*:*)
+        echo t3e-cray-unicosmk${UNAME_RELEASE}
+        exit 0 ;;
+    CRAY-2:*:*:*)
+        echo cray2-cray-unicos
+        exit 0 ;;
+    F300:UNIX_System_V:*:*)
+        FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    F301:UNIX_System_V:*:*)
+       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+       exit 0 ;;
+    hp3[0-9][05]:NetBSD:*:*)
+        echo m68k-hp-netbsd${UNAME_RELEASE}
+        exit 0 ;;
+    hp300:OpenBSD:*:*)
+        echo m68k-unknown-openbsd${UNAME_RELEASE}
+        exit 0 ;;
+    sparc*:BSD/OS:*:*)
+        echo sparc-unknown-bsdi${UNAME_RELEASE}
+        exit 0 ;;
+    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
+        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+        exit 0 ;;
+    *:BSD/OS:*:*)
+        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+        exit 0 ;;
+    *:FreeBSD:*:*)
+        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+        exit 0 ;;
+    *:NetBSD:*:*)
+        echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+        exit 0 ;;
+    *:OpenBSD:*:*)
+        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+        exit 0 ;;
+    i*:CYGWIN*:*)
+        echo ${UNAME_MACHINE}-pc-cygwin
+        exit 0 ;;
+    i*:MINGW*:*)
+        echo ${UNAME_MACHINE}-pc-mingw32
+        exit 0 ;;
+    p*:CYGWIN*:*)
+        echo powerpcle-unknown-cygwin
+        exit 0 ;;
+    prep*:SunOS:5.*:*)
+        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+        exit 0 ;;
+    *:GNU:*:*)
+        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+        exit 0 ;;
+    *:OS/390:*:*)
+	echo i390-ibm-mvs${UNAME_RELEASE}
+	exit 0 ;;
+    *:Linux:*:*)
+        # uname on the ARM produces all sorts of strangeness, and we need to
+        # filter it out.
+        case "$UNAME_MACHINE" in
+          arm* | sa110*)              UNAME_MACHINE="arm" ;;
+        esac
+
+        # The BFD linker knows what the default object file format is, so
+        # first see if it will tell us.
+        ld_help_string=`ld --help 2>&1`
+        ld_supported_emulations=`echo $ld_help_string \
+                         | sed -ne '/supported emulations:/!d
+                                    s/[         ][      ]*/ /g
+                                    s/.*supported emulations: *//
+                                    s/ .*//
+                                    p'`
+        case "$ld_supported_emulations" in
+          i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
+          i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
+          sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+          armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+          m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+          elf32ppc)   echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
+        esac
+
+        if test "${UNAME_MACHINE}" = "alpha" ; then
+                sed 's/^        //'  <<EOF >$dummy.s
+                .globl main
+                .ent main
+        main:
+                .frame \$30,0,\$26,0
+                .prologue 0
+                .long 0x47e03d80 # implver $0
+                lda \$2,259
+                .long 0x47e20c21 # amask $2,$1
+                srl \$1,8,\$2
+                sll \$2,2,\$2
+                sll \$0,3,\$0
+                addl \$1,\$0,\$0
+                addl \$2,\$0,\$0
+                ret \$31,(\$26),1
+                .end main
+EOF
+                LIBC=""
+                ${CC-cc} $dummy.s -o $dummy 2>/dev/null
+                if test "$?" = 0 ; then
+                        ./$dummy
+                        case "$?" in
+                        7)
+                                UNAME_MACHINE="alpha"
+                                ;;
+                        15)
+                                UNAME_MACHINE="alphaev5"
+                                ;;
+                        14)
+                                UNAME_MACHINE="alphaev56"
+                                ;;
+                        10)
+                                UNAME_MACHINE="alphapca56"
+                                ;;
+                        16)
+                                UNAME_MACHINE="alphaev6"
+                                ;;
+                        esac
+
+                        objdump --private-headers $dummy | \
+                          grep ld.so.1 > /dev/null
+                        if test "$?" = 0 ; then
+                                LIBC="libc1"
+                        fi
+                fi
+                rm -f $dummy.s $dummy
+                echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
+        elif test "${UNAME_MACHINE}" = "mips" ; then
+          cat >$dummy.c <<EOF
+main(argc, argv)
+     int argc;
+     char *argv[];
+{
+#ifdef __MIPSEB__
+  printf ("%s-unknown-linux-gnu\n", argv[1]);
+#endif
+#ifdef __MIPSEL__
+  printf ("%sel-unknown-linux-gnu\n", argv[1]);
+#endif
+  return 0;
+}
+EOF
+          ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+          rm -f $dummy.c $dummy
+        else
+          # Either a pre-BFD a.out linker (linux-gnuoldld)
+          # or one that does not give us useful --help.
+          # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+          # If ld does not provide *any* "supported emulations:"
+          # that means it is gnuoldld.
+          echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+          test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+
+          case "${UNAME_MACHINE}" in
+          i?86)
+            VENDOR=pc;
+            ;;
+          *)
+            VENDOR=unknown;
+            ;;
+          esac
+          # Determine whether the default compiler is a.out or elf
+          cat >$dummy.c <<EOF
+#include <features.h>
+main(argc, argv)
+     int argc;
+     char *argv[];
+{
+#ifdef __ELF__
+# ifdef __GLIBC__
+#  if __GLIBC__ >= 2
+    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+#  else
+    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+#  endif
+# else
+   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+#else
+  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+#endif
+  return 0;
+}
+EOF
+          ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+          rm -f $dummy.c $dummy
+        fi ;;
+# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
+# are messed up and put the nodename in both sysname and nodename.
+    i?86:DYNIX/ptx:4*:*)
+        echo i386-sequent-sysv4
+        exit 0 ;;
+    i?86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+        # I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+        exit 0 ;;
+    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+                echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+        else
+                echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+        fi
+        exit 0 ;;
+    i?86:*:3.2:*)
+        if test -f /usr/options/cb.name; then
+                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+        elif /bin/uname -X 2>/dev/null >/dev/null ; then
+                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+                        && UNAME_MACHINE=i586
+                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+        else
+                echo ${UNAME_MACHINE}-pc-sysv32
+        fi
+        exit 0 ;;
+    i?86:UnixWare:*:*)
+        if /bin/uname -X 2>/dev/null >/dev/null ; then
+          (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+            && UNAME_MACHINE=i586
+        fi
+        echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
+        exit 0 ;;
+    pc:*:*:*)
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+        echo i386-pc-msdosdjgpp
+        exit 0 ;;
+    Intel:Mach:3*:*)
+        echo i386-pc-mach3
+        exit 0 ;;
+    paragon:*:*:*)
+        echo i860-intel-osf1
+        exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+        else # Add other i860-SVR4 vendors below as they are discovered.
+          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+        fi
+        exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+        # "miniframe"
+        echo m68010-convergent-sysv
+        exit 0 ;;
+    M68*:*:R3V[567]*:*)
+        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+        OS_REL=''
+        test -r /etc/.relid \
+        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+          && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:*)
+        echo m68k-unknown-lynxos${UNAME_RELEASE}
+        exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+        echo m68k-atari-sysv4
+        exit 0 ;;
+    i?86:LynxOS:2.*:*)
+        echo i386-unknown-lynxos${UNAME_RELEASE}
+        exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+        echo sparc-unknown-lynxos${UNAME_RELEASE}
+        exit 0 ;;
+    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+        echo rs6000-unknown-lynxos${UNAME_RELEASE}
+        exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+        echo mips-dde-sysv${UNAME_RELEASE}
+        exit 0 ;;
+    RM*:SINIX-*:*:*)
+        echo mips-sni-sysv4
+        exit 0 ;;
+    *:SINIX-*:*:*)
+        if uname -p 2>/dev/null >/dev/null ; then
+                UNAME_MACHINE=`(uname -p) 2>/dev/null`
+                echo ${UNAME_MACHINE}-sni-sysv4
+        else
+                echo ns32k-sni-sysv
+        fi
+        exit 0 ;;
+    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                           # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+        # From Gerald Hewes <hewes@openmarket.com>.
+        # How about differentiating between stratus architectures? -djm
+        echo hppa1.1-stratus-sysv4
+        exit 0 ;;
+    *:*:*:FTX*)
+        # From seanf@swdc.stratus.com.
+        echo i860-stratus-sysv4
+        exit 0 ;;
+    mc68*:A/UX:*:*)
+        echo m68k-apple-aux${UNAME_RELEASE}
+        exit 0 ;;
+    news*:NEWS-OS:*:6*)
+        echo mips-sony-newsos6
+        exit 0 ;;
+    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+        if [ -d /usr/nec ]; then
+                echo mips-nec-sysv${UNAME_RELEASE}
+        else
+                echo mips-unknown-sysv${UNAME_RELEASE}
+        fi
+        exit 0 ;;
+    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
+        echo powerpc-be-beos
+        exit 0 ;;
+    BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
+        echo powerpc-apple-beos
+        exit 0 ;;
+    BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
+        echo i586-pc-beos
+        exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+        echo sx4-nec-superux${UNAME_RELEASE}
+        exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+        echo sx5-nec-superux${UNAME_RELEASE}
+        exit 0 ;;
+    Power*:Rhapsody:*:*)
+        echo powerpc-apple-rhapsody${UNAME_RELEASE}
+        exit 0 ;;
+    *:Rhapsody:*:*)
+        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+        exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+          ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+        printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+        printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+  printf ("vax-dec-bsd\n"); exit (0);
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+        echo c1-convex-bsd
+        exit 0 ;;
+    c2*)
+        if getsysinfo -f scalar_acc
+        then echo c32-convex-bsd
+        else echo c2-convex-bsd
+        fi
+        exit 0 ;;
+    c34*)
+        echo c34-convex-bsd
+        exit 0 ;;
+    c38*)
+        echo c38-convex-bsd
+        exit 0 ;;
+    c4*)
+        echo c4-convex-bsd
+        exit 0 ;;
+    esac
+fi
+
+#echo '(Unable to guess system type)' 1>&2
+
+exit 1
diff --git a/samples/config.h.in b/samples/config.h.in
new file mode 100644
index 0000000000000000000000000000000000000000..f7759c48ca582e1552013836245cc23436d77386
--- /dev/null
+++ b/samples/config.h.in
@@ -0,0 +1,19 @@
+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define if you have the ANSI C header files.  */
+#undef STDC_HEADERS
+
+/* Define to signed char if not in <sys/types.h> */
+#undef XMLByte
+
+/* Define if you have the <inttypes.h> header file.  */
+#undef HAVE_INTTYPES_H
+
+/* Define if you have the m library (-lm).  */
+#undef HAVE_LIBM
+
+/* Define if you have the pthread library (-lpthread).  */
+#undef HAVE_LIBPTHREAD
+
+/* Define if you have the pthreads library (-lpthreads).  */
+#undef HAVE_LIBPTHREADS
diff --git a/samples/config.sub b/samples/config.sub
new file mode 100644
index 0000000000000000000000000000000000000000..1674521d7647bf0960c46cca83517727e7620f1c
--- /dev/null
+++ b/samples/config.sub
@@ -0,0 +1,956 @@
+#! /bin/sh
+# Configuration validation subroutine script, version 1.1.
+#   Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+if [ x$1 = x ]
+then
+	echo Configuration name missing. 1>&2
+	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+	echo "or     $0 ALIAS" 1>&2
+	echo where ALIAS is a recognized configuration type. 1>&2
+	exit 1
+fi
+
+# First pass through any local machine types.
+case $1 in
+	*local*)
+		echo $1
+		exit 0
+		;;
+	*)
+	;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  linux-gnu*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple)
+		os=
+		basic_machine=$1
+		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco5)
+		os=sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+		| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
+		| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
+		| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
+		| i390 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
+		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
+		| mipstx39 | mipstx39el \
+		| sparc | sparclet | sparclite | sparc64 | v850)
+		basic_machine=$basic_machine-unknown
+		;;
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i[34567]86)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+	      | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+	      | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
+	      | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
+	      | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
+	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+	      | sparc64-* | mips64-* | mipsel-* \
+	      | mips64el-* | mips64orion-* | mips64orionel-*  \
+	      | mipstx39-* | mipstx39el-* \
+	      | f301-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-cbm
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-cbm
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-cbm
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	cray2)
+		basic_machine=cray2-cray
+		os=-unicos
+		;;
+	[ctj]90-cray)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	i390-ibm* | ibm*)
+		basic_machine=i390-ibm
+		os=-mvs
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i[34567]86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i[34567]86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i[34567]86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i[34567]86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	mipsel*-linux*)
+		basic_machine=mipsel-unknown
+		os=-linux-gnu
+		;;
+	mips*-linux*)
+		basic_machine=mips-unknown
+		os=-linux-gnu
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+        pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pentium | p5 | k5 | nexen)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | k6 | 6x86)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | nexen-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | k6-* | 6x86-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=rs6000-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+	        ;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+	        ;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	xmp)
+		basic_machine=xmp-cray
+		os=-unicos
+		;;
+        xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	mips)
+		if [ x$os = x-linux-gnu ]; then
+			basic_machine=mips-unknown
+		else
+			basic_machine=mips-mips
+		fi
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sparc)
+		basic_machine=sparc-sun
+		;;
+        cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
+	      | -openstep*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-ns2 )
+	        os=-nextstep2
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+        pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-ibm)
+		os=-aix
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i390-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+        *-gould)
+		os=-sysv
+		;;
+        *-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+        *-sgi)
+		os=-irix
+		;;
+        *-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f301-fujitsu)
+		os=-uxpv
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-vxsim* | -vxworks*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
diff --git a/samples/configure b/samples/configure
new file mode 100755
index 0000000000000000000000000000000000000000..74361802fd2c78df9522c9e7ca0016c2c40fe640
--- /dev/null
+++ b/samples/configure
@@ -0,0 +1,1600 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=SAXCount/SAXCount.hpp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:529: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:559: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:610: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:642: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 653 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:684: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:689: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:717: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+
+for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:753: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CXX="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:785: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 796 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cxx_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cxx_cross=no
+  else
+    ac_cv_prog_cxx_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_works = no; then
+  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:827: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
+echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:832: checking whether we are using GNU C++" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.C <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gxx=yes
+else
+  ac_cv_prog_gxx=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+if test $ac_cv_prog_gxx = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+
+ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=
+echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:860: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+  ac_cv_prog_cxx_g=yes
+else
+  ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS="$ac_save_CXXFLAGS"
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:922: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+# Extract the first word of "autoconf", so it can be a program name with args.
+set dummy autoconf; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:977: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AUTOCONF'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AUTOCONF"; then
+  ac_cv_prog_AUTOCONF="$AUTOCONF" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AUTOCONF="autoconf"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AUTOCONF" && ac_cv_prog_AUTOCONF="true"
+fi
+fi
+AUTOCONF="$ac_cv_prog_AUTOCONF"
+if test -n "$AUTOCONF"; then
+  echo "$ac_t""$AUTOCONF" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6
+echo "configure:1006: checking for floor in -lm" >&5
+ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1014 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char floor();
+
+int main() {
+floor()
+; return 0; }
+EOF
+if { (eval echo configure:1025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lm $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
+echo "configure:1054: checking for pthread_create in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpthread  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1062 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char pthread_create();
+
+int main() {
+pthread_create()
+; return 0; }
+EOF
+if { (eval echo configure:1073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lpthread $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test $ac_cv_lib_pthread_pthread_create = no; then
+echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
+echo "configure:1102: checking for pthread_create in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpthreads  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1110 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char pthread_create();
+
+int main() {
+pthread_create()
+; return 0; }
+EOF
+if { (eval echo configure:1121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lpthreads $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1151: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 1166 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 1183 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 1200 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+for ac_hdr in inttypes.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1234: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1239 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+if test $ac_cv_header_inttypes_h = no; then
+HAVE_INTTYPES_H=0
+else
+HAVE_INTTYPES_H=1
+fi
+
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1284: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+
+case "${host}" in
+        *-*-solaris*)   platform=SOLARIS ;;
+        *-*-linux*)     platform=LINUX ;;
+        *-*-aix*)       platform=AIX ;;
+        *-*-hp*)        platform=HPUX ;;
+        *-*-mvs*)       platform=OS390 ;;
+        *)              platform=UNKNOWN ;;
+esac
+
+
+compiler=${CXX}
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile \
+SAXCount/Makefile \
+DOMCount/Makefile \
+SAXPrint/Makefile \
+DOMPrint/Makefile \
+MemParse/Makefile \
+Redirect/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@CXX@%$CXX%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@CPP@%$CPP%g
+s%@HAVE_INTTYPES_H@%$HAVE_INTTYPES_H%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@platform@%$platform%g
+s%@compiler@%$compiler%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile \
+SAXCount/Makefile \
+DOMCount/Makefile \
+SAXPrint/Makefile \
+DOMPrint/Makefile \
+MemParse/Makefile \
+Redirect/Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/samples/configure.in b/samples/configure.in
new file mode 100644
index 0000000000000000000000000000000000000000..8ca86029effa86619ec0d915e274dc18e11d95dd
--- /dev/null
+++ b/samples/configure.in
@@ -0,0 +1,64 @@
+dnl Process this file with autoconf to produce a configure script
+AC_INIT(SAXCount/SAXCount.hpp)
+
+dnl Checks for programs
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
+
+dnl Checks for libraries
+AC_CHECK_LIB(m, floor)
+
+dnl special pthread handling (AIX uses pthreads instead of pthread)
+AC_CHECK_LIB(pthread, pthread_create)
+if test $ac_cv_lib_pthread_pthread_create = no; then
+AC_CHECK_LIB(pthreads, pthread_create)
+fi
+
+dnl Checks for header files
+AC_CHECK_HEADERS(inttypes.h)
+if test $ac_cv_header_inttypes_h = no; then
+HAVE_INTTYPES_H=0
+else
+HAVE_INTTYPES_H=1
+fi
+AC_SUBST(HAVE_INTTYPES_H)
+
+dnl Determine the host system and Makefile fragment
+AC_CANONICAL_HOST
+
+dnl Platform-specific Makefile setup
+case "${host}" in
+        *-*-solaris*)   platform=SOLARIS ;;
+        *-*-linux*)     platform=LINUX ;;
+        *-*-aix*)       platform=AIX ;;
+        *-*-hp*)        platform=HPUX ;;
+        *-*-mvs*)       platform=OS390 ;;
+        *)              platform=UNKNOWN ;;
+esac
+AC_SUBST(platform)
+
+compiler=${CXX}
+AC_SUBST(compiler)
+
+# prefix=${prefix}
+AC_SUBST(prefix)
+
+cxxflags=${CXXFLAGS}
+AC_SUBST(cxxflags)
+
+cflags=${CFLAGS}
+AC_SUBST(cflags)
+
+dnl output the Makefiles
+AC_OUTPUT([Makefile \
+SAXCount/Makefile \
+DOMCount/Makefile \
+SAXPrint/Makefile \
+DOMPrint/Makefile \
+MemParse/Makefile \
+Redirect/Makefile \
+PParse/Makefile \
+StdInParse/Makefile])
+
diff --git a/samples/data/personal.dtd b/samples/data/personal.dtd
new file mode 100644
index 0000000000000000000000000000000000000000..4e59118835dcfd49a05ad57e57d68c25e02a7c87
--- /dev/null
+++ b/samples/data/personal.dtd
@@ -0,0 +1,18 @@
+<?xml encoding="US-ASCII"?>
+
+<!-- @version:  -->
+
+<!ELEMENT personnel (person)+>
+<!ELEMENT person (name,email*,url*,link?)>
+<!ATTLIST person id ID #REQUIRED>
+<!ELEMENT family (#PCDATA)>
+<!ELEMENT given (#PCDATA)>
+<!ELEMENT name (#PCDATA|family|given)*>
+<!ELEMENT email (#PCDATA)>
+<!ELEMENT url EMPTY>
+<!ATTLIST url href CDATA #REQUIRED>
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+  manager IDREF #IMPLIED
+  subordinates IDREFS #IMPLIED>
+<!ENTITY BadTest SYSTEM "Stupid.Ent">
diff --git a/samples/data/personal.xml b/samples/data/personal.xml
new file mode 100644
index 0000000000000000000000000000000000000000..98cd4c3eb85abe1a4059aaa985d9751f719230d7
--- /dev/null
+++ b/samples/data/personal.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!DOCTYPE personnel SYSTEM "personal.dtd">
+
+<!-- @version: -->
+
+<personnel>
+
+  <person id="Big.Boss" >
+    <name><family>Boss</family> <given>Big</given></name>
+    <email>chief@foo.com</email>
+    <link subordinates="one.worker two.worker three.worker four.worker five.worker"/>
+  </person>
+
+  <person id="one.worker">
+    <name><family>Worker</family> <given>One</given></name>
+    <email>one@foo.com</email>
+    <link manager="Big.Boss"/>
+  </person>
+
+  <person id="two.worker">
+    <name><family>Worker</family> <given>Two</given></name>
+    <email>two@foo.com</email>
+    <link manager="Big.Boss"/>
+  </person>
+
+  <person id="three.worker">
+    <name><family>Worker</family> <given>Three</given></name>
+    <email>three@foo.com</email>
+    <link manager="Big.Boss"/>
+  </person>
+
+  <person id="four.worker">
+    <name><family>Worker</family> <given>Four</given></name>
+    <email>four@foo.com</email>
+    <link manager="Big.Boss"/>
+  </person>
+
+  <person id="five.worker">
+    <name><family>Worker</family> <given>Five</given></name>
+    <email>five@foo.com</email>
+    <link manager="Big.Boss"/>
+  </person>
+
+</personnel>
diff --git a/samples/data/redirect.dtd b/samples/data/redirect.dtd
new file mode 100644
index 0000000000000000000000000000000000000000..7732f02df403b6f90c1ab3f065176b241ccd3233
--- /dev/null
+++ b/samples/data/redirect.dtd
@@ -0,0 +1,17 @@
+<?xml encoding="US-ASCII"?>
+
+<!-- @version: -->
+
+<!ELEMENT personnel (person)+>
+<!ELEMENT person (name,email*,url*,link?)>
+<!ATTLIST person id ID #REQUIRED>
+<!ELEMENT family (#PCDATA)>
+<!ELEMENT given (#PCDATA)>
+<!ELEMENT name (#PCDATA|family|given)*>
+<!ELEMENT email (#PCDATA)>
+<!ELEMENT url EMPTY>
+<!ATTLIST url href CDATA #REQUIRED>
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+  manager IDREF #IMPLIED
+  subordinates IDREFS #IMPLIED>
diff --git a/samples/install-sh b/samples/install-sh
new file mode 100644
index 0000000000000000000000000000000000000000..e9de23842dcd44d2953129c866b1ad25f7e1f1d9
--- /dev/null
+++ b/samples/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd="$cpprog"
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd="$stripprog"
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "install:	no input file specified"
+	exit 1
+else
+	true
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+	
+	if [ -d $dst ]; then
+		instcmd=:
+		chmodcmd=""
+	else
+		instcmd=mkdir
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f $src -o -d $src ]
+	then
+		true
+	else
+		echo "install:  $src does not exist"
+		exit 1
+	fi
+	
+	if [ x"$dst" = x ]
+	then
+		echo "install:	no destination specified"
+		exit 1
+	else
+		true
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d $dst ]
+	then
+		dst="$dst"/`basename $src`
+	else
+		true
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='	
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp="${pathcomp}${1}"
+	shift
+
+	if [ ! -d "${pathcomp}" ] ;
+        then
+		$mkdirprog "${pathcomp}"
+	else
+		true
+	fi
+
+	pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd $dst &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		dstfile=`basename $dst $transformbasename | 
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		true
+	fi
+
+# Make a temp file name in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd $src $dsttmp &&
+
+	trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+	$doit $rmcmd -f $dstdir/$dstfile &&
+	$doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0
diff --git a/samples/runConfigure b/samples/runConfigure
new file mode 100755
index 0000000000000000000000000000000000000000..d7031656dd4f91bc3f6ad1dc48182bac93c44ebc
--- /dev/null
+++ b/samples/runConfigure
@@ -0,0 +1,206 @@
+#!/bin/sh
+
+
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:26  twl
+# Initial revision
+#
+# Revision 1.4  1999/11/08 20:43:34  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+#
+# runConfigure : This script will run the "configure" script for the appropriate platform
+# Only supported platforms are recognized
+
+usage()
+{
+    echo "runConfigure: Helper script to run \"configure\" for one of the supported platforms"
+    echo "Usage: runConfigure \"options\""
+    echo "       where options may be any of the following:"
+    echo "       -p <platform> (accepts 'aix', 'linux', 'solaris', 'hp-10', 'hp-11')"
+    echo "       -c <C compiler name> (e.g. gcc or xlc)"
+    echo "       -x <C++ compiler name> (e.g. g++ or xlC)"
+    echo "       -d (specifies that you want to build debug version)"
+    echo "       -h (get help on the above commands)"
+}
+
+if test ${1}o = "o"; then
+   usage
+   exit -1
+fi
+
+if test ${XML4CROOT}o = "o"; then
+   echo ERROR : You have not set your XML4CROOT environment variable
+   echo Though this environment variable has nothing to do with creating makefiles,
+   echo this is just a general warning to prevent you from pitfalls in future. Please
+   echo set an environment variable called XML4CROOT to indicate where you installed
+   echo the XML4C files, and run this command again to proceed. See the documentation
+   echo for an example if you are still confused.
+   exit -1
+fi
+
+if test $1 = "-h"; then
+   usage
+   exit -1
+fi
+
+# Get the command line parameters
+set -- `getopt p:c:x:dm:n:t:r:l:z:h $*`
+if [ $? != 0 ]
+   then
+   usage
+   exit -1
+fi
+
+# Set up the default values for each parameter
+debug=off                # by default debug is off
+transcoder=native        # by default use native transcoder
+msgloader=iconv          # by default use native transcoder
+netaccessor=fileonly     # by default use fileonly
+
+for i in $*
+   do
+   case $i in
+   -p)
+        platform=$2; shift 2;;
+
+   -c)
+        ccompiler=$2; shift 2;;
+
+   -x)
+        cppcompiler=$2; shift 2;;
+
+   -d)
+        debug=on; shift;;
+
+   -h)
+        usage
+        exit -1;;
+
+   --)
+        shift; break;;
+   esac
+done
+
+echo "Generating makefiles with the following options ..."
+echo "Platform: $platform"
+echo "C Compiler: $ccompiler"
+echo "C++ Compiler: $cppcompiler"
+if test $debug = "off"; then
+    echo "Debug is OFF"
+    debugflag="-w -O";
+else
+    echo "Debug is ON"
+    debugflag="-g";
+fi
+
+# Now check if the options are correct or not, bail out if incorrect
+case $platform in
+   aix | linux | solaris | hp-10 | hp-11)
+       # platform has been recognized
+       ;;
+   *)
+      echo "I do not recognize the platform '$platform'. Please type '${0} -h' for help."
+      exit -1;;
+esac
+
+# Set the C compiler and C++ compiler environment variables
+CC=$ccompiler; export CC
+CXX=$cppcompiler; export CXX
+
+case $cppcompiler in
+   xlC | xlc | xlC_r | xlc_r)
+       LDFLAGS="-lC"; export LDFLAGS
+       LIBS="-L/usr/lpp/xlC/lib"; export LIBS ;;
+
+   g++ | c++)
+       LDFLAGS="-lc"; export LDFLAGS
+       LIBS="-L/usr/local/lib"; export LIBS ;;
+
+   cc | CC)
+       LDFLAGS="-lC"; export LDFLAGS
+       LIBS="-L/usr/lib -L/usr/ccs/lib"; export LIBS ;;
+
+   acc | aCC)
+       LDFLAGS="-lC"; export LDFLAGS
+       LIBS="-L/usr/lib -L/opt/aCC/lib"; export LIBS ;;
+
+   *)
+      echo "I do not recognize the C++ compiler '$cppcompiler'. Continuing anyway ..."
+      ;;
+esac
+
+# Set the extra C and C++ compiler flags
+CXXFLAGS="$debugflag $compileroption"; export CXXFLAGS
+CFLAGS="$debugflag $compileroption"; export CFLAGS
+
+echo
+rm -f config.cache
+rm -f config.log
+rm -f config.status
+./configure
+
+echo
+echo If the result of the above commands look OK to you, go to the directory
+echo ${XML4CROOT}/src and type \"make\" to make the XML4C system.
+
+exit 0;
+
diff --git a/scripts/packageBinaries.pl b/scripts/packageBinaries.pl
new file mode 100644
index 0000000000000000000000000000000000000000..970ef3e3a3d53a1f274e49fd3cdc9dff07f1b92e
--- /dev/null
+++ b/scripts/packageBinaries.pl
@@ -0,0 +1,456 @@
+#!/usr/local/bin/perl5
+
+push(@INC, "/home/xml4c/bin", "/home/xml4c/bin/perl/perl-RUN/opt/perl5/lib", "/Development2/cupert/bin/perl/perl-RUN/opt/perl5/lib", "/Development/cupert/usr/local/perl/perl-RUN/opt/perl5/lib");
+
+require "getopt.pl";
+
+$|=1;   # Force a flush after every print
+
+
+# Extract the source and target directories
+&Getopt('sopcxmntr');
+$XML4CROOT = $opt_s;
+$targetdir = $opt_o;
+$ccompiler = $opt_c;
+$cppcompiler = $opt_x;
+$msgloader = $opt_m;
+$netaccessor = $opt_n;
+$transcoder = $opt_t;
+$thread = $opt_r;
+
+# Check for the environment variables and exit if error
+if (!length($XML4CROOT) || !length($targetdir) || (length($opt_h) > 0) ) {
+        print ("Usage is: packageBinaries <options>\n");
+		print ("          options are:  -s <source_directory>\n");
+		print ("                        -o <target_directory>\n");
+        print ("                        -c <C compiler name> (e.g. gcc or xlc)\n");
+        print ("                        -x <C++ compiler name> (e.g. g++ or xlC)\n");
+        print ("                        -m <message loader> can be 'inmem', 'icu' or 'iconv'\n");
+        print ("                        -n <net accessor> can be 'fileonly' or 'libwww'\n");
+        print ("                        -t <transcoder> can be 'icu' or 'native'\n");
+        print ("                        -r <thread option> can be 'pthread' or 'dce' (only used on HP-11)\n");
+        print ("                        -h to get help on these commands\n");
+        print ("Example: perl packageBinaries.pl -s\$HOME/xml4csrc3_0_0 -o\$HOME/xml4c3_0_0 -cgcc -xg++ -minmem -nfileonly -tnative\n");
+        exit(-1);
+}
+
+# Set up the environment variables for ICU
+# As of Version 3, ICU is not a required component of XML4C
+$ICUROOT = $ENV{'ICUROOT'};
+if (!length($ICUROOT)) {
+       print "You have not defined your ICU install directory.\n";
+	   print "You must set an environment variable called ICUROOT to package ICU with XML4C.\n";
+	   print "Proceeding to build XML4C without ICU...\n";
+}
+
+# Check if the source directory exists or not
+if (!(-e $XML4CROOT)) {
+        print ("The directory $XML4CROOT does not exist. Cannot proceed any further.\n");
+        exit(-1);
+}
+
+# Check if the target directory exists, exit if it does
+if (-e $targetdir) {
+        print ("Error: The target directory \'$targetdir\' already exists.\n");
+        print ("       You must start with a clean directory to package your product.\n");
+        exit(1);
+}
+
+#Fix the backslashes on the Windows platform
+$XML4CROOT =~ s/\\/\//g;
+$ICUROOT =~ s/\\/\//g;
+$targetdir =~ s/\\/\//g;
+
+# Find out the platform from 'uname -a'
+open(PLATFORM, "uname -s|");
+$platform = <PLATFORM>;
+chomp($platform);
+#$platform =~ m/(^\w*)\s/;
+#$platform = $1;
+close (PLATFORM);
+
+print "Packaging binaries for \`" . $platform . "\` in " . $targetdir . " ...\n";
+
+#Construct the name of the zip file by extracting the last directory name
+$zipfiles = $targetdir;
+$zipfiles =~ m/\/(\w*$)/;
+$zipfiles = $1 . "/*";
+
+$buildmode = "Release";    # Universally, why do you want to package Debug builds anyway?
+
+if ($platform =~ m/Windows/) {
+
+        $platformname = 'Win32';    # Needed this way by nmake
+        if (-e $targetdir.".zip") {
+                print ("Error: The target file \'$targetdir.zip\' already exists.\n");
+                print ("       You must delete the file \'$targetdir.zip\' to package your product.\n");
+                exit(1);
+        }
+
+        # Make the target directory and its main subdirectories
+        mkdir ($targetdir, "0644");
+        mkdir ($targetdir . "/bin", "0644");
+        mkdir ($targetdir . "/lib", "0644");
+        mkdir ($targetdir . "/include", "0644");
+        mkdir ($targetdir . "/include/sax", "0644");
+        mkdir ($targetdir . "/include/framework", "0644");
+        mkdir ($targetdir . "/include/internal", "0644");
+        mkdir ($targetdir . "/include/parsers", "0644");
+        mkdir ($targetdir . "/include/util", "0644");
+        mkdir ($targetdir . "/include/dom", "0644");
+        mkdir ($targetdir . "/include/icu", "0644");
+        mkdir ($targetdir . "/include/validators", "0644");
+        mkdir ($targetdir . "/samples", "0644");
+        mkdir ($targetdir . "/samples/Projects", "0644");
+        mkdir ($targetdir . "/samples/Projects/Win32", "0644");
+        mkdir ($targetdir . "/samples/data", "0644");
+        mkdir ($targetdir . "/samples/SAXCount", "0644");
+        mkdir ($targetdir . "/samples/SAXPrint", "0644");
+        mkdir ($targetdir . "/samples/DOMCount", "0644");
+        mkdir ($targetdir . "/samples/DOMPrint", "0644");
+        mkdir ($targetdir . "/samples/Redirect", "0644");
+        mkdir ($targetdir . "/samples/MemParse", "0644");
+        mkdir ($targetdir . "/samples/PParse", "0644");
+        mkdir ($targetdir . "/samples/StdInParse", "0644");
+        mkdir ($targetdir . "/doc", "0644");
+        mkdir ($targetdir . "/doc/apiDocs", "0644");
+        mkdir ($targetdir . "/bin/icu", "0644");
+        mkdir ($targetdir . "/bin/icu/data", "0644");
+
+        #Clean up all the dependency files, causes problems for nmake
+		if (length($ICUROOT) > 0) {
+			chdir ("$ICUROOT");
+			system ("del /s /f *.dep");
+
+			print ("Since you have defined ICUROOT in your environment, I am building ICU too ...");
+			# Make the icu dll
+			chdir ("$ICUROOT/source/common");
+			print "Executing: nmake -f common.mak clean CFG=\"common - $platformname $buildmode\"";
+			system("nmake -f common.mak clean CFG=\"common - $platformname $buildmode\"");
+			print "Executing: nmake -f common.mak all CFG=\"common - $platformname $buildmode\"";
+			system("nmake -f common.mak all CFG=\"common - $platformname $buildmode\"");
+
+			# Make the makeconv utility
+			chdir ("$ICUROOT/source/tools/makeconv");
+			system "nmake -f makeconv.mak clean CFG=\"makeconv - $platformname $buildmode\"";
+			print "Executing: nmake -f makeconv.mak CFG=\"makeconv - $platformname $buildmode\"";
+			system("nmake -f makeconv.mak CFG=\"makeconv - $platformname $buildmode\"");
+		}
+
+        #Clean up all the dependency files, causes problems for nmake
+        chdir ("$XML4CROOT");
+        system ("del /s /f *.dep");
+
+        # Make the XML4C dll
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/IXXML4C3");
+        print "Executing: nmake -f XXML4C3.mak clean CFG=\"IXXML4C3 - $platformname $buildmode\"";
+        system("nmake -f IXXML4C3.mak clean CFG=\"IXXML4C3 - $platformname $buildmode\"");
+        print "Executing: nmake -f IXXML4C3.mak all CFG=\"IXXML4C3 - $platformname $buildmode\"";
+        system("nmake -f IXXML4C3.mak all CFG=\"IXXML4C3 - $platformname $buildmode\"");
+
+        # Make the SAXCount sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/SAXCount");
+        system "nmake -f SAXCount.mak clean CFG=\"SAXCount - $platformname $buildmode\"";
+        print "Executing: nmake -f SAXCount.mak all CFG=\"SAXCount - $platformname $buildmode\"";
+        system("nmake -f SAXCount.mak all CFG=\"SAXCount - $platformname $buildmode\"");
+
+        # Make the SAXPrint sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/SAXPrint");
+        system "nmake -f SAXPrint.mak clean CFG=\"SAXPrint - $platformname $buildmode\"";
+        print "Executing: nmake -f SAXPrint.mak all CFG=\"SAXPrint - $platformname $buildmode\"";
+        system("nmake -f SAXPrint.mak all CFG=\"SAXPrint - $platformname $buildmode\"");
+
+        # Make the DOMCount sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/DOMCount");
+        system "nmake -f DOMCount.mak clean CFG=\"DOMCount - $platformname $buildmode\"";
+        print "Executing: nmake -f DOMCount.mak all CFG=\"DOMCount - $platformname $buildmode\"";
+        system("nmake -f DOMCount.mak all CFG=\"DOMCount - $platformname $buildmode\"");
+
+        # Make the DOMPrint sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/DOMPrint");
+        system "nmake -f DOMPrint.mak clean CFG=\"DOMPrint - $platformname $buildmode\"";
+        print "Executing: nmake -f DOMPrint.mak all CFG=\"DOMPrint - $platformname $buildmode\"";
+        system("nmake -f DOMPrint.mak all CFG=\"DOMPrint - $platformname $buildmode\"");
+
+        # Make the Redirect sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/Redirect");
+        system "nmake -f Redirect.mak clean CFG=\"Redirect - $platformname $buildmode\"";
+        print "Executing: nmake -f Redirect.mak all CFG=\"Redirect - $platformname $buildmode\"";
+        system("nmake -f Redirect.mak all CFG=\"Redirect - $platformname $buildmode\"");
+
+
+        # Make the MemParse sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/MemParse");
+        system "nmake -f MemParse.mak clean CFG=\"MemParse - $platformname $buildmode\"";
+        print "Executing: nmake -f MemParse.mak all CFG=\"MemParse - $platformname $buildmode\"";
+        system("nmake -f MemParse.mak all CFG=\"MemParse - $platformname $buildmode\"");
+
+        # Make the PParse sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/PParse");
+        system "nmake -f PParse.mak clean CFG=\"PParse - $platformname $buildmode\"";
+        print "Executing: nmake -f PParse.mak all CFG=\"PParse - $platformname $buildmode\"";
+        system("nmake -f PParse.mak all CFG=\"PParse - $platformname $buildmode\"");
+
+        # Make the StdInParse sample
+        chdir ("$XML4CROOT/Projects/Win32/VC6/IXXML4C3/StdInParse");
+        system "nmake -f StdInParse.mak clean CFG=\"StdInParse - $platformname $buildmode\"";
+        print "Executing: nmake -f StdInParse.mak all CFG=\"StdInParse - $platformname $buildmode\"";
+        system("nmake -f StdInParse.mak all CFG=\"StdInParse - $platformname $buildmode\"");
+
+		if (length($ICUROOT) > 0) {
+			# run makeconv now
+			chdir ("$ICUROOT/data");
+			opendir (THISDIR, "$ICUROOT/data");
+			@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+			@allucmfiles = grep(/\.ucm/, @allfiles);
+			closedir(THISDIR);
+			foreach $ucmfile (@allucmfiles) {
+					system ("$ICUROOT/source/tools/makeconv/$buildmode/makeconv.exe $ucmfile");
+			}
+		}
+
+        # Decide where you want the build copied from
+        chdir ($targetdir);
+        $BUILDDIR = $XML4CROOT . "/Build/Win32/VC6/" . $buildmode;
+        print "\nBuild is being copied from \'" . $BUILDDIR . "\'";
+
+        # Populate the include output directory
+        print ("\n\nCopying headers files ...\n");
+        $xcopycommand = "xcopy $XML4CROOT\\src\\*.hpp $targetdir\\include";
+        $xcopycommand =~ s/\//\\/g;
+        system ("$xcopycommand /S /C /I /R");
+        $xcopycommand = "xcopy $XML4CROOT\\src\\*.c $targetdir\\include";
+        $xcopycommand =~ s/\//\\/g;
+        system ("$xcopycommand /S /C /I /R");
+
+		if (length($ICUROOT) > 0) {
+        	system("cp -Rfv $ICUROOT/include/* $targetdir/include/icu");
+		}
+
+        # Populate the binary output directory
+        print ("\n\nCopying binary outputs ...\n");
+        system("cp -fv $BUILDDIR/*.dll $targetdir/bin");
+        system("cp -fv $BUILDDIR/*.exe $targetdir/bin");
+		if (length($ICUROOT) > 0) {
+			system("cp -fv $ICUROOT/bin/$buildmode/icuuc.dll $targetdir/bin");
+			system("cp -fv $ICUROOT/lib/$buildmode/icuuc.lib $targetdir/lib");
+			system("cp -fv $ICUROOT/source/tools/makeconv/$buildmode/makeconv.exe $targetdir/bin");
+		}
+        system("cp -fv $BUILDDIR/IXXML4C3.lib $targetdir/lib");
+
+        # Copy the locale files
+		if (length($ICUROOT) > 0) {
+			system("cp -fv $ICUROOT/data/*.cnv $targetdir/bin/icu/data/");
+			system("cp -fv $ICUROOT/data/convrtrs.txt $targetdir/bin/icu/data/");
+		}
+
+        # Populate the samples directory
+        print ("\n\nCopying sample files ...\n");
+        system("cp -Rfv $XML4CROOT/samples/Projects/* $targetdir/samples/Projects");
+        system("cp -Rfv $XML4CROOT/samples/SAXCount/* $targetdir/samples/SAXCount");
+        system("cp -Rfv $XML4CROOT/samples/SAXPrint/* $targetdir/samples/SAXPrint");
+        system("cp -Rfv $XML4CROOT/samples/DOMCount/* $targetdir/samples/DOMCount");
+        system("cp -Rfv $XML4CROOT/samples/DOMPrint/* $targetdir/samples/DOMPrint");
+        system("cp -Rfv $XML4CROOT/samples/Redirect/* $targetdir/samples/Redirect");
+        system("cp -Rfv $XML4CROOT/samples/MemParse/* $targetdir/samples/MemParse");
+        system("cp -Rfv $XML4CROOT/samples/PParse/* $targetdir/samples/PParse");
+        system("cp -Rfv $XML4CROOT/samples/StdInParse/* $targetdir/samples/StdInParse");
+        system("cp -Rfv $XML4CROOT/samples/data/* $targetdir/samples/data");
+
+        # Populate the docs directory
+        print ("\n\nCopying documentation ...\n");
+        system("cp -Rfv $XML4CROOT/doc/* $targetdir/doc");
+        system("cp -Rfv $XML4CROOT/doc/apiDocs/* $targetdir/doc/apiDocs");
+        system("cp $XML4CROOT/Readme.html $targetdir");
+        system("cp $XML4CROOT/doc/license.html $targetdir");
+
+        # Now package it all up using ZIP
+        chdir ("$targetdir/..");
+        print ("\n\nZIPping up all files ...\n");
+        $zipname = $targetdir . ".zip";
+        print ("zip -r $zipname $zipfiles");
+        system ("zip -r $zipname $zipfiles");
+}
+
+
+if ( ($platform =~ m/AIX/)    || ($platform =~ m/HP-UX/) ||
+     ($platform =~ m/SunOS/) || ($platform =~ m/Linux/) ) {
+
+        # Decide on the platform specific stuff first
+        if ($platform =~ m/AIX/) {
+           $icuCompileFlags = 'CXX="xlC_r -L/usr/lpp/xlC/lib" CC="xlc_r -L/usr/lpp/xlC/lib" C_FLAGS="-w -O" CXX_FLAGS="-w -O"'; 
+        }
+        if ($platform eq 'HP-UX') {
+            if ($ccompiler eq 'CC') {
+                $icuCompileFlags = 'CC=cc CXX=CC CXXFLAGS="+eh +DAportable -w -O" CFLAGS="+DAportable -w -O"'; 
+            }
+            else {
+                $icuCompileFlags = 'CC=cc CXX=aCC CXXFLAGS="+DAportable -w -O" CFLAGS="+DAportable -w -O"'; 
+            }
+        }
+        if ($platform =~ m/Linux/) {
+           $icuCompileFlags = 'CC=gcc CXX=g++ CXXFLAGS="-w -O" CFLAGS="-w -O"'; 
+        }
+        if ($platform =~ m/SunOS/) {
+           $icuCompileFlags = 'CC=cc CXX=CC CXXFLAGS="-w -O" CFLAGS="-w -O"'; 
+        }
+
+        # Check if the target directories already exist or not
+        if (-e $targetdir.".tar") {
+                print ("Error: The target file \'$targetdir.tar\' already exists.\n");
+                print ("       You must delete the file \'$targetdir.tar\' to package your product.\n");
+                exit(1);
+        }
+
+        $srczipfiles = $srctargetdir . "/*";
+
+        $srctargetdir = $OUTPUTDIR . $srctargetdir;
+        if (-e $srctargetdir.".tar") {
+                print ("Error: The target file \'$srctargetdir.tar\' already exists.\n");
+                print ("       You must delete the file \'$srctargetdir.tar\' to package your product.\n");
+                exit(1);
+        }
+
+
+        # Make the target directory and its main subdirectories
+        system ("mkdir $targetdir");
+        system ("mkdir $targetdir/bin");
+        system ("mkdir $targetdir/lib");
+		if (length($ICUROOT) > 0) {
+        	system ("mkdir $targetdir/lib/icu");
+        	system ("mkdir $targetdir/lib/icu/data");
+        	system ("mkdir $targetdir/include/icu");
+		}
+        system ("mkdir $targetdir/include");
+        system ("mkdir $targetdir/include/sax");
+        system ("mkdir $targetdir/include/framework");
+        system ("mkdir $targetdir/include/internal");
+        system ("mkdir $targetdir/include/parsers");
+        system ("mkdir $targetdir/include/util");
+        system ("mkdir $targetdir/include/dom");
+        system ("mkdir $targetdir/samples");
+        system ("mkdir $targetdir/samples/data");
+        system ("mkdir $targetdir/samples/SAXCount");
+        system ("mkdir $targetdir/samples/SAXPrint");
+        system ("mkdir $targetdir/samples/DOMCount");
+        system ("mkdir $targetdir/samples/DOMPrint");
+        system ("mkdir $targetdir/samples/Redirect");
+        system ("mkdir $targetdir/samples/MemParse");
+        system ("mkdir $targetdir/samples/PParse");
+        system ("mkdir $targetdir/samples/StdInParse");
+        system ("mkdir $targetdir/doc");
+        system ("mkdir $targetdir/doc/apiDocs");
+
+		if (length($ICUROOT) > 0) {
+			# First make the ICU files
+			chdir ("$ICUROOT/source");
+			system ("$icuCompileFlags configure --prefix=$ICUROOT");
+			chdir ("$ICUROOT/source/common");
+			system ("gmake");
+			system ("gmake install");
+
+			chdir ("$ICUROOT/source/tools/makeconv");
+			system ("gmake");
+			# For the antiquated CC compiler under HPUX, we need to invoke
+			# gmake one extra time to generate the .cnv files.
+			if ( ($platform eq 'HP-UX') && ($compiler eq 'CC') ) {
+				system ("gmake");
+			}
+		}
+
+        # make the source files
+        chdir ("$XML4CROOT/src");
+
+        system ("runConfigure -p$platform -c$opt_c -x$opt_x -m$opt_m -n$opt_n -t$opt_t -r$opt_r");
+        system ("gmake");
+
+        # Now build the samples
+        chdir ("$XML4CROOT/samples");
+        system ("runConfigure -p$platform -c$opt_c -x$opt_x");
+        system ("gmake");
+
+        chdir ($targetdir);
+
+        # Populate the include output directory
+        print ("\n\nCopying headers files ...\n");
+        system("cp -Rf $XML4CROOT/src/sax/*.hpp $targetdir/include/sax");
+        system("cp -Rf $XML4CROOT/src/framework/*.hpp $targetdir/include/framework");
+        system("cp -Rf $XML4CROOT/src/dom/DOM*.hpp $targetdir/include/dom");
+        system("cp -Rf $XML4CROOT/src/internal/*.hpp $targetdir/include/internal");
+        system("cp -Rf $XML4CROOT/src/internal/*.c $targetdir/include/internal");
+        system("cp -Rf $XML4CROOT/src/parsers/*.hpp $targetdir/include/parsers");
+        system("cp -Rf $XML4CROOT/src/util/*.hpp $targetdir/include/util");
+        system("cp -Rf $XML4CROOT/src/util/*.c $targetdir/include/util");
+		
+		if (length($ICUROOT) > 0) {
+			print "\nInternational files are being copied from \'" . $ICUROOT . "\'";
+			system("cp -Rf $ICUROOT/include/* $targetdir/include/icu");
+		}
+
+        # Populate the binary output directory
+        print ("\n\nCopying binary outputs ...\n");
+        system("cp -Rf $XML4CROOT/bin/* $targetdir/bin");
+		if (length($ICUROOT) > 0) {
+			system("cp -f $ICUROOT/source/tools/makeconv/makeconv $targetdir/bin");
+			system("cp -f $ICUROOT/lib/libicu-uc.* $targetdir/lib");
+		}
+        system("cp -f $XML4CROOT/lib/*.a $targetdir/lib");
+        system("cp -f $XML4CROOT/lib/*.so $targetdir/lib");
+        system("cp -f $XML4CROOT/lib/*.sl $targetdir/lib");
+
+        system("rm -rf $targetdir/bin/obj");
+
+		if (length($ICUROOT) > 0) {
+			# Copy the locale files
+			system("cp -f $ICUROOT/data/*.cnv $targetdir/lib/icu/data/");
+			system("cp -f $ICUROOT/data/convrtrs.txt $targetdir/lib/icu/data/");
+		}
+
+        # Populate the samples directory
+        print ("\n\nCopying sample files ...\n");
+        foreach $iii ('config.guess', 'config.h.in', 'config.sub', 'configure', 'configure.in',
+                'install-sh', 'runConfigure', 'Makefile.in', 'Makefile.incl', 'Makefile') {
+                system("cp -f $XML4CROOT/samples/$iii $targetdir/samples");
+        }
+
+        system("cp -Rf $XML4CROOT/samples/data/* $targetdir/samples/data");
+        system("cp -Rf $XML4CROOT/samples/SAXCount/* $targetdir/samples/SAXCount");
+        system("cp -Rf $XML4CROOT/samples/SAXPrint/* $targetdir/samples/SAXPrint");
+        system("cp -Rf $XML4CROOT/samples/DOMCount/* $targetdir/samples/DOMCount");
+        system("cp -Rf $XML4CROOT/samples/DOMPrint/* $targetdir/samples/DOMPrint");
+        system("cp -Rf $XML4CROOT/samples/Redirect/* $targetdir/samples/Redirect");
+        system("cp -Rf $XML4CROOT/samples/MemParse/* $targetdir/samples/MemParse");
+        system("cp -Rf $XML4CROOT/samples/PParse/* $targetdir/samples/PParse");
+        system("cp -Rf $XML4CROOT/samples/StdInParse/* $targetdir/samples/StdInParse");
+
+        # Populate the docs directory
+        print ("\n\nCopying documentation ...\n");
+        system("cp -Rf $XML4CROOT/doc/* $targetdir/doc");
+        system("cp -Rf $XML4CROOT/doc/apiDocs/* $targetdir/doc/apiDocs");
+        system("cp $XML4CROOT/Readme.html $targetdir");
+        system("cp $XML4CROOT/doc/license.html $targetdir");
+
+        # Change the directory permissions
+        system ("chmod 644 `find $targetdir -type f`");
+        system ("chmod 755 $targetdir/bin/* $targetdir/lib/*.sl $targetdir/lib/*.so $targetdir/lib/*.a");
+        system ("chmod +x $targetdir/samples/runConfigure $targetdir/samples/configure $targetdir/samples/install-sh");
+        system ("chmod +x $targetdir/samples/config.sub $targetdir/samples/config.guess $targetdir/samples/config.status");
+        system ("chmod 755 `find $targetdir -type d`");
+
+        # Now package it all up using tar
+        print ("\n\nTARing up all files ...\n");
+        chdir ("$targetdir/..");
+        $zipname = $targetdir . ".tar";
+        $platformzipname = $zipname;
+        $platformzipname =~ s/\.tar/$platformextension\.tar/g;
+
+        print ("tar -cvf $platfromzipname $zipfiles\n");
+        system ("tar -cvf $platformzipname $zipfiles");
+
+        # Finally compress the files
+        print ("Compressing $platformzipname ...\n");
+        system ("compress $platformzipname");
+
+}
+
+
diff --git a/scripts/packageSources.pl b/scripts/packageSources.pl
new file mode 100644
index 0000000000000000000000000000000000000000..486a47aa6c7f556874f5172ee3a591cc12961d21
--- /dev/null
+++ b/scripts/packageSources.pl
@@ -0,0 +1,319 @@
+#!/usr/bin/perl
+
+push(@INC, "/home/xml4c/bin", "/home/xml4c/bin/perl/perl-RUN/opt/perl5/lib", "/Development2/cupert/bin/perl/perl-RUN/opt/perl5/lib", "/Development/cupert/usr/local/perl/perl-RUN/opt/perl5/lib");
+require "getopt.pl";
+
+$|=1;   # Force a flush after every print
+
+# Set up the environment variables for XML4C and ICU
+$XML4CROOT = $ENV{'XML4CROOT'};
+$ICUROOT = $ENV{'ICUROOT'};
+
+# Check for the environment variables and exit if error
+if (!length($XML4CROOT)) {
+        print "You must set an environment variable called XML4CROOT to work with this script.\n";
+        exit(-1);
+}
+
+&Getopt('o');
+$OUTPUTDIR = $opt_o;
+
+# Check for the environment variables and exit if error
+if (!length($XML4CROOT) || !length($OUTPUTDIR)) {
+        print ("Usage is: packageSources -s<output_directory>\n");
+        print ("Example: perl packageSources.pl -od:\\xml4csrc3_0_0\n");
+        print ("         perl packageSources.pl -o\$HOME/xml4csrc3_0_0");
+        exit(-1);
+}
+
+# We need ICUROOT only if we intend to use ICU for transcoding or message loading
+# As of Version 3, this is not mandatory any more.
+# if (!length($ICUROOT)) {
+#        print "You have not defined your International directory.\n You must set an environment variable called ICUROOT to proceed.\n";
+#        exit (-1);
+# }
+
+#Fix the backslashes on the Windows platform
+$XML4CROOT =~ s/\\/\//g;
+$ICUROOT =~ s/\\/\//g;
+
+# Read the target version from the file $XML4CROOT/src/util/XML4CDefs.hpp
+$versionfile = "$XML4CROOT/src/util/XML4CDefs.hpp";
+$openresult = open (VERSIONFILE, "<$versionfile");
+
+if ($openresult == 0) {
+   print "Sorry, I could not find the file $versionfile to pick up the version. Aborting ...\n";
+   exit(-1);
+}
+
+while ($fileline = <VERSIONFILE>) {
+   if ($fileline =~ /gXML4CFullVersionStr = \"(.*)\"/) {
+     $binarytargetdir = $1;  # We found the version string inside this file
+   }
+   if ($fileline =~ /gXML4CVersionStr = \"(.*)\"/) {
+      $libraryversion = $1;
+   }
+}
+close(VERSIONFILE);
+
+$binarytargetdir =~ s/\./_/g;    # Substitute the dots
+$binarytargetdir =~ s/\s/_/g;    # Substitute the blanks
+$binarydirectoryname = "xml4c" . $binarytargetdir;  # Is the name of the binary directory
+$binarytargetdir =~ s/\\/\//g;   # Fix the backslashes, if they exist, probably doesn't
+
+# Now check if the target directory exists, exit if it does
+if (-e $OUTPUTDIR) {
+        print ("Error: The target directory \'$OUTPUTDIR\' already exists.\n");
+        print ("       You must start with a clean directory to package your product.\n");
+        exit(1);
+}
+
+
+$srczipfiles = $OUTPUTDIR . "/*";
+$srctargetdir = $OUTPUTDIR;
+
+# Find out the platform from 'uname -a'
+open(PLATFORM, "uname -a|");
+$platform = <PLATFORM>;
+$platform =~ m/(^\w*\s)/;
+$platform = $1;
+close (PLATFORM);
+
+print "\nPackaging XML4C sources in " . $srctargetdir . " on platform " . $platform . "...\n";
+
+# Build the API docs
+$docppfilelist = "";
+
+$hppdir = "$XML4CROOT/src/sax";
+chdir ($hppdir);
+opendir (THISDIR, $hppdir);
+@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+@allhppfiles = grep(/\.hpp/, @allfiles);
+closedir(THISDIR);
+foreach $hppfile (@allhppfiles) {
+       $docppfilelist = $docppfilelist . " " . $hppdir . "/" . $hppfile;
+}
+
+$hppdir = "$XML4CROOT/src/dom";
+chdir ($hppdir);
+opendir (THISDIR, $hppdir);
+@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+@allhppfiles = grep(/\.hpp/, @allfiles);
+@alldomhppfiles = grep(/DOM_/, @allhppfiles);
+closedir(THISDIR);
+foreach $hppfile (@alldomhppfiles) {
+       $docppfilelist = $docppfilelist . " " . $hppdir . "/" . $hppfile;
+}
+
+$docppfilelist = $docppfilelist . " $XML4CROOT/src/dom/DOMString.hpp";
+$docppfilelist = $docppfilelist . " $XML4CROOT/src/framework/XMLDocumentHandler.hpp";
+$docppfilelist = $docppfilelist . " $XML4CROOT/src/framework/XMLEntityHandler.hpp";
+
+system ("doc++ -d $XML4CROOT/doc/apiDocs -B $XML4CROOT/doc/tail.html -a -G -k -H -S $docppfilelist");
+
+&package_sources();
+
+sub package_sources {
+
+   # Packaging of source files begins here
+   # We just copy over the relevant files from the actual source tree into
+   # a mirror location, and then zip (or tar) it up
+
+   chdir ("$srctargetdir");
+
+   # Now copy over the files directory-by-directory
+   print ("\nCopying source tree ...\n");
+   system ("mkdir $srctargetdir");
+   print ("Targetdir is : " . $srctargetdir . "\n");
+   system("cp -Rf $XML4CROOT/* $srctargetdir");
+   system("cp $XML4CROOT/doc/license.html $srctargetdir");
+
+   if ($platform =~ m/Windows/) {
+      $RM = "rm";
+      system("$RM -rf *.obj");
+      system("$RM -rf *.dep");
+      system("$RM -rf *.mak");
+      system("$RM -rf Makefile");
+   }
+   else {   # all UNIX flavors
+      $RM = "\\rm";
+      system("find $srctargetdir -name \"*.o\" -print -exec rm -f {} \\;");
+      system("find $srctargetdir -name \"core\" -print -exec rm -f {} \\;");
+      system("find $srctargetdir -name \"a.out\" -print -exec rm -f {} \\;");
+      system("find $srctargetdir -name \"Makefile\" -print -exec rm -f {} \\;");
+      system("find $srctargetdir -name \"*.dep\" -print -exec rm -f {} \\;");
+      system("find $srctargetdir -name \"*.mak\" -print -exec rm -f {} \\;");
+
+      # Change the directory permissions
+      system ("chmod 644 `find $srctargetdir -type f`");
+      system ("chmod 755 `find $srctargetdir/scripts -type f`");
+      system ("chmod 755 `find $srctargetdir -type d`");
+      system ("chmod +x `find $srctargetdir/scripts -type f`");
+      # Change the script file permissions
+      system ("chmod +x $srctargetdir/src/runConfigure $srctargetdir/src/configure $srctargetdir/src/install-sh");
+      system ("chmod +x $srctargetdir/src/config.sub $srctargetdir/src/config.guess $srctargetdir/src/config.status");
+      system ("chmod +x $srctargetdir/samples/runConfigure $srctargetdir/samples/configure $srctargetdir/samples/install-sh");
+      system ("chmod +x $srctargetdir/samples/config.sub $srctargetdir/samples/config.guess $srctargetdir/samples/config.status");
+      # To make sure that configure script is updated, run autoconf
+      chdir ("$srctargetdir/src");
+      system("autoconf");
+      chdir ("$srctargetdir/samples");
+      system("autoconf");
+   }
+
+   
+   # Delete the irrelevant parts before the packaging
+   system("$RM -f $srctargetdir/CMVC.GON");
+   system("$RM -rf $srctargetdir/*.\$??");
+   system("$RM -rf $srctargetdir/*.o");
+   system("$RM -rf $srctargetdir/Build");
+   system("$RM -rf $srctargetdir/build");
+   system("$RM -rf $srctargetdir/bin");
+   system("$RM -rf $srctargetdir/obj/*.o");
+   system("$RM -rf $srctargetdir/obj/Makefile");
+   system("$RM -rf $srctargetdir/obj/*.obj");
+   system("$RM -rf $srctargetdir/lib");
+   system("$RM -rf $srctargetdir/include");
+   system("$RM -rf $srctargetdir/doc/*.zip");
+
+   system("$RM -rf $srctargetdir/Projects/Win32/Unsupported");
+   system("$RM -rf $srctargetdir/samples/Projects/Win32/VC5");
+   system("$RM -rf $srctargetdir/src/dom/DomTest");
+   system("$RM -rf $srctargetdir/src/dom/DOMMemTest");
+   system("$RM -rf $srctargetdir/src/util/tests");
+   system("$RM -rf $srctargetdir/src/internal/ParserTest");
+   system("$RM -rf $srctargetdir/tests");
+   system("$RM -rf $srctargetdir/Tools");
+   system("$RM $srctargetdir/scripts/packageSources.pl");
+
+   chdir ($srctargetdir);
+   system("$RM -rf *.opt");
+   system("$RM -rf *.ncb");
+   system("$RM -rf *.plg");
+   system("$RM -rf \.#*");
+
+   # Walk through the source directory structure and delete all CVS directories
+   &deleteCVSdirs($srctargetdir);
+
+   #Change the version number in the user documentation
+   &change_version_number($srctargetdir . "/doc/installation.html", $binarydirectoryname);
+   &change_version_number($srctargetdir . "/doc/programming.html", $binarydirectoryname);
+   &change_version_number($srctargetdir . "/doc/distribution.html", $binarydirectoryname);
+
+   # remove the export clauses
+   chdir ("$srctargetdir/doc/apiDocs");
+   opendir (THISDIR, "$srctargetdir/doc/apiDocs");
+   @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+   @allhtmlfiles = grep(/\.html/, @allfiles);
+   closedir(THISDIR);
+   foreach $htmlfile (@allhtmlfiles) {
+       &remove_export_clauses ("$srctargetdir/doc/apiDocs/" . $htmlfile);
+   }
+
+   chdir ("$srctargetdir/..");
+   if ($platform =~ m/Windows/) {
+
+      # Now package it all up using ZIP
+      print ("\n\nZIPping up all source files ...\n");
+      $srczipname = $srctargetdir . ".zip";
+      print ("zip -r $srczipname $srczipfiles");
+      system ("zip -r $srczipname $srczipfiles");
+   }
+   else {
+      # Now package it all up using TAR
+      print ("\n\nTARing all source files ...\n");
+      $srczipname = $srctargetdir . ".tar";
+      print ("tar -cvf $srczipname $srczipfiles");
+      system ("tar -cvf $srczipname $srczipfiles");
+
+      system ("compress $srczipname");
+   }
+   print ("Done with packaging sources.\n");
+}
+
+sub change_version_number()
+{
+        my ($thefile, $version_num) = @_;
+        print "\nChanging all version numbers in file $thefile to $version_num";
+        my $thefiledotbak = $thefile . ".bak";
+        rename ($thefile, $thefiledotbak);
+
+        $dll_name = "xml4c" . $libraryversion;
+        $dll_name =~ tr/a-z/A-Z/;
+        my $srcversion_num = $version_num;
+        $srcversion_num =~ s/xml4c2/xml4csrc2/ig;
+        open (FIZZLE, $thefiledotbak);
+        open (FIZZLEOUT, ">$thefile");
+        while ($line = <FIZZLE>) {
+                $line =~ s/xml4c2srcreleasenum/$srcversion_num/ig;
+                $line =~ s/xml4c2releasenum/$version_num/ig;
+                $line =~ s/XML4C2dllname/$dll_name/ig;
+                print FIZZLEOUT $line;
+        }
+        close (FIZZLEOUT);
+        close (FIZZLE);
+        unlink ($thefiledotbak);
+}
+
+
+sub remove_export_clauses()
+{
+        my ($thefile) = @_;
+        print "\nRemoving export clauses in file $thefile";
+        my $thefiledotbak = $thefile . ".bak";
+        rename ($thefile, $thefiledotbak);
+
+        open (FIZZLE, $thefiledotbak);
+        open (FIZZLEOUT, ">$thefile");
+        while ($line = <FIZZLE>) {
+                $line =~ s/SAX_EXPORT//g;
+                $line =~ s/CDOM_EXPORT//g;
+                $line =~ s/XMLPARSER_EXPORT//g;
+                print FIZZLEOUT $line;
+        }
+        close (FIZZLEOUT);
+        close (FIZZLE);
+        unlink ($thefiledotbak);
+}
+
+sub deleteCVSdirs {
+	local($dir,$nlink) = @_;
+	local($dev,$ino,$mode,$subcount);
+	
+	($dev,$ino,$mode,$nlink) = stat($dir) unless $nlink;
+	
+	opendir(DIR, $dir) || die "Cannot open $dir";
+	local(@filenames) = readdir(DIR);
+	closedir(DIR);
+	
+	if ($nlink == 2) {
+		for (@filenames) {
+			next if $_ eq '.';
+			next if $_ eq '..';
+			print "$dir/$_\n";
+		}
+	}
+	else {
+		$subcount = $nlink - 2;
+		for (@filenames) {
+			next if $_ eq '.';
+			next if $_ eq '..';
+			$name = "$dir/$_";
+			# print $name, "\n";
+			next if $subcount == 0;
+			
+			($dev,$ino,$mode,$nlink) = lstat($_);
+			next unless -d _;
+			
+			if ($name =~ m/CVS/i) {
+				print ("Removing $name ...\n");
+				system("$RM -rf $name");
+				next;
+			}
+			chdir $_ || die "Cannot cd to $name";
+			&deleteCVSdirs($name,$nlink);
+			chdir '..';
+			--$subcount;
+		}
+	}
+}
diff --git a/src/NLS/EN_US/XMLErrList_EN_US.Xml b/src/NLS/EN_US/XMLErrList_EN_US.Xml
new file mode 100644
index 0000000000000000000000000000000000000000..98b8863c75d95ac9330eee2ca4bc86d280337ffb
--- /dev/null
+++ b/src/NLS/EN_US/XMLErrList_EN_US.Xml
@@ -0,0 +1,279 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE MsgFile SYSTEM "../XMLErrList.Dtd">
+
+<!--  ===================================================== 
+ A Message file is designed for a particular locale, which is 
+ indicated in the locale attribute. 
+ =======================================================  -->
+<MsgFile Locale="EN_US">
+    <MsgDomain Domain="http://apache.org/xml/messages/XMLErrors">
+        <Warning>
+            <Message Id="NotationAlreadyExists" Text="Notation '{0}' has already been declared"/>
+            <Message Id="AttListAlreadyExists" Text="Attribute '{0}' has already been declared"/>
+            <Message Id="ContradictoryEncoding" Text="Encoding ({0}, from XMLDecl or manually set) contradicts the auto-sensed encoding, ignoring it"/>
+            <Message Id="UndeclaredElemInCM" Text="Element '{0}' was referenced in a content model but never declared"/>
+            <Message Id="UndeclaredElemInAttList" Text="Element '{0}' was referenced in an attlist but never declared"/>
+        </Warning>
+        <Error>
+            <Message Id="ExpectedCommentOrCDATA" Text="Expected comment or CDATA"/>
+            <Message Id="ExpectedAttrName" Text="Expected an attribute name"/>
+            <Message Id="ExpectedNotationName" Text="Expected a notation name"/>
+            <Message Id="NoRepInMixed" Text="Repetition of individual elements is not legal for mixed content models"/>
+            <Message Id="BadDefAttrDecl" Text="Bad default attribute declaration"/>
+            <Message Id="ExpectedDefAttrDecl" Text="Expected default attribute declaration, assuming #IMPLIED  "/>
+            <Message Id="AttListSyntaxError" Text="Attribute list syntax error"/>
+            <Message Id="ExpectedEqSign" Text="Expected equal sign"/>
+            <Message Id="DupAttrName" Text="Duplication attribute name"/>
+            <Message Id="BadIdForXMLLangAttr" Text="Bad ID for xml:lang attribute"/>
+            <Message Id="ExpectedElementName" Text="Expected an element name"/>
+            <Message Id="MustStartWithXMLDecl" Text="Must start with an XMLDecl"/>
+            <Message Id="CommentsMustStartWith" Text="Comments must start with &lt;!--"/>
+            <Message Id="InvalidDocumentStructure" Text="Invalid document structure"/>
+            <Message Id="ExpectedDeclString" Text="Expected a 'version=', 'encoding=', or 'standalone='"/>
+            <Message Id="BadXMLVersion" Text="Bad XML version string"/>
+            <Message Id="UnsupportedXMLVersion" Text="Unsupported XML version"/>
+            <Message Id="UnterminatedXMLDecl" Text="Unterminated XML decl"/>
+            <Message Id="BadXMLEncoding" Text="Bad XML encoding declaration"/>
+            <Message Id="BadStandalone" Text="Bad standalone declaration"/>
+            <Message Id="UnterminatedComment" Text="Unterminated comment"/>
+            <Message Id="PINameExpected" Text="Processing instruction name expected"/>
+            <Message Id="UnterminatedPI" Text="Unterminated processing instruction"/>
+            <Message Id="InvalidCharacter" Text="Invalid character"/>
+            <Message Id="UnexpectedTextBeforeRoot" Text="Unexpected text before root element"/>
+            <Message Id="UnterminatedStartTag" Text="Unterminated start tag"/>
+            <Message Id="ExpectedAttrValue" Text="Expected an attribute value"/>
+            <Message Id="UnterminatedEndTag" Text="Unterminated end tag"/>
+            <Message Id="ExpectedAttributeType" Text="Expected attribute type (CDATA, ID, NMTOKEN, ..),"/>
+            <Message Id="ExpectedEndOfTagX" Text="Expected end of tag '{0}'"/>
+            <Message Id="ExpectedMarkup" Text="Expected tag name, comment, PI, or other markup"/>
+            <Message Id="NotValidAfterContent" Text="Not valid after content"/>
+            <Message Id="ExpectedComment" Text="Expected comment"/>
+            <Message Id="ExpectedCommentOrPI" Text="Expected comment or processing instruction"/>
+            <Message Id="ExpectedWhitespace" Text="Expected whitespace"/>
+            <Message Id="NoRootElemInDOCTYPE" Text="No root element in DOCTYPE"/>
+            <Message Id="ExpectedQuotedString" Text="Expected quoted string"/>
+            <Message Id="ExpectedPublicId" Text="Expected public id"/>
+            <Message Id="InvalidPublicIdChar" Text="Invalid character in public id"/>
+            <Message Id="UnterminatedDOCTYPE" Text="Unterminated DOCTYPE declaration"/>
+            <Message Id="InvalidCharacterInIntSubset" Text="Invalid character in internal subset"/>
+            <Message Id="ExpectedCDATA" Text="Expected CDATA section"/>
+            <Message Id="InvalidInitialNameChar" Text="Invalid initial name character"/>
+            <Message Id="InvalidNameChar" Text="Invalid name character"/>
+            <Message Id="UnexpectedWhitespace" Text="Unexpected whitespace"/>
+            <Message Id="InvalidCharacterInAttrValue" Text="Invalid character in attribute value"/>
+            <Message Id="ExpectedMarkupDecl" Text="Expected a markup declaration"/>
+            <Message Id="TextDeclNotLegalHere" Text="Text declaration not legal here"/>
+            <Message Id="ConditionalSectInIntSubset" Text="Conditional section in internal subset"/>
+            <Message Id="ExpectedPEName" Text="Expected parameter entity name"/>
+            <Message Id="UnterminatedEntityDecl" Text="Unterminated entity declaration"/>
+            <Message Id="InvalidCharacterRef" Text="Invalid character reference"/>
+            <Message Id="UnterminatedCharRef" Text="Unterminated character reference"/>
+            <Message Id="ExpectedEntityRefName" Text="Expected entity name for reference"/>
+            <Message Id="EntityNotFound" Text="Entity '{0}' was not found"/>
+            <Message Id="NoUnparsedEntityRefs" Text="Unparsed entitty references not valid here"/>
+            <Message Id="UnterminatedEntityRef" Text="Unterminated entity reference"/>
+            <Message Id="RecursiveEntity" Text="Recursive entity expansion"/>
+            <Message Id="PartialMarkupInEntity" Text="Partial markup in entity value"/>
+            <Message Id="UnterminatedElementDecl" Text="Unterminated element declaration"/>
+            <Message Id="ExpectedContentSpecExpr" Text="Expected content specification expression"/>
+            <Message Id="ExpectedAsterisk" Text="Expected asterisk"/>
+            <Message Id="UnterminatedContentModel" Text="Unterminated Content model"/>
+            <Message Id="ExpectedSystemId" Text="Expected system id"/>
+            <Message Id="ExpectedSystemOrPublicId" Text="Expected system or public id"/>
+            <Message Id="UnterminatedNotationDecl" Text="Unterminated notation declaration"/>
+            <Message Id="ExpectedSeqChoiceLeaf" Text="Expected ',', '|', or ')' characters"/>
+            <Message Id="ExpectedChoiceOrCloseParen" Text="Expected '|' or ')' characters"/>
+            <Message Id="ExpectedSeqOrCloseParen" Text="Expected ',' or ')' characters or close parenthesis"/>
+            <Message Id="ExpectedEnumValue" Text="Expected enumeration value"/>
+            <Message Id="ExpectedEnumSepOrParen" Text="Expected | enumeration separator, or closing paren"/>
+            <Message Id="UnterminatedEntityLiteral" Text="Unterminated entity literal"/>
+            <Message Id="MoreEndThanStartTags" Text="There are more end tags than start tags"/>
+            <Message Id="IllegalRefInStandalone" Text="Reference to external declaration in standalone document. Entity={0}"/>
+            <Message Id="ExpectedOpenParen" Text="Expected an open parenthesis"/>
+            <Message Id="AttrAlreadyUsedInSTag" Text="The attribute '{0}' is already used in element '{1}'"/>
+            <Message Id="BracketInAttrValue" Text="A '&lt;' character cannot be used in an attribute value, except through &lt;"/>
+            <Message Id="Expected2ndSurrogateChar" Text="A leading surrogate character was not followed by a legal second character"/>
+            <Message Id="ExpectedEndOfConditional" Text="Expected ']]>' to end a conditional section"/>
+            <Message Id="ExpectedIncOrIgn" Text="Expected INCLUDE or IGNORE here"/>
+            <Message Id="ExpectedINCLUDEBracket" Text="Expected [ to follow INCLUDE or IGNORE"/>
+            <Message Id="ExpectedTextDecl" Text="Expected a TextDecl here: &lt;?xml ...."/>
+            <Message Id="ExpectedXMLDecl" Text="Expected a XMLDecl here: &lt;?xml ...."/>
+            <Message Id="UnexpectedEOE" Text="Unexpected end of entity {0}"/>
+            <Message Id="PEPropogated" Text="A PE propogated out of the int/ext subset, discarding extra text"/>
+            <Message Id="ExtraCloseSquare" Text="An extra ] character was found an ignored"/>
+            <Message Id="PERefInMarkupInIntSubset" Text="PE refs are not allowed inside markup in the internal subset"/>
+            <Message Id="EntityPropogated" Text="An entity propogated out of the content section into Miscellaneous"/>
+            <Message Id="ExpectedNumericalCharRef" Text="Expected &amp;# to be followed by a numeric character value"/>
+            <Message Id="ExpectedOpenSquareBracket" Text="Expected an open bracket ('[') here"/>
+            <Message Id="BadSequenceInCharData" Text="The sequence ']]>' is not allowed in character data"/>
+            <Message Id="IllegalSequenceInComment" Text="Illegal sequence '--' in comment"/>
+            <Message Id="UnterminatedCDATASection" Text="Unterminated CDATA section"/>
+            <Message Id="ExpectedNDATA" Text="Expected NDATA"/>
+            <Message Id="NDATANotValidForPE" Text="NDATA is not legal for parameter entities"/>
+            <Message Id="HexRadixMustBeLowerCase" Text="Hex radix character refs must use 'x', not 'X'"/>
+            <Message Id="DeclStringRep" Text="'{0}' has already been set. Ignoring redundant setting"/>
+            <Message Id="DeclStringsInWrongOrder" Text="The XMLDecl strings must be in the order: version, encoding, standalone"/>
+            <Message Id="NoExtRefsInAttValue" Text="External entities cannot be referred to from attribute values"/>
+            <Message Id="XMLDeclMustBeLowerCase" Text="The XML or Text decl must start with '&lt;?xml ', not '&lt;?XML '"/>
+            <Message Id="ExpectedEntityValue" Text="Expected a literal entity value or PUBLIC/SYSTEM id"/>
+            <Message Id="BadDigitForRadix" Text="'{0}' is not a valid digit for the indicated radix"/>
+            <Message Id="EndedWithTagsOnStack" Text="The input ended before all started tags were ended. Last tag started was '{0}'"/>
+            <Message Id="AmbiguousContentModel" Text="The content model for element '{0}' is ambiguous"/>
+            <Message Id="NestedCDATA" Text="Nested CDATA sections are not allowed"/>
+            <Message Id="UnknownPrefix" Text="The prefix '{0}' has not been mapped to any URI"/>
+            <Message Id="PartialTagMarkupError" Text="The start and the end tag were in the different entities"/>
+            <Message Id="EmptyMainEntity" Text="The main XML document cannot be empty"/>
+            <Message Id="CDATAOutsideOfContent" Text="CDATA is not allowed outside the root element"/>
+            <Message Id="OnlyCharRefsAllowedHere" Text="Only numeric character entities or special character entities are legal here"/>
+            <Message Id="Unexpected2ndSurrogateChar" Text="Got an unexpected trailing surrogate character"/>
+            <Message Id="NoPIStartsWithXML" Text="No processing instruction starts with 'xml'"/>
+            <Message Id="XMLDeclMustBeFirst" Text="The XML or Text declaration must start at line/column 1/1"/>
+            <Message Id="XMLVersionRequired" Text="The 'version=' string is required in an XMLDecl"/>
+            <Message Id="StandaloneNotLegal" Text="The 'standalone=' string is only allowed in the main XML entity"/>
+            <Message Id="TooManyColonsInName" Text="When namespaces are enabled, a name can have only one colon character"/>
+            <Message Id="InvalidColonPos" Text="When namespaces are enabled, the colon cannot be the first or last character"/>
+            <Message Id="ColonNotLegalWithNS" Text="Colons are not allowed in this name when namespaces are enabled"/>
+            <Message Id="SysException" Text="A system exception occured during processing"/>
+            <Message Id="XMLException" Text="An exception occured! Type:{0}, Message:{1}"/>
+            <Message Id="UnexpectedEOF" Text="Unexpected end of file exception. Message: {0}"/>
+        </Error>
+    </MsgDomain>
+    <MsgDomain Domain="http://apache.org/xml/messages/XMLValidity">
+        <Error>
+            <Message Id="ElementNotDefined" Text="Unknown element '{0}'"/>
+            <Message Id="AttNotDefined" Text="Attribute '{0}' not defined"/>
+            <Message Id="NotationNotDeclared" Text="Notation '{0}' was referenced but never declared"/>
+            <Message Id="RootElemNotLikeDocType" Text="Root element different from DOCTYPE"/>
+            <Message Id="RequiredAttrNotProvided" Text="Required attribute '{0}' was not provided"/>
+            <Message Id="ElementNotValidForContent" Text="Element '{0}' is not valid for content model: '{1}'"/>
+            <Message Id="BadIDAttrDefType" Text="ID attributes must be #IMPLIED or #REQUIRED"/>
+            <Message Id="InvalidEmptyAttValue" Text="This type of attribute cannot have an empty value"/>
+            <Message Id="ElementAlreadyExists" Text="Element '{0}' has already been declared"/>
+            <Message Id="MultipleIdAttrs" Text="Element '{0}' has more than one ID attribute"/>
+            <Message Id="ReusedIDValue" Text="ID '{0}' has already been used"/>
+            <Message Id="IDNotDeclared" Text="ID attribute '{0}' was referenced but never declared"/>
+            <Message Id="UnknownNotRefAttr" Text="Attribute '{0}' refers to an unknown notation '{1}'"/>
+            <Message Id="UndeclaredElemInDocType" Text="Element '{0}' was used in the DOCTYPE but never declared"/>
+            <Message Id="EmptyNotValidForContent" Text="Empty content not valid for content model: '{0}'"/>
+            <Message Id="AttNotDefinedForElement" Text="Attribute '{{0}}{1}' is not declared for element '{2}'"/>
+            <Message Id="BadEntityRefAttr" Text="Attributes of type ENTITY/ENTITIES must refer to an external, unparsed entity"/>
+            <Message Id="UnknownEntityRefAttr" Text="Attribute '{0}' refers to an unknown entity '{1}'"/>
+            <Message Id="NotEnoughElemsForCM" Text="Not enough elements to match content model : '{0}'"/>
+            <Message Id="NoCharDataInCM" Text="No character data is allowed by content model"/>
+            <Message Id="DoesNotMatchEnumList" Text="Attribute '{0}' does not match its defined enumeration or notation list"/>
+            <Message Id="AttrValNotName" Text="The values for attribute '{0}' must be names or name tokens"/>
+            <Message Id="NoMultipleValues" Text="Attribute '{0}' does not support multiple values"/>
+            <Message Id="NotSameAsFixedValue" Text="Attribute '{0}' has a value that does not match its #FIXED value"/>
+            <Message Id="RepElemInMixed" Text="Element types cannot be duplicated in Mixed content models"/>
+        </Error>
+    </MsgDomain>
+    <MsgDomain Domain="http://apache.org/xml/messages/XML4CErrors">
+        <Error>
+            <Message Id="Array_BadIndex" Text="The index is beyond the array bounds  "/>
+            <Message Id="Array_BadNewSize" Text="The new size is less than the old one"/>
+            <Message Id="Bitset_BadIndex" Text="The bit index was beyond the set size"/>
+            <Message Id="CPtr_PointerIsZero" Text="The pointer has not been set"/>
+            <Message Id="Enum_NoMoreElements" Text="The enumerator contains no more elements"/>
+            <Message Id="File_CouldNotOpenFile" Text="Could not open file: {0}"/>
+            <Message Id="File_CouldNotGetCurPos" Text="Could not query the current file position"/>
+            <Message Id="File_CouldNotCloseFile" Text="Could not close the file"/>
+            <Message Id="File_CouldNotSeekToEnd" Text="Could not seek to end of file"/>
+            <Message Id="File_CouldNotSeekToPos" Text="Could not seek to required position in file"/>
+            <Message Id="File_CouldNotDupHandle" Text="Could not duplicate the handle"/>
+            <Message Id="File_CouldNotReadFromFile" Text="Could not read data from file"/>
+            <Message Id="File_CouldNotResetFile" Text="Could not reset file to beginning"/>
+            <Message Id="File_CouldNotGetSize" Text="Could not acertain the file size"/>
+            <Message Id="File_CouldNotGetBasePathName" Text="Could not determine base pathname of the file"/>
+            <Message Id="HshTbl_ZeroModulus" Text="The hash modulus cannot be zero"/>
+            <Message Id="HshTbl_BadHashFromKey" Text="Hashing the key returned an invalid bad hash value"/>
+            <Message Id="HshTbl_NoSuchKeyExists" Text="The key '{0}' could not be found in the hash table"/>
+            <Message Id="Mutex_CouldNotCreate" Text="Could not create mutex"/>
+            <Message Id="Mutex_CouldNotClose" Text="Could not close mutex"/>
+            <Message Id="Mutex_CouldNotLock" Text="Could not lock mutex"/>
+            <Message Id="Mutex_CouldNotUnlock" Text="Could not unlock mutex"/>
+            <Message Id="Mutex_CouldNotDestroy" Text="Could not destroy mutex"/>
+            <Message Id="Pool_ElemAlreadyExists" Text="The element {0} already exists"/>
+            <Message Id="Pool_BadHashFromKey" Text="Hashing the key returned an invalid bad hash value"/>
+            <Message Id="Pool_InvalidId" Text="The passed id is not valid for this pool"/>
+            <Message Id="Pool_ZeroModulus" Text="The modulus value cannot be zero"/>
+            <Message Id="Stack_BadIndex" Text="The index is past the top of stack"/>
+            <Message Id="Stack_EmptyStack" Text="The stack is empty, cannot access members"/>
+            <Message Id="Str_ZeroSizedTargetBuf" Text="The target buffer cannot have a max size of zero"/>
+            <Message Id="Str_UnknownRadix" Text="The given radix is not supported. Use 2, 8, 10, or 16"/>
+            <Message Id="Str_TargetBufTooSmall" Text="The target buffer is too small to accept the results"/>
+            <Message Id="Str_StartIndexPastEnd" Text="The start index is past the end of the string"/>
+            <Message Id="Strm_StdErrWriteFailure" Text="Could not write to standard err"/>
+            <Message Id="Strm_StdOutWriteFailure" Text="Could not write to standard out"/>
+            <Message Id="Strm_ConWriteFailure" Text="Could not write to console"/>
+            <Message Id="StrPool_IllegalId" Text="String pool id was not legal"/>
+            <Message Id="URL_MalformedURL" Text="The URL was not correctly formed"/>
+            <Message Id="URL_UnsupportedProto" Text="The URL used an unsupported protocol"/>
+            <Message Id="URL_UnsupportedProto1" Text="Unsupported URL protocol: '{0}'"/>
+            <Message Id="URL_OnlyLocalHost" Text="Only localhost is supported at this time"/>
+            <Message Id="URL_NoProtocolPresent" Text="No protocol prefix present"/>
+            <Message Id="URL_ExpectingTwoSlashes" Text="Expected // after protocol"/>
+            <Message Id="URL_IncorrectEscapedCharRef" Text="% must be followed by two hex digits"/>
+            <Message Id="URL_UnterminatedHostComponent" Text="Unterminated host component"/>
+            <Message Id="Vector_BadIndex" Text="The passed index is past the end of the vector"/>
+            <Message Id="Gen_ParseInProgress" Text="Parse may not be called while parsing"/>
+            <Message Id="Gen_NoDTDValidator" Text="A DOCTYPE was seen but the installed validator does not understand DTDs"/>
+            <Message Id="Gen_CouldNotOpenDTD" Text="Could not open DTD file '{0}'"/>
+            <Message Id="Gen_CouldNotOpenExtEntity" Text="Could not open external entity '{0}'"/>
+            <Message Id="Gen_UnexpectedEOF" Text="The end of input was not expected"/>
+            <Message Id="AttrList_BadIndex" Text="The index given was beyond the max attribute index"/>
+            <Message Id="ElemStack_EmptyStack" Text="The element stack is empty"/>
+            <Message Id="ElemStack_BadIndex" Text="The element stack index given was beyond the stack top"/>
+            <Message Id="ElemStack_StackUnderflow" Text="The element stack was already empty when a pop request occured"/>
+            <Message Id="ElemStack_NoParentPushed" Text="A parent operation was requested, but only one element is on the stack"/>
+            <Message Id="RdrMgr_ReaderIdNotFound" Text="The indicated reader id was never found"/>
+            <Message Id="Reader_BadAutoEncoding" Text="The auto encoding enum has an unknown value"/>
+            <Message Id="Reader_CantCreateCvtrFor" Text="Could not create a converter for encoding: {0}"/>
+            <Message Id="Reader_CouldNotDecodeFirstLine" Text="Could not decode first line of entity: {0}"/>
+            <Message Id="Reader_EOIInMultiSeq" Text="End of input was hit in the middle of a multibyte sequence"/>
+            <Message Id="Reader_EncodingNeedsCvtr" Text="This encoding ({0})should have had a transcoder"/>
+            <Message Id="Reader_BadUTF8Seq" Text="Invalid second byte of a UTF-8 character sequence"/>
+            <Message Id="Reader_BadSurrogateInUTF8" Text="Invalid surrogate character found in UTF-8 data"/>
+            <Message Id="Scan_CouldNotOpenSource" Text="The primary document entity could not be opened. Id={0}"/>
+            <Message Id="Scan_UnbalancedStartEnd" Text="Unbalanced start/end tags found, cannot continue"/>
+            <Message Id="AttDef_BadAttType" Text="The passed AttTypes value is not known"/>
+            <Message Id="AttDef_BadDefAttType" Text="The passed DefAttTypes value is not known"/>
+            <Message Id="BufMgr_NoMoreBuffers" Text="The buffer manager cannot provide any more buffers"/>
+            <Message Id="BufMgr_BufferNotInPool" Text="The passed buffer was not found in this manager's pool"/>
+            <Message Id="XMLRec_UnknownEncoding" Text="The passed recognizer encoding was not known"/>
+            <Message Id="Trans_CouldNotXCodeXMLData" Text="The block of XML data could not be transcoded"/>
+            <Message Id="Trans_CouldNotCreateDefCvtr" Text="Could not create a default transcoder"/>
+            <Message Id="CM_BinOpHadUnaryType" Text="The binary operation node had a unary node type"/>
+            <Message Id="CM_MustBeMixedOrChildren" Text="The content type must be mixed or children"/>
+            <Message Id="CM_NoPCDATAHere" Text="PCDATA nodes are not valid here"/>
+            <Message Id="CM_NotValidForSpecType" Text="The {0} operation is invalid for the spec type"/>
+            <Message Id="CM_UnaryOpHadBinType" Text="The unary operation node had a binary node type"/>
+            <Message Id="CM_UnknownCMType" Text="Unknown content model type"/>
+            <Message Id="CM_UnknownCMSpecType" Text="Unknown content spec type"/>
+            <Message Id="Val_InvalidElemId" Text="The element id was invalid"/>
+            <Message Id="Val_CantHaveIntSS" Text="When reusing the validator, no internal subset is allowed"/>
+            <Message Id="Scan_BadPScanToken" Text="The call to scanNext() is illegal at this time"/>
+        </Error>
+    </MsgDomain>
+    <MsgDomain Domain="http://apache.org/xml/messages/XML4JErrors">
+        <Error>
+            <Message Id="BadMajorCode" Text="The majorCode parameter to createMessage was out of bounds"/>
+            <Message Id="MessageFormatFailure" Text="An internal error occurred while formatting the following message: "/>
+            <Message Id="UnterminatedPEReference" Text="The parameter entity reference must end with the ';' delimiter. "/>
+            <Message Id="ExternalIDRequired" Text="The external entity declaration must begin with either SYSTEM or PUBLIC "/>
+            <Message Id="RecursiveReference" Text="Recursive reference {0} (Reference path: '{1}') "/>
+            <Message Id="ImproperDeclarationNesting" Text="The replacement text of parameter entity `(0)'' must be properly nested"/>
+            <Message Id="ErrorMessageAvailable" Text="There is a message available for this error. "/>
+            <Message Id="IncompleteContent" Text="The content is not complete. "/>
+            <Message Id="UnterminatedSystemID" Text="Expected a termination character for the system id. "/>
+            <Message Id="UnterminatedPublicID" Text="Expected a termination character for the public id. "/>
+            <Message Id="UnterminatedEnumeration" Text="Expected a termination character for the enumeration. "/>
+            <Message Id="CDEndInContent" Text="Expected a CD end in the content section. "/>
+            <Message Id="TwoColonsInQName" Text="Expected two colons, '::', in the Q Name. "/>
+            <Message Id="MarkupNotRecognized" Text="Markup tags are not recognised. "/>
+            <Message Id="URIFragmentInSystemId" Text="URI Fragment found in System Id "/>
+            <Message Id="ElementTypeReqInElementDecl" Text="Expected a element type in the element declaration. "/>
+            <Message Id="UnterminatedAttributeValue" Text="Expected a termination character for the attribute value. "/>
+            <Message Id="MaximumCodeReached" Text="The maximum size for code has been reached. "/>
+        </Error>
+    </MsgDomain>
+</MsgFile>
diff --git a/src/NLS/XML4CMsgSet.Dtd b/src/NLS/XML4CMsgSet.Dtd
new file mode 100644
index 0000000000000000000000000000000000000000..031aa671a025d0de2658fd64dc8568c665b14fbb
--- /dev/null
+++ b/src/NLS/XML4CMsgSet.Dtd
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="USASCII" ?>
+
+<!-- =====================================================================
+     A message represents a single named message that can be loaded
+     ===================================================================== -->
+<!ELEMENT   Message     (#PCDATA)>
+<!ATTLIST   Message
+            Id          CDATA #REQUIRED
+            Text        CDATA #REQUIRED>
+
+
+<!-- =====================================================================
+     A message type represents groups of messages of the same severity
+     ===================================================================== -->
+<!ELEMENT   Warning     (Message*)>
+<!ELEMENT   Error       (Message*)>
+<!ELEMENT   Validity    (Message*)>
+
+
+<!-- =====================================================================
+     A message domain represents (optionally) a group of warnings, errors,
+     and validity errors.
+     ===================================================================== -->
+<!ELEMENT   MsgDomain   (Warning?, Error?, Validity?)>
+<!ATTLIST   MsgDomain
+            Domain      CDATA #REQUIRED>
+
+
+<!-- =====================================================================
+     A message file is the top level element, which contains all the
+     general info about the messages contained, and the child elements
+     that contain the various message domain.
+     ===================================================================== -->
+<!ELEMENT   MsgFile     (MsgDomain+)>
+<!ATTLIST   MsgFile
+            Locale      CDATA #REQUIRED>
diff --git a/src/NLS/XMLErrList.dtd b/src/NLS/XMLErrList.dtd
new file mode 100644
index 0000000000000000000000000000000000000000..3474153edaf531d9bb9a5e5600de26c40df38fc8
--- /dev/null
+++ b/src/NLS/XMLErrList.dtd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="USASCII" ?>
+
+<!-- =====================================================================
+     A message represents a single named message that can be loaded
+     ===================================================================== -->
+<!ELEMENT   Message (#PCDATA)>
+<!ATTLIST   Message
+            Id      CDATA #REQUIRED
+            Text    CDATA #REQUIRED>
+
+
+<!-- =====================================================================
+     A message type represents groups of messages of the same severity
+     ===================================================================== -->
+<!ELEMENT   Warning     (Message*)>
+<!ELEMENT   Error       (Message*)>
+
+
+<!-- =====================================================================
+     A message domain represents (optionally) a group of warnings, errors,
+     and validity errors.
+     ===================================================================== -->
+<!ELEMENT   MsgDomain   (Warning?, Error?)>
+<!ATTLIST   MsgDomain
+            Domain      CDATA #REQUIRED>
+
+
+<!-- =====================================================================
+     A message file is the top level element, which contains all the
+     general info about the messages contained, and the child elements
+     that contain the various message domain.
+     ===================================================================== -->
+<!ELEMENT   MsgFile     (MsgDomain+)>
+<!ATTLIST   MsgFile
+            Locale      CDATA #REQUIRED>
diff --git a/src/dom/AttrImpl.cpp b/src/dom/AttrImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8c65573a42b215a4055701f1fba52835124c1c2f
--- /dev/null
+++ b/src/dom/AttrImpl.cpp
@@ -0,0 +1,217 @@
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:39  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:10  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "AttrImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DocumentImpl.hpp"
+#include "TextImpl.hpp"
+
+
+#define null 0
+
+AttrImpl::AttrImpl(DocumentImpl *ownerDoc, const DOMString &aName) 
+:  NodeImpl (ownerDoc, aName, DOM_Node::ATTRIBUTE_NODE, false, DOMString())
+{
+    specified = true;
+    ownerElement = null;    //DOM Level 2
+};
+
+//DOM Level 2
+AttrImpl::AttrImpl(DocumentImpl *ownerDoc,   //DOM Level 2
+    const DOMString &namespaceURI, const DOMString &qualifiedName)
+:  NodeImpl (ownerDoc, namespaceURI, qualifiedName, DOM_Node::ATTRIBUTE_NODE, false, DOMString())
+{
+    specified = true;
+    ownerElement = null;    //DOM Level 2
+};
+
+AttrImpl::AttrImpl(const AttrImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+    specified = false;
+    ownerElement = null;    //DOM Level 2
+};
+
+
+AttrImpl::~AttrImpl() {
+};
+
+
+NodeImpl * AttrImpl::cloneNode(bool deep) 
+{
+    AttrImpl *newnode;
+    newnode = new AttrImpl(*this, deep);
+    return newnode;
+};
+
+
+DOMString AttrImpl::getName()
+{
+    return name;
+};
+
+
+
+DOMString AttrImpl::getNodeValue()
+{
+    return getValue();
+};
+
+
+
+bool AttrImpl::getSpecified() 
+{
+    return specified;
+};
+
+
+
+
+DOMString AttrImpl::getValue() 
+{
+    int             length = 0;
+    NodeImpl        *node;
+    for (node = getFirstChild(); node != null; node = node->getNextSibling())
+        length += node->getNodeValue().length();
+    
+    DOMString retString(length);
+    for (node = getFirstChild(); node != null; node = node->getNextSibling())
+    {
+        retString.appendData(node->getNodeValue());
+    };
+    
+    return retString;
+};
+
+
+bool AttrImpl::isAttrImpl()
+{
+    return true;
+};
+
+
+void AttrImpl::setNodeValue(const DOMString &val)
+{
+    setValue(val);
+};
+
+
+
+void AttrImpl::setSpecified(bool arg)
+{
+    specified = arg;
+};
+
+
+
+void AttrImpl::setValue(const DOMString &val)
+{
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    NodeImpl *kid;
+    while ((kid = getFirstChild()) != null)         // Remove existing kids
+    {
+        removeChild(kid);
+        if (kid->nodeRefCount == 0)
+            NodeImpl::deleteIf(kid);
+    }
+
+    if (val != null)              // Create and add the new one
+        appendChild(ownerDocument->createTextNode(val));
+    specified = true;
+    changed();
+};
+
+
+
+DOMString AttrImpl::toString()
+{
+    DOMString retString;
+    
+    retString.appendData(name);
+    retString.appendData(DOMString("=\""));
+    retString.appendData(getValue());
+    retString.appendData(DOMString("\""));
+    return retString;
+}
+
+
+//Introduced in DOM Level 2
+
+ElementImpl *AttrImpl::getOwnerElement()
+{
+    return ownerElement;
+}
+
+
+//internal use by parser only
+void AttrImpl::setOwnerElement(ElementImpl *ownerElem)
+{
+    ownerElement = ownerElem;
+}
diff --git a/src/dom/AttrImpl.hpp b/src/dom/AttrImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..2f3373495747aaa57f5ea937e2c4257a535b38f8
--- /dev/null
+++ b/src/dom/AttrImpl.hpp
@@ -0,0 +1,117 @@
+#ifndef AttrImpl_HEADER_GUARD_
+#define AttrImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:40  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:10  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+#include "DOM_Node.hpp"
+
+class ElementImpl;
+
+class AttrImpl: public NodeImpl {
+    
+public:
+    bool specified;
+
+    //Introduced in DOM Level 2
+    ElementImpl *ownerElement;    
+    
+public:
+    AttrImpl(DocumentImpl *ownerDocument, const DOMString &aName);
+    AttrImpl(DocumentImpl *ownerDocument,   //DOM Level 2
+	const DOMString &namespaceURI, const DOMString &qualifiedName);
+    AttrImpl(const AttrImpl &other, bool deep=false);
+    virtual ~AttrImpl();
+    virtual NodeImpl *cloneNode(bool deep=false);
+    virtual DOMString getName();
+    virtual DOMString getNodeValue();
+    virtual bool getSpecified();
+    virtual DOMString getValue();
+    virtual bool isAttrImpl();
+    virtual void setNodeValue(const DOMString &value);
+    virtual void setSpecified(bool arg);
+    virtual void setValue(const DOMString &value);
+    virtual DOMString toString();
+
+    //Introduced in DOM Level 2
+    ElementImpl *getOwnerElement();
+    void setOwnerElement(ElementImpl *ownerElem);    //internal use only
+};
+
+#endif
diff --git a/src/dom/CDATASectionImpl.cpp b/src/dom/CDATASectionImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2f0090ef739bfc911772693202108f8ad6bf7972
--- /dev/null
+++ b/src/dom/CDATASectionImpl.cpp
@@ -0,0 +1,103 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:40  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:10  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "CDATASectionImpl.hpp"
+#include "DOM_Node.hpp"
+#include "DocumentImpl.hpp"
+#include "DStringPool.hpp"
+
+CDATASectionImpl::CDATASectionImpl(DocumentImpl *ownerDoc, const DOMString &data) :
+                TextImpl(ownerDoc,data)
+{
+        static DOMString *gcdata_section = 0;   // will be lazily initialized
+
+        // Overwrite Text's type information to reflect the subclass:
+        name=DStringPool::getStaticString("#cdata-section", &gcdata_section);
+        nType=DOM_Node::CDATA_SECTION_NODE;
+};
+
+
+CDATASectionImpl::CDATASectionImpl(const CDATASectionImpl &other, bool deep)
+: TextImpl(other, deep)
+{
+};
+
+
+CDATASectionImpl::~CDATASectionImpl()
+{
+};
+
+
+NodeImpl  *CDATASectionImpl::cloneNode(bool deep)
+{
+    return new CharacterDataImpl(*this, deep);
+};  
+
+
+bool CDATASectionImpl::isCDATASectionImpl()
+{
+    return true;
+};
diff --git a/src/dom/CDATASectionImpl.hpp b/src/dom/CDATASectionImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..6f6696a81b9e5b0deae57584b4b17075c4e43391
--- /dev/null
+++ b/src/dom/CDATASectionImpl.hpp
@@ -0,0 +1,94 @@
+#ifndef CDATASectionImpl_HEADER_GUARD_
+#define CDATASectionImpl_HEADER_GUARD_
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:41  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:10  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+#include <util/XML4CDefs.hpp>
+#include "TextImpl.hpp"
+
+
+class CDATASectionImpl: public TextImpl {
+public:
+    CDATASectionImpl(DocumentImpl *ownerDoc, const DOMString & data);
+    CDATASectionImpl(const CDATASectionImpl &other, bool deep = false);
+    
+    virtual             ~CDATASectionImpl();
+    virtual NodeImpl    *cloneNode(bool deep);
+    virtual bool        isCDATASectionImpl();
+};
+
+#endif
+
diff --git a/src/dom/CharacterDataImpl.cpp b/src/dom/CharacterDataImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fd309eea064386f64c5034b30fe614391380eeaf
--- /dev/null
+++ b/src/dom/CharacterDataImpl.cpp
@@ -0,0 +1,201 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:41  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:11  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "CharacterDataImpl.hpp"
+#include "DOM_DOMException.hpp"
+
+
+CharacterDataImpl::CharacterDataImpl(DocumentImpl *ownerDoc, const DOMString &nam,
+                                     short nTyp, const DOMString &data) :
+NodeImpl(ownerDoc, nam, nTyp, true, data)
+{
+};
+
+CharacterDataImpl::CharacterDataImpl(const CharacterDataImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+};
+
+
+CharacterDataImpl::~CharacterDataImpl() {
+};
+
+
+
+void CharacterDataImpl::appendData(const DOMString &data)
+{
+    if(readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    value.appendData(data);
+};
+
+
+NodeImpl *CharacterDataImpl::cloneNode(bool deep)
+{
+    return new CharacterDataImpl(*this, deep);
+};
+
+
+void CharacterDataImpl::deleteData(int offset, int count)
+{
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    if (count < 0)
+        throw new DOM_DOMException(DOM_DOMException::INDEX_SIZE_ERR, null);
+    
+    
+    //int tailLength = Math.max(value.length() - count - offset, 0);
+    //try
+    //{
+    //      value = value.substring(0, offset) + (tailLength > 0 ? value.substring(offset + count, offset + count + tailLength) : "");
+    //}
+    //catch (StringIndexOutOfBoundsException e)
+    //{
+    //      throw new DOM_DOMException(DOMException.INDEX_SIZE_ERR, null);
+    
+    int len = value.length();
+    if (offset < 0 || offset >= len)
+        throw new DOM_DOMException(DOM_DOMException::INDEX_SIZE_ERR, null);
+    
+    value.deleteData(offset, count);
+};
+
+
+
+DOMString CharacterDataImpl::getData()
+{
+    return value.clone();        // clone here so that subsequent changes to
+    //  our value will not change the returned string.
+};
+
+
+//
+//  getCharDataLength - return the length of the character data string.
+//                      Note:  in the public DOM API, the name of this method
+//                      is getLength(), but has been renamed here to avoid a
+//                      conflict with NodeListImpl::getLength().  The conflict
+//                      occurs because NodeListImpl is a base class of us.
+//                      DOM_CharData::getLength() delegates to this method, so
+//                      all of the names are correct from an external API
+//                      point of view.
+//
+int CharacterDataImpl::getCharDataLength()
+{
+    return value.length();
+};
+
+
+
+void CharacterDataImpl::insertData(int offset, const DOMString &data) 
+{
+    
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    if (offset<0 || offset>value.length())
+        throw new DOM_DOMException(DOM_DOMException::INDEX_SIZE_ERR, null);
+    
+    value.insertData(offset, data);
+}
+
+
+
+void CharacterDataImpl::replaceData(int offset, int count, const DOMString &data)
+{
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    deleteData(offset, count);
+    insertData(offset, data);
+};
+
+
+
+
+void CharacterDataImpl::setData(const DOMString &arg)
+{
+    if (readOnly)
+        throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    value = arg.clone();
+};
+
+
+
+
+
+DOMString CharacterDataImpl::substringData(int offset, int count)
+{
+    
+    if(count < 0 || offset < 0 || offset > value.length()-1)
+        throw new DOM_DOMException(DOM_DOMException::INDEX_SIZE_ERR,null);
+    
+    return value.substringData(offset, count);
+};
+
diff --git a/src/dom/CharacterDataImpl.hpp b/src/dom/CharacterDataImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..39dbd90c48fb442ee2ab3d73b18ed795923fb874
--- /dev/null
+++ b/src/dom/CharacterDataImpl.hpp
@@ -0,0 +1,104 @@
+#ifndef CharacterDataImpl_HEADER_GUARD_
+#define CharacterDataImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:41  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:11  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+
+#include "NodeImpl.hpp"
+#include "DOMString.hpp"
+
+class CharacterDataImpl: public NodeImpl
+{
+public:
+    CharacterDataImpl(DocumentImpl *ownerDocument, const DOMString &name,
+        short nType, const DOMString &data);
+    CharacterDataImpl(const CharacterDataImpl &other, bool deep = false);
+    virtual ~CharacterDataImpl();
+    virtual void appendData(const DOMString &data);
+    virtual NodeImpl *cloneNode(bool deep);
+    virtual void deleteData(int offset, int count);
+    virtual DOMString getData();
+    virtual int getCharDataLength();
+    virtual void insertData(int offset, const DOMString &data);
+    virtual void replaceData(int offset, int count, const DOMString &data);
+    virtual void setData(const DOMString &arg);
+    virtual DOMString substringData(int offset, int count);
+    
+};
+
+
+#endif
diff --git a/src/dom/CommentImpl.cpp b/src/dom/CommentImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e9126814e1349283659be6b8f8fede157e7fbaaf
--- /dev/null
+++ b/src/dom/CommentImpl.cpp
@@ -0,0 +1,104 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:41  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:11  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+/**
+ * Represents an XML (or HTML) comment.
+ *
+ * @author Rania Y. Khalaf
+ * @author Joseph Kesselman 
+ * @since  PR-DOM-Level-1-19980818.
+ */
+
+#include "CommentImpl.hpp"
+#include "CharacterDataImpl.hpp"
+#include "DOM_Node.hpp"
+#include "DocumentImpl.hpp"
+#include "DStringPool.hpp"
+
+static DOMString *gComment;   // will be lazily initialized to point to "#comment"
+
+CommentImpl::CommentImpl(DocumentImpl *ownerDoc, const DOMString &data) :
+CharacterDataImpl(ownerDoc, DStringPool::getStaticString("#comment", &gComment),
+                  DOM_Node::COMMENT_NODE, data)
+{
+};
+
+
+CommentImpl::CommentImpl(const CommentImpl &other, bool deep)
+: CharacterDataImpl(other, deep)
+{
+};
+
+
+CommentImpl::~CommentImpl() {
+};
+
+
+
+NodeImpl * CommentImpl::cloneNode(bool deep)
+{
+        return new CommentImpl(*this, deep);
+};
diff --git a/src/dom/CommentImpl.hpp b/src/dom/CommentImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..843e48ecef276be01834fc3c3f63631c27af2245
--- /dev/null
+++ b/src/dom/CommentImpl.hpp
@@ -0,0 +1,93 @@
+#ifndef CommentImpl_HEADER_GUARD_
+#define CommentImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:42  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:11  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+#include <util/XML4CDefs.hpp>
+#include "CharacterDataImpl.hpp"
+
+class CommentImpl: public CharacterDataImpl {
+public:
+        CommentImpl(DocumentImpl *, const DOMString &);
+        CommentImpl(const CommentImpl &other, bool deep);
+        virtual ~CommentImpl();
+        virtual NodeImpl * cloneNode(bool deep);
+};
+
+#endif
+    
diff --git a/src/dom/DOM.hpp b/src/dom/DOM.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..d6fe2a4fcae8b21555f681836298e1664b8245da
--- /dev/null
+++ b/src/dom/DOM.hpp
@@ -0,0 +1,97 @@
+#ifndef DOM_HEADER_GUARD_
+#define DOM_HEADER_GUARD_
+
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:46  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:12  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This is the primary header file for inclusion in application
+//  programs using the C++ XML Document Object Model API.
+//
+
+#include <dom/DOM_Attr.hpp>
+#include <dom/DOM_CDATASection.hpp>
+#include <dom/DOM_CharacterData.hpp>
+#include <dom/DOM_Comment.hpp>
+#include <dom/DOM_Document.hpp>
+#include <dom/DOM_DocumentFragment.hpp>
+#include <dom/DOM_DocumentType.hpp>
+#include <dom/DOM_DOMException.hpp>
+#include <dom/DOM_DOMImplementation.hpp>
+#include <dom/DOM_Element.hpp>
+#include <dom/DOM_Entity.hpp>
+#include <dom/DOM_EntityReference.hpp>
+#include <dom/DOM_NamedNodeMap.hpp>
+#include <dom/DOM_Node.hpp>
+#include <dom/DOM_NodeList.hpp>
+#include <dom/DOM_Notation.hpp>
+#include <dom/DOM_ProcessingInstruction.hpp>
+#include <dom/DOM_Text.hpp>
+#include <dom/DOMString.hpp>
+
+
+#endif
diff --git a/src/dom/DOMString.cpp b/src/dom/DOMString.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..73254369cb9525a515c956092c00cc68101ae5ca
--- /dev/null
+++ b/src/dom/DOMString.cpp
@@ -0,0 +1,858 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:47  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:12  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include <util/PlatformUtils.hpp>
+#include <util/RuntimeException.hpp>
+#include <util/StdOut.hpp>
+#include <util/TransService.hpp>
+#include "DOMString.hpp"
+
+#include <assert.h>
+#include <string.h>
+
+
+ 
+
+//----------------------------------------------
+//
+//      DOMStringData
+//
+//----------------------------------------------
+class   DOMStringData
+{
+public:
+    int                 fBufferLength;
+    int                 fRefCount;
+    XMLCh               fData[1];
+    
+    static DOMStringData *allocateBuffer(int length);
+    inline void         addRef();
+    inline void         removeRef();
+};
+
+void DOMStringData::removeRef()
+{
+    int result = XMLPlatformUtils::atomicDecrement(fRefCount);
+    if (result==0)
+    {
+        fBufferLength = 0xcccc;
+        fRefCount     = 0xcccc;
+        delete this;
+        XMLPlatformUtils::atomicDecrement(DOMString::gLiveStringDataCount);
+    };
+};
+
+
+void DOMStringData::addRef()
+{
+    XMLPlatformUtils::atomicIncrement(fRefCount);
+};
+
+
+DOMStringData *DOMStringData::allocateBuffer(int length)
+{
+    int sizeToAllocate = sizeof(DOMStringData) //  buffer will contain an
+        + length*sizeof(XMLCh);                //  extra elem because of stub
+                                               //  array in DOMStringData struct.
+    DOMStringData *buf = (DOMStringData *) new char[sizeToAllocate];
+    XMLPlatformUtils::atomicIncrement(DOMString::gLiveStringDataCount);
+    XMLPlatformUtils::atomicIncrement(DOMString::gTotalStringDataCount);
+    buf->fBufferLength = length;
+    buf->fRefCount = 1;
+    buf->fData[0] = 0;
+    return buf;
+}
+
+
+
+
+//----------------------------------------------------
+//
+//      DOMStringHandle
+//
+//-----------------------------------------------------
+
+class  DOMStringHandle
+{
+public:
+            int              fLength;
+            int              fRefCount;
+            DOMStringData    *fDSData;
+
+    void    *operator new( size_t sizeToAlloc);
+    void    operator delete( void *pvMem );
+private:
+    static  void *freeListPtr;
+public:
+    static  DOMStringHandle  *createNewStringHandle(int bufLength);
+            DOMStringHandle  *cloneStringHandle();
+    inline  void             addRef();
+    inline  void             removeRef();
+                             ~DOMStringHandle() {};
+private:
+    inline                   DOMStringHandle() {};
+};
+
+
+//
+//  Specialized new and delete operators for DOMStringHandles.
+//      These are used, rather than the standard system operator new,
+//      for improved performance.
+//
+//      We allocate largish blocks of memory using the standard system
+//      new function, and sub-allocate string handles from that block.
+//      Un-allocated string handles within the allocated blocks are kept
+//      in a singly linked list, making allocation and deallocation
+//      very quick in the common case.
+//
+//      String handle allocation is thread safe.  A multi-threaded
+//      application may have threads concurrently accessing multiple
+//      DOM documents; since all string handles come from the same pool,
+//      this allocator must be safe.  The compare and exchange function,
+//      which is available as a single instruction in most processor
+//      architectures, and typically surfaced as an OS function,
+//      is used to safely update the string handle free list.
+//
+void *DOMStringHandle::freeListPtr = 0;   // Point to the head of the
+                                          //  free list of un-allocated
+                                          //  string handles, or 0 if there
+                                          //  are no free string handles.
+
+static const int allocGroupSize = 1024;   // Number of string handles to allocate
+                                          //  as a chunk from the system's
+                                          //  memory allocator.
+
+
+void *DOMStringHandle::operator new(size_t sizeToAlloc)
+{
+    assert(sizeToAlloc == sizeof(DOMStringHandle));
+    void    *retPtr;
+    void    *oldFreeListPtr;
+
+    do
+    {
+       retPtr = freeListPtr;    // In the common case, freeListPtr points
+                                //   to an available string handle, and
+                                //   this will be the block we return.
+       
+       if (retPtr == 0) 
+       {
+           // Uncommon case.  The free list of string handles is empty
+           // and we must allocate a new batch of them, using
+           // the system's operator new.  
+           //
+           // Link all but one of these new StringHandles into our free list by 
+           // deleting them with DOMStringHandle::operator delete.
+           // Unconditionally return the one that we didn't put in the free list.
+           //
+           // There is a remote chance that two threads could see the free list
+           //  as empty at about the same time and both fall into this code.
+           //  No great harm will result - the free list will have twice the
+           //  usual number of new free handles added to it.  It's not worth
+           //  any added code complexity to prevent it from happening.
+           DOMStringHandle *dsg = 
+               ::new DOMStringHandle[allocGroupSize];
+           int   i;
+           for (i=1; i<allocGroupSize-1; i++)
+               delete &dsg[i];
+
+           return &dsg[0];
+       }
+
+       // Thread-safe (atomic) update of freeListPtr.
+       oldFreeListPtr = XMLPlatformUtils::compareAndSwap(&freeListPtr, *(void **)retPtr, retPtr);
+    }
+    // This loop will normally exit the first time through.  It will only repeat if,
+    // in a multi-threaded environment, some second thread updated the free list ptr
+    // in the interval between when we looked at it (retPtr = freeListPtr;) and when
+    // we attempted to update it ourselves with the compareAndSwap().
+    while (oldFreeListPtr != retPtr);
+
+    return retPtr;
+};
+
+
+
+void DOMStringHandle::operator delete(void *pMem)
+{
+    void    *initialFreeListPtr;
+    void    *oldFreeListPtr;
+    do
+    {
+        *(void **)pMem = initialFreeListPtr = freeListPtr;
+        oldFreeListPtr = XMLPlatformUtils::compareAndSwap(&freeListPtr, pMem, initialFreeListPtr);
+    }
+    while (oldFreeListPtr != initialFreeListPtr);
+};
+    
+
+void DOMStringHandle::addRef()
+{
+    XMLPlatformUtils::atomicIncrement(fRefCount);
+};
+
+
+void DOMStringHandle::removeRef()
+{
+    int result = XMLPlatformUtils::atomicDecrement(fRefCount);
+    if (result==0)
+    {
+        fDSData->removeRef();
+        delete this;
+        XMLPlatformUtils::atomicDecrement(DOMString::gLiveStringHandleCount);
+    };
+};
+
+
+DOMStringHandle *DOMStringHandle::createNewStringHandle(int bufLength)
+{
+    DOMStringHandle  *h = new DOMStringHandle;
+    XMLPlatformUtils::atomicIncrement(DOMString::gLiveStringHandleCount);
+    XMLPlatformUtils::atomicIncrement(DOMString::gTotalStringHandleCount);
+    h -> fLength = 0;
+    h -> fRefCount = 1;
+    h -> fDSData = DOMStringData::allocateBuffer(bufLength);
+    return h;
+};
+
+
+DOMStringHandle *DOMStringHandle::cloneStringHandle()
+{
+    DOMStringHandle *h = new DOMStringHandle;
+    XMLPlatformUtils::atomicIncrement(DOMString::gLiveStringHandleCount);
+    h->fLength   = fLength;
+    h->fRefCount = 1;
+    h->fDSData   = fDSData;
+    h->fDSData->addRef();
+    return h;
+}
+
+//------------------------------------------------------------
+//
+//      DOMString
+//
+//------------------------------------------------------------
+
+
+int DOMString::gLiveStringDataCount    = 0;
+int DOMString::gTotalStringDataCount   = 0;
+int DOMString::gLiveStringHandleCount  = 0;
+int DOMString::gTotalStringHandleCount = 0;
+
+
+DOMString::DOMString()
+{
+    fHandle = 0;
+};
+
+
+DOMString::DOMString(const DOMString &other)
+{
+    fHandle = other.fHandle;
+    if (fHandle)
+        fHandle->addRef();
+};
+
+
+DOMString::DOMString(const XMLCh *data)
+{
+    fHandle = 0;
+    if (data != 0)
+    {
+        int dataLength = 0;
+        while (data[dataLength] != 0)
+            ++dataLength;
+                
+        if (dataLength != 0)
+        {
+            fHandle = DOMStringHandle::createNewStringHandle(dataLength+1);
+            fHandle->fLength = dataLength;
+            XMLCh *strData = fHandle->fDSData->fData;
+            int i;
+            for (i=0; i<dataLength ; ++i)
+                strData[i] = data[i];
+
+            strData[dataLength] = 0;
+        }
+    }
+}
+
+
+
+DOMString::DOMString(const XMLCh *data, int dataLength)
+{
+    fHandle = 0;
+    if (data != 0)
+    {
+        if (dataLength > 0)
+        {
+            fHandle = DOMStringHandle::createNewStringHandle(dataLength+1);
+            fHandle->fLength = dataLength;
+            XMLCh *strData = fHandle->fDSData->fData;
+            int i;
+            for (i=0; i<dataLength ; ++i)
+                strData[i] = data[i];
+
+            strData[dataLength] = 0;
+        }
+    }
+}
+
+
+
+
+//  getDOMConverter - get the converter from the system default
+//          codepage to Unicode that is to be used when
+//          a DOMString is constructed from a char *.
+//
+XMLTranscoder*  getDomConverter()
+{
+    static XMLTranscoder* gDomConverter = 0;
+    if (!gDomConverter) 
+    {
+        XMLTranscoder* transcoder =
+        XMLPlatformUtils::fgTransService->makeNewDefTranscoder();
+        if (!transcoder)
+            XMLPlatformUtils::panic(XMLPlatformUtils::Panic_NoDefTranscoder
+            );
+
+        if (XMLPlatformUtils::compareAndSwap((void **)&gDomConverter,
+        transcoder, 0) != 0)
+            delete gDomConverter;
+    }
+    return gDomConverter;
+};
+
+
+
+//
+//  Create a DOMString from a char * string in the default code page
+//                     of the system on which we are executing.
+// 
+//
+DOMString::DOMString(const char *srcString)
+{
+    fHandle = 0;
+    if (srcString != 0)
+    {
+        XMLTranscoder*  uniConverter = getDomConverter();
+        unsigned int    len = 0;
+
+        unsigned int srcLen = strlen(srcString);
+        if (srcLen == 0)
+            return;
+
+        const unsigned int charsNeeded =
+            uniConverter->calcRequiredSize(srcString);
+
+        fHandle = DOMStringHandle::createNewStringHandle(charsNeeded + 1);
+        fHandle->fLength = charsNeeded;
+        XMLCh *strData = fHandle->fDSData->fData;
+        if (!uniConverter->transcode(srcString, strData, charsNeeded))
+        {
+            // <TBD> We should throw something here?
+        }
+    }
+};
+
+
+
+
+
+
+DOMString::DOMString(int initialBufferSize)
+{
+    fHandle = 0;
+    if (initialBufferSize > 0)
+        fHandle = DOMStringHandle::createNewStringHandle(initialBufferSize);
+};
+
+
+DOMString::~DOMString()
+{
+    if (fHandle)
+        fHandle->removeRef();
+
+    fHandle = 0;
+};
+
+
+DOMString & DOMString::operator =(const DOMString &other)
+{
+    if (this == &other)
+        return *this;
+
+    if (fHandle)
+        fHandle->removeRef();
+
+    fHandle = other.fHandle;
+    
+    if (fHandle)
+        fHandle->addRef();
+
+    return *this;
+};
+
+
+DOMString DOMString::operator + (const DOMString &other)
+{
+    DOMString retString = this->clone();
+    retString.appendData(other);
+    return retString;
+};
+
+
+bool DOMString::operator ==(const DOMString &other) const
+{
+    return this->fHandle == other.fHandle;
+};
+
+
+bool DOMString::operator !=(const DOMString &other) const
+{
+    return this->fHandle != other.fHandle;
+};
+
+
+bool DOMString::operator == (const DOM_NullPtr *p) const
+{
+    return (fHandle == 0);
+};
+
+bool DOMString::operator != (const DOM_NullPtr *p) const
+{
+    return (fHandle != 0);
+};
+
+void DOMString::appendData(const DOMString &other)
+{
+    int i;
+    if (other.fHandle == 0 || other.fHandle->fLength == 0)
+        return;
+
+    if (fHandle == 0 || fHandle->fLength == 0)
+    {
+        if (fHandle) fHandle->removeRef();
+        this->fHandle = other.fHandle->cloneStringHandle();
+        return;
+    }
+
+    int newLength = fHandle->fLength + other.fHandle->fLength;
+    if (newLength >= fHandle->fDSData->fBufferLength ||
+        fHandle->fDSData->fRefCount > 1)
+    {
+        // We can't stick the data to be added onto the end of the
+        //  existing string, either because there is not space in
+        //  the buffer, or because the buffer is being shared with
+        //  some other string.  So, make a new buffer.
+        DOMStringData *newBuf = DOMStringData::allocateBuffer(newLength);
+        XMLCh *newP = newBuf->fData;
+        XMLCh *oldP = fHandle->fDSData->fData;
+        for (i=0; i<fHandle->fLength; ++i)
+            newP[i] = oldP[i];
+        
+        fHandle->fDSData->removeRef();
+        fHandle->fDSData = newBuf;
+    }
+
+    XMLCh *srcP = other.fHandle->fDSData->fData;
+    XMLCh *destP = &fHandle->fDSData->fData[fHandle->fLength];
+    for (i=0; i<=other.fHandle->fLength; i++)
+        destP[i] = srcP[i];
+
+    fHandle->fLength += other.fHandle->fLength;
+}
+
+
+XMLCh     DOMString::charAt(int index) const
+{
+    XMLCh retCh = 0;
+    if (fHandle != 0  && index >= 0 &&  index < fHandle->fLength)
+        retCh = fHandle->fDSData->fData[index];
+    return retCh;
+};
+
+
+DOMString DOMString::clone() const
+{
+    DOMString retString;
+
+    if (fHandle != 0)
+        retString.fHandle = this->fHandle->cloneStringHandle();
+
+    return retString;
+};
+
+
+
+void DOMString::deleteData(int offset, int delLength)
+{
+    assert(delLength >= 0);
+    int stringLen = this->length();
+    assert(offset < stringLen);
+
+    if (delLength == 0)
+        return;
+
+
+    if (offset + delLength >= stringLen)
+        delLength = stringLen - offset;
+
+    int newStringLength = stringLen - delLength;
+    if (fHandle->fDSData->fRefCount > 1 && offset+delLength < stringLen)
+    {
+        // The deletion is of a range in the middle of the string
+        //  and there's another string handle using the buffer so
+        //  we need to make a new buffer before moving characters
+        //  around.
+        DOMStringData *newBuf = DOMStringData::allocateBuffer(newStringLength);
+        XMLCh *newP = newBuf->fData;
+        XMLCh *oldP = fHandle->fDSData->fData;
+        int i;
+        for (i=0; i<offset; i++)
+            newP[i] = oldP[i];
+
+        for (i=offset; i<newStringLength; i++)
+            newP[i] = oldP[i+delLength];
+
+        fHandle->fLength = newStringLength;
+        fHandle->fDSData->removeRef();
+        fHandle->fDSData = newBuf;
+    }
+    else if (offset+delLength < stringLen)
+    {
+        // The deletion is of a range in the middle of the string,
+        // but no other string is sharing the buffer, so we can
+        // just delete in place.
+        int i;
+        XMLCh *bufP =  fHandle->fDSData->fData;
+        for (i=offset; i<newStringLength; i++)
+            bufP[i] = bufP[i+delLength];
+
+        fHandle->fLength = newStringLength;
+    }
+    else 
+    {
+        // The deletion continues to the end of the string.
+        // Simply reset the length.  We don't need to worry
+        // about other strings sharing the buffer because
+        // no characters are moved.
+        fHandle->fLength = newStringLength;
+    }
+};
+
+
+
+bool DOMString::equals(const DOMString &other) const
+{
+        bool retVal = true;
+    if (this->fHandle != 0  && other.fHandle != 0)
+    {
+        if (this->fHandle->fLength != other.fHandle->fLength)
+        {
+            retVal =  false;
+        }
+        else
+        {
+            XMLCh *thisP  = this->fHandle->fDSData->fData;
+            XMLCh *otherP = other.fHandle->fDSData->fData;
+            int i;
+            for (i=0; i<this->fHandle->fLength; i++)
+            {
+                if (thisP[i] != otherP[i])
+                {
+                    retVal = false;
+                    break;
+                }
+            }
+        }
+    }
+    else
+    {
+        // At this point, one or more of the fHandle
+        //  pointers is known to be zero.
+        if (fHandle       && fHandle->fLength != 0  ||
+            other.fHandle && other.fHandle->fLength != 0)
+            retVal = false;
+
+    }
+    return retVal;
+};
+
+
+
+bool DOMString::equals(const XMLCh *other) const
+{
+    if (this->fHandle != 0  && other != 0)
+    {
+        // Both strings have non-null data pointers, so
+        //  we can go ahead and actually compare them.
+        XMLCh *thisP  = this->fHandle->fDSData->fData;
+        int    len    = this->fHandle->fLength;
+
+        int i;
+        for (i=0; i<len; i++)
+        {
+            if (other[i] == 0)   // "other" is null terminated.
+                return false;    //   (If there were no chance of a DOM
+                                 //   string having a 0 char in the middle of
+                                 //   it, this test could be omitted.)
+
+            if (thisP[i] != other[i])
+                return false;
+        }
+
+        if (other[len] != 0)     // This test for the end of the other
+            return false;        //  string can't be done without first
+                                 //  checking that we haven't walked off the
+                                 //  end.  (It has actually happened - off end
+                                 //  of string, page, and valid memory.)
+
+        return true;
+    }
+
+
+    // At this point, we know that at least one of the strings had a null
+    //  data pointer.
+    if (fHandle  && fHandle->fLength != 0)
+        return false; 
+    
+    if (other && *other != 0)
+        return false;
+        
+    return true;  // Both strings are empty.  DOMString treats zero-length
+                  //   and a null data pointer as equivalent.
+};
+
+
+void DOMString::insertData(int offset, const DOMString &src)
+{
+    assert(offset>=0);
+    int origStrLength = this->length();
+    assert(offset<=origStrLength);
+
+    if (fHandle == 0)
+    {
+        *this = src.clone();
+        return;
+    }
+
+    if (src.fHandle == 0 ||src.fHandle->fLength == 0)
+        return;
+
+    XMLCh *srcP = src.fHandle->fDSData->fData;
+    int srcLength = src.fHandle->fLength;
+    int newLength = fHandle->fLength + srcLength;
+    if (newLength >= fHandle->fDSData->fBufferLength ||
+        fHandle->fDSData->fRefCount > 1)
+    {
+        // We can't stick the data to be added into the
+        //  existing string, either because there is not space in
+        //  the buffer, or because the buffer is being shared with
+        //  some other string.  So, make a new buffer.
+
+        DOMStringData *newBuf = DOMStringData::allocateBuffer(newLength);
+        XMLCh *newP  = newBuf->fData;
+        XMLCh *oldP   = fHandle->fDSData->fData;
+        int i;
+        for (i=0; i<offset; ++i)
+            newP[i] = oldP[i];
+
+        for (i=0; i<srcLength; i++)
+            newP[i+offset] = srcP[i];
+        
+        for (i=offset; i<origStrLength; i++)
+            newP[i+srcLength] = oldP[i];
+
+        fHandle->fDSData->removeRef();
+        fHandle->fDSData = newBuf;
+    }
+    else
+    {
+        // There is room in the already-existing buffer to hold
+        //  the data to be inserted.  Insert it.
+        //
+        XMLCh *destP = fHandle->fDSData->fData;
+        int i;
+        for (i=origStrLength-1; i>=offset; i--)
+            destP[i+srcLength] = destP[i];
+
+        for (i=0; i<srcLength; i++)
+            destP[i+offset] = srcP[i];
+    };
+
+    fHandle->fLength += srcLength;
+}
+
+
+
+int DOMString::length() const
+{
+    int             len = 0;
+    if (fHandle != 0)
+        len = fHandle->fLength;
+
+    return len;
+};
+
+
+
+void DOMString::print() const
+{
+    int len = this->length();
+
+    if (len > 0)
+    {
+
+        XMLCh *p = fHandle->fDSData->fData;
+
+		XMLStdOut out;
+		XMLCh* buffer = new XMLCh[len+1];
+        int i;
+		for (i=0; i<len; i++)
+		   buffer[i] = p[i];
+		buffer[len] = 0;
+		out << buffer;
+        delete [] buffer;
+    };
+};
+
+
+void DOMString::println() const
+{
+    XMLStdOut out;
+	print();
+    out << EndLn;
+};
+
+
+
+XMLCh *DOMString::rawBuffer() const
+{
+    XMLCh  *retP = 0;
+    if (fHandle)
+    {
+        retP = fHandle->fDSData->fData;
+        retP[fHandle->fLength] = 0;
+    }
+    return retP;
+};
+
+
+int DOMString::strcmp(const DOMString &other) const
+{
+    // Note: this strcmp does not match the semantics
+    //       of the standard C strcmp.  All it needs to do is
+    //       define some less than - equals - greater than ordering
+    //       of strings.  How doesn't matter.
+    //
+    int thisLen = length();
+    int otherLen = other.length();
+
+    if (thisLen < otherLen)
+        return -1;
+
+    if (thisLen > otherLen)
+        return 1;
+
+    if (thisLen == 0)
+        return 0;
+
+    XMLCh *thisP =  this->fHandle->fDSData->fData;
+    XMLCh *otherP = other.fHandle->fDSData->fData;
+    int i;
+    for (i=0; i<thisLen; i++)
+    {
+        if (thisP[i] < otherP[i])
+            return -1;
+        else if (thisP[i] > otherP[i])
+            return 1;
+    };
+
+    return 0;
+};
+
+
+DOMString DOMString::substringData(int offset, int count) const
+{
+    DOMString retString;
+
+    if (count > 0)
+    {
+        int thisLen = length();
+        assert(offset>=0 && count>=0);
+        if (offset+count > thisLen)
+        {
+            assert (offset < thisLen);
+            count = thisLen - offset;
+        }
+        XMLCh *data = fHandle->fDSData->fData;
+        retString = DOMString(data+offset, count);
+    }
+    return retString;
+};
+
diff --git a/src/dom/DOMString.hpp b/src/dom/DOMString.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..5c46413ac7b0f394b9c74b2dd01562a271870f99
--- /dev/null
+++ b/src/dom/DOMString.hpp
@@ -0,0 +1,359 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:48  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:12  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOMString_HEADER_GUARD_
+#define DOMString_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+
+class DOMStringHandle;
+class DOM_NullPtr;
+
+/**
+ * <code>DOMString</code> is the generic string class that stores all strings
+ * used in the DOM C++ API.
+ *
+ * Though this class supports most of the common string operations to manipulate
+ * strings, it is not meant to be a comphrehensive string class.
+ */
+
+class CDOM_EXPORT DOMString {
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOMString.  The resulting DOMString
+      * object refers to no string at all; it will compare == 0.
+      *
+      */
+    DOMString();
+
+    /**
+      * Copy constructor.
+      *
+      * @param other The object to be copied.
+      */
+    DOMString(const DOMString &other);
+
+    /**
+      * Constructor to build a DOMString from an XML character array.
+      * (XMLCh is a 16 bit UNICODE character).
+      *
+      * @param other The null-terminated character array to be 
+      *   that provides the initial value for the DOMString.
+      */
+    DOMString(const XMLCh *other);
+
+    /**
+      * Constructor to build a DOMString from a character array of given length.
+      *
+      * @param other The character array to be imported into the <code>DOMString</code>
+      * @param length The length of the character array to be imported
+      */
+    DOMString(const XMLCh *other, int length);
+
+    /**
+      * Constructor to build a DOMString from an 8 bit character array.
+      * The char * string will be transcoded to UNICODE using the default
+      * code page on the system where the code is running.
+      *
+      * @param other The character array to be imported into the <code>DOMString</code>
+      */
+    DOMString(const char *other);
+
+    /**
+      * Constructor to build an empty DOMString with the character buffer
+      *  preallocated to the specified size.  A DOMString will grow its buffer
+      *  on demand, as characters are added, but it can be more efficient to
+      *  allocate once in advance, if the size is known.
+      *
+      * @param initialBufferSize The initial size of the buffer inside the 
+      * <code>DOMString</code>, measured in 16 bit characters.
+      */
+    DOMString(int initalBufferSize);
+
+    /**
+      * Assignment operator.  Make destination DOMString refer to the same
+      *      underlying string in memory as the source string.
+      *
+      * @param the source DOMString.
+      */
+    DOMString &        operator = (const DOMString &other);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+
+	 /**
+	  * Destructor for DOMString
+	  *
+	  */
+    ~DOMString();
+
+    //@}
+    /** @name Operators for string manipulation. */
+    //@{
+
+    /**
+      * Concatenate a DOMString to another.
+      *
+      * @param other The string to be concatenated.
+      * @return The concatenated object
+      */
+    DOMString   operator + (const DOMString &other);
+
+    //@}
+    /** @name Equality and Inequality operators. */
+    //@{
+
+    /**
+      * Equality operator.  
+      *
+      * @param other The object to be compared with.
+      * @return True if the two DOMStrings refer to the same underlying string
+      *  in memory.  
+      *  <p>
+      *  WARNING:  operator == does NOT compare the contents of
+      *  the two  strings.  To do this, use the <code>DOMString::equals()</code>
+      *  This behavior is modelled after the String operations in Java, and
+      *  is also similar to operator == on the other DOM_* classes.
+      */
+    bool        operator == (const DOMString &other) const;
+
+    /**
+      * Inequality operator.
+      *
+      * @param other The object to be compared with.
+      * @return True if the two DOMStrings refer to different underlying strings in
+      *    memory.
+      * <p>
+      *  WARNING:  operator == does NOT compare the contents of
+      *  the two  strings.  To do this, use the <code>DOMString::equals()</code>
+      *  This behavior is modelled after the String operations in Java, and
+      *  is also similar to operator == on the other DOM_* classes.
+      */
+    bool        operator != (const DOMString &other) const;
+
+    /**
+      * Equality operator.  Test for a null DOMString, which is one that does
+      *   not refer to any string at all; similar to a null object reference
+      *   variable in Java.
+      *
+      * @param other must be 0 or null.
+      * @return 
+      */
+    bool        operator == (const DOM_NullPtr *other) const;
+
+    /**
+      * Inequality operator, for null test.
+      *
+      * @param other must be 0 or null.
+      * @return True if the two strings are different, false otherwise
+      */
+    bool        operator != (const DOM_NullPtr *other) const;
+
+    //@}
+    /** @name Functions to change the string. */
+    //@{
+
+    /**
+      * Appends the content of another <code>DOMString</code> to this string.
+      *
+      * @param other The object to be appended
+      */
+    void        appendData(const DOMString &other);
+
+    /**
+      * Clears the data of this <code>DOMString</code>.
+      *
+      * @param offset The position from the beginning from which the data must be deleted
+      * @param count The count of characters from the offset that must be deleted
+      */
+    void        deleteData(int offset, int count);
+
+    /**
+      * Inserts a string within the existing <code>DOMString</code> at an arbitrary position.
+      *
+      * @param offset The offset from the beginning at which the insertion needs to be done 
+      *               in <code>this</code> object
+      * @param data The <code>DOMString</code> containing the data that needs to be inserted
+      * @return The object to be returned.
+      */
+    void        insertData(int offset, const DOMString &data);
+
+    //@}
+    /** @name Functions to get properties of the string. */
+    //@{
+
+    /**
+      * Returns the character at the specified position.
+      *
+      * @param index The position at which the character is being requested
+      * @return Returns the character at the specified position.
+      */
+    XMLCh       charAt(int index) const;
+
+    /**
+      * Returns a handle to the raw buffer in the <code>DOMString</code>.
+      *
+      * @return The pointer inside the <code>DOMString</code> containg the string data.
+      */
+    XMLCh       *rawBuffer() const;
+
+    /**
+      * Returns a sub-string of the <code>DOMString</code> starting at a specified position.
+      *
+      * @param offset The offset from the beginning from which the sub-string is being requested.
+      * @param count The count of characters in the requested sub-string
+      * @return The sub-string of the <code>DOMString</code> being requested
+      */
+    DOMString   substringData(int offset, int count) const;
+
+    /**
+      * Returns the length of the DOMString.
+      *
+      * @return The length of the string
+      */
+    int         length() const;
+
+    //@}
+    /** @name Cloning function. */
+    //@{
+
+    /**
+      * Makes a clone of a the DOMString.
+      *
+      * @return The object to be cloned.
+      */
+    DOMString   clone() const;
+
+    //@}
+    /** @name Print functions. */
+    //@{
+
+    /**
+      * Dumps the <code>DOMString</code> on the console.
+      *
+      */
+    void        print() const;
+
+    /**
+      * Dumps the <code>DOMString</code> on the console with a line feed at the end.
+      *
+      */
+    void        println() const;
+
+    //@}
+    /** @name Functions to compare a string with another. */
+    //@{
+
+    /**
+      * Compares a DOMString with another.
+      *
+      * This strcmp does not match the semantics of the standard C strcmp.  
+      * All it needs to do is define some less than - equals - greater than 
+      * ordering of strings.  How doesn't matter.
+      *
+      *
+      * @param other The object to be compared with
+      * @return Either -1, 0, or 1 based on the comparison. 
+      */
+    int         strcmp(const DOMString &other) const;
+
+    /**
+      * Tells if a <code>DOMString</code> contains the same character data
+      * as another.
+      *
+      * @param other The DOMString to be compared with.
+      * @return True if the two <code>DOMString</code>s are same, false otherwise.
+      */
+    bool        equals(const DOMString &other) const;
+
+
+      /**
+      * Compare a DOMString with a null-terminated raw 16-bit character
+      * string.
+      *
+      * @param other The character string to be compared with.
+      * @return True if the strings are the same, false otherwise.
+      */
+    bool        equals(const XMLCh  *other) const;
+
+
+    //@}
+    friend      class DOMStringData;
+    friend      class DOMStringHandle;
+    friend      class DomMemDebug;
+private:
+
+    DOMStringHandle         *fHandle;
+    static int              gLiveStringHandleCount;
+    static int              gTotalStringHandleCount;
+    static int              gLiveStringDataCount;
+    static int              gTotalStringDataCount;
+};
+
+#endif
diff --git a/src/dom/DOM_Attr.cpp b/src/dom/DOM_Attr.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..66551dc10367c362f8f7d7f7b43a17a284369f29
--- /dev/null
+++ b/src/dom/DOM_Attr.cpp
@@ -0,0 +1,141 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:48  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:12  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Attr.hpp"
+#include "AttrImpl.hpp"
+
+
+DOM_Attr::DOM_Attr()
+: DOM_Node(null)
+{
+};
+
+
+DOM_Attr::DOM_Attr(const DOM_Attr & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_Attr::DOM_Attr(AttrImpl *impl) :
+        DOM_Node(impl)
+{
+};
+
+
+DOM_Attr::~DOM_Attr() 
+{
+};
+
+
+DOM_Attr & DOM_Attr::operator = (const DOM_Attr & other)
+{
+    return (DOM_Attr &) DOM_Node::operator = (other);
+};
+
+
+DOM_Attr & DOM_Attr::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_Attr &) DOM_Node::operator = (other);
+};
+
+
+
+DOMString       DOM_Attr::getName() const
+{
+        return ((AttrImpl *)fImpl)->getName();
+};
+
+
+bool            DOM_Attr::getSpecified() const
+{
+        return ((AttrImpl *)fImpl)->getSpecified();
+};
+
+
+DOMString       DOM_Attr::getValue() const
+{
+        return ((AttrImpl *)fImpl)->getValue();
+};
+
+
+void                    DOM_Attr::setSpecified(bool specified)
+{
+        ((AttrImpl *)fImpl)->setSpecified(specified);
+};
+
+
+void            DOM_Attr::setValue(const DOMString &value) {
+        ((AttrImpl *)fImpl)->setValue(value);
+};
+
+
+//Introduced in DOM Level 2
+
+DOM_Element     DOM_Attr::getOwnerElement() const
+{
+        return DOM_Element(((AttrImpl *)fImpl)->getOwnerElement());
+}
diff --git a/src/dom/DOM_Attr.hpp b/src/dom/DOM_Attr.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..959b2152cf18030790d94c7810331926721cbec1
--- /dev/null
+++ b/src/dom/DOM_Attr.hpp
@@ -0,0 +1,222 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:48  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:13  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_Attr_HEADER_GUARD_
+#define DOM_Attr_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+#include <dom/DOM_Element.hpp>
+
+class AttrImpl;
+
+/**
+* The <code>DOM_Attr</code> class refers to an attribute of an XML element.
+*
+* Typically the allowable values for the 
+* attribute are defined in a documenttype definition.
+* <p><code>DOM_Attr</code> objects inherit the <code>DOM_Node</code>  interface, but 
+* since attributes are not actually child nodes of the elements they are associated with, the 
+* DOM does not consider them part of the document  tree.  Thus, the 
+* <code>DOM_Node</code> attributes <code>parentNode</code>,  
+* <code>previousSibling</code>, and <code>nextSibling</code> have a  null 
+* value for <code>DOM_Attr</code> objects. The DOM takes the  view that 
+* attributes are properties of elements rather than having a  separate 
+* identity from the elements they are associated with;  this should make it 
+* more efficient to implement such features as default attributes associated 
+* with all elements of a  given type.  Furthermore, attribute nodes 
+* may not be immediate children of a <code>DocumentFragment</code>. However, 
+* they can be associated with <code>Element</code> nodes contained within a 
+* <code>DocumentFragment</code>. In short, users of the DOM 
+* need to be aware that  <code>Attr</code> nodes have some things in  common 
+* with other objects inheriting the <code>Node</code> interface, but they 
+* also are quite distinct.
+*  
+*/
+class CDOM_EXPORT DOM_Attr: public DOM_Node {
+    
+public:
+  /** @name Constructors and assignment operators */
+  //@{
+  /**
+    * Default constructor for DOM_Attr.  The resulting object does not
+    * refer to any Attribute; it will compare == to 0, and is similar
+    * to a null object reference variable in Java.
+    *
+    */
+    DOM_Attr();
+
+public:
+
+  /**
+    * Copy constructor.  Creates a new <code>DOM_Attr</code> that refers to the
+    *   same underlying Attribute as the original.  See also DOM_Node::clone(),
+    * which will copy an actual attribute, rather than just creating a new
+    * reference to the original attribute.
+    *
+    * @param other The source attribute reference object
+    */
+    DOM_Attr(const DOM_Attr &other);
+
+  /**
+    * Assignment operator
+    *
+    * @param other The source attribute object
+    */
+    DOM_Attr & operator = (const DOM_Attr &other);
+    
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Attr & operator = (const DOM_NullPtr *val);
+
+
+
+	//@}
+  /** @name Destructor */
+  //@{
+	    
+  /**
+    * Destructor.  The object being destroyed is a reference to the Attribute
+    * "node", not the underlying attribute itself.
+    *
+    */
+    ~DOM_Attr();
+	//@}
+    
+  /** @name Getter functions */
+  //@{
+    /**
+    * Returns the name of this attribute. 
+    */
+    DOMString       getName() const;
+
+    /**
+    *
+    * Returns true if the attribute received its value explicitly in the
+    * XML document, or if a value was assigned programatically with
+    * the setValue function.  Returns false if the attribute value 
+    * came from the default value declared in the document's DTD.
+    */
+    bool            getSpecified() const;
+
+    /**
+	* Returns the value of the attribute.
+	*
+    * The value of the attribute is returned as a string. 
+    * Character and general entity references are replaced with their values.
+    */
+    DOMString       getValue() const;
+    
+	//@}
+  /** @name Setter functions */
+  //@{
+    /**
+	* Sets the value of the attribute.  A text node with the unparsed contents
+    * of the string will be created.
+	*
+    * @param value The value of the DOM attribute to be set
+    */
+    void            setValue(const DOMString &value);
+    
+    /**
+	* Sets the value of the SPECIFIED for this attribute
+	*
+    * @param spec The boolean value to be set
+    */
+    void            setSpecified(bool spec);
+	//@}
+
+    /** @name Functions introduced in DOM Level 2. */
+    //@{
+    /**
+     * The <code>Element</code> node this attribute is attached to or
+     * <code>null</code> if this attribute is not in use.
+     */
+    DOM_Element     getOwnerElement() const;
+    //@}
+
+private:
+    DOM_Attr(AttrImpl *attr);
+
+    friend class DOM_Element;
+    friend class DOM_Document;
+
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_CDATASection.cpp b/src/dom/DOM_CDATASection.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..335006bbbb0950979f0a928e14f97dbd2f2af79b
--- /dev/null
+++ b/src/dom/DOM_CDATASection.cpp
@@ -0,0 +1,107 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:48  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:13  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_CDATASection.hpp"
+#include "DOM_Text.hpp"
+#include "CDATASectionImpl.hpp"
+
+
+
+DOM_CDATASection::DOM_CDATASection()
+: DOM_Text(null)
+{
+};
+
+
+DOM_CDATASection::DOM_CDATASection(const DOM_CDATASection & other)
+: DOM_Text(other)
+{
+};
+
+        
+DOM_CDATASection::DOM_CDATASection(CDATASectionImpl *impl) :
+        DOM_Text(impl)
+{
+};
+
+
+DOM_CDATASection::~DOM_CDATASection() 
+{
+};
+
+
+DOM_CDATASection & DOM_CDATASection::operator = (const DOM_CDATASection & other)
+{
+     return (DOM_CDATASection &) DOM_Text::operator = (other);
+};
+
+
+DOM_CDATASection & DOM_CDATASection::operator = (const DOM_NullPtr *other)
+{
+     return (DOM_CDATASection &) DOM_Node::operator = (other);
+};
+
+
diff --git a/src/dom/DOM_CDATASection.hpp b/src/dom/DOM_CDATASection.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..494bdb45d86f82ac2cae948f058fef1698b0a353
--- /dev/null
+++ b/src/dom/DOM_CDATASection.hpp
@@ -0,0 +1,152 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:49  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:13  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_CDataSection_HEADER_GUARD_
+#define DOM_CDataSection_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Text.hpp>
+
+class CDATASectionImpl;
+
+/**
+ * <code>DOM_CDataSection</code> objects refer to the data from an
+ * XML CDATA section.  These are used to escape blocks of text containing  characters 
+ * that would otherwise be regarded as markup.
+ *
+ * <p>Note that the string data associated with the CDATA section may 
+ * contain characters that need to be escaped when appearing in an
+ * XML document outside of a CDATA section.  
+ * <p> The <code>DOM_CDATASection</code> class inherits from the 
+ * <code>DOM_CharacterData</code> class through the <code>Text</code> 
+ * interface. Adjacent CDATASection nodes are not merged by use 
+ * of the Element.normalize() method.
+ */
+class CDOM_EXPORT DOM_CDATASection: public DOM_Text {
+public:
+  /** @name Constructors and assignment operators */
+  //@{
+  /**
+    * Default constructor for DOM_CDATASection.  The resulting object does not
+    * refer to any actual CData section; it will compare == to 0, and is similar
+    * to a null object reference variable in Java.
+    *
+    */
+        DOM_CDATASection();
+  /**
+    * Copy constructor.  Creates a new <code>DOM_CDataSection</code> that refers to the
+    *   same underlying data as the original.  See also <code>DOM_Node::clone()</code>,
+    * which will copy the underlying data, rather than just creating a new
+    * reference to the original object.
+    *
+    * @param other The source <code>DOM_CDATASection</code> object
+    */
+        DOM_CDATASection(const DOM_CDATASection &other);
+
+  /**
+    * Assignment operator.
+    *
+    * @param other The object to be copied.
+    */
+        DOM_CDATASection & operator = (const DOM_CDATASection &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_CDATASection & operator = (const DOM_NullPtr *val);
+
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_CDATASection.
+	  *
+	  */
+
+	    ~DOM_CDATASection();
+    //@}
+
+
+private:
+	DOM_CDATASection(CDATASectionImpl *);
+
+    friend class DOM_Document;
+
+};
+#endif
+
+
diff --git a/src/dom/DOM_CharacterData.cpp b/src/dom/DOM_CharacterData.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6f3e8a2dcb42407c9e7131527fecb048d833ab6d
--- /dev/null
+++ b/src/dom/DOM_CharacterData.cpp
@@ -0,0 +1,153 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:49  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:13  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_CharacterData.hpp"
+#include "CharacterDataImpl.hpp"
+
+
+DOM_CharacterData::DOM_CharacterData()
+: DOM_Node(null)
+{
+};
+
+DOM_CharacterData::DOM_CharacterData(CharacterDataImpl *impl) :
+DOM_Node(impl)
+{
+};
+
+
+DOM_CharacterData::DOM_CharacterData(const DOM_CharacterData & other) :
+DOM_Node(other)
+{
+};
+
+
+DOM_CharacterData::~DOM_CharacterData() {
+};
+
+DOM_CharacterData & DOM_CharacterData::operator = (const DOM_CharacterData &other)
+{
+    return (DOM_CharacterData &) DOM_Node::operator = (other);
+};
+
+DOM_CharacterData & DOM_CharacterData::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_CharacterData &) DOM_Node::operator = (other);
+};
+
+
+DOMString DOM_CharacterData::getData() const
+{
+    return ((CharacterDataImpl *)fImpl)->getData();
+};
+
+
+void DOM_CharacterData::setData(const DOMString &data){
+    ((CharacterDataImpl *)fImpl)->setData(data);
+};
+
+
+
+int  DOM_CharacterData::getLength() const
+{
+    return ((CharacterDataImpl *)fImpl)->getCharDataLength();
+};
+
+
+
+DOMString DOM_CharacterData::substringData(int offset, int count) const
+{
+    return ((CharacterDataImpl *)fImpl)->substringData(offset, count);
+};
+
+
+
+void DOM_CharacterData::appendData(const DOMString &arg)
+{
+    ((CharacterDataImpl *)fImpl)->appendData(arg);
+};
+
+
+
+void DOM_CharacterData::insertData(int offset, const DOMString &arg){
+    ((CharacterDataImpl *)fImpl)->insertData(offset, arg);
+};
+
+
+
+
+void DOM_CharacterData::deleteData(int offset, int count)
+{
+    ((CharacterDataImpl *)fImpl)->deleteData(offset, count);
+};
+
+
+void DOM_CharacterData::replaceData(int offset, int count, const DOMString &arg)
+{
+    ((CharacterDataImpl *)fImpl)->replaceData(offset, count, arg);
+};
+
+
diff --git a/src/dom/DOM_CharacterData.hpp b/src/dom/DOM_CharacterData.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..d12780a3e27477d74b3a2adb9286e6eb1e50fa96
--- /dev/null
+++ b/src/dom/DOM_CharacterData.hpp
@@ -0,0 +1,266 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:49  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:13  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_CharacterData_HEADER_GUARD_
+#define DOM_CharacterData_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class CharacterDataImpl;
+
+/**
+ * The <code>DOM_CharacterData</code> interface extends Node with a set  of 
+ * methods for accessing character data in the DOM.
+ *
+ * For clarity this set is defined here rather than on each class that uses 
+ * these methods. No DOM objects correspond directly to 
+ * <code>CharacterData</code>, though <code>Text</code> and others do inherit 
+ * the interface from it. All <code>offset</code>s in this interface start 
+ * from 0, and index in terms of Unicode 16 bit storage units.
+ */
+class CDOM_EXPORT DOM_CharacterData: public DOM_Node {
+
+private:
+
+public:
+  /** @name Constructors and assignment operator */
+  //@{
+  /**
+    * Default constructor for DOM_CharacterData.  While there can be
+    * no actual DOM nodes of type CharacterData, the C++ objects
+    * function more like reference variables, and instances of
+    * <code>DOM_CharacterData</code> can exist.  They will be null when created
+    * by this constructor, and can then be assigned to refer to Text
+    * or CDATASection nodes.
+    */
+    DOM_CharacterData();
+
+  /**
+    * Copy constructor
+    *
+    * @param other The object to be copied
+    */
+    DOM_CharacterData(const DOM_CharacterData &other);
+  /**
+    * Assignment operator
+    *
+    * @param other The object to be copied
+    */
+    DOM_CharacterData & operator = (const DOM_CharacterData &other);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_CharacterData.  The object being destroyed
+      * is the reference to the Character Data node, not the character
+      * data itself.
+	  */
+    ~DOM_CharacterData();
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_CharacterData & operator = (const DOM_NullPtr *val);
+
+
+    //@}
+
+    /** @name Getter functions. */
+    //@{
+  /**
+   * Returns the character data of the node that implements this interface. 
+   *
+   * The DOM implementation may not put arbitrary limits on the amount of data that 
+   * may be stored in a  <code>CharacterData</code> node. However, 
+   * implementation limits may  mean that the entirety of a node's data may 
+   * not fit into a single <code>DOMString</code>. In such cases, the user 
+   * may call <code>substringData</code> to retrieve the data in 
+   * appropriately sized pieces.
+   * @exception DOMException
+   *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
+   * @exception DOMException
+   *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than 
+   *   fit in a <code>DOMString</code> variable on the implementation 
+   *   platform.
+   */
+  DOMString          getData() const;
+  /**
+   * Returns the number of characters that are available through <code>data</code> and 
+   * the <code>substringData</code> method below. 
+   *
+   * This may have the value 
+   * zero, i.e., <code>CharacterData</code> nodes may be empty.
+   */
+  int                getLength() const;
+  /**
+   * Extracts a range of data from the node.
+   *
+   * @param offset Start offset of substring to extract.
+   * @param count The number of characters to extract.
+   * @return The specified substring. If the sum of <code>offset</code> and 
+   *   <code>count</code> exceeds the <code>length</code>, then all 
+   *   characters to the end of the data are returned.
+   * @exception DOMException
+   *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater 
+   *   than the number of characters in <code>data</code>, or if the 
+   *   specified <code>count</code> is negative.
+   *   <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does not 
+   *   fit into a <code>DOMString</code>.
+   */
+  DOMString          substringData(int offset, 
+                                   int count) const;
+    //@}
+    /** @name Functions that set or change data. */
+    //@{
+  /**
+   * Append the string to the end of the character data of the node.
+   *
+   * Upon success, <code>data</code> provides access to the concatenation of 
+   * <code>data</code> and the <code>DOMString</code> specified.
+   * @param arg The <code>DOMString</code> to append.
+   * @exception DOMException
+   *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+  void               appendData(const DOMString &arg);
+  /**
+   * Insert a string at the specified character offset.
+   *
+   * @param offset The character offset at which to insert.
+   * @param arg The <code>DOMString</code> to insert.
+   * @exception DOMException
+   *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater 
+   *   than the number of characters in <code>data</code>.
+   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+  void               insertData(int offset, const  DOMString &arg);
+  /**
+   * Remove a range of characters from the node. 
+   *
+   * Upon success, 
+   * <code>data</code> and <code>length</code> reflect the change.
+   * @param offset The offset from which to remove characters.
+   * @param count The number of characters to delete. If the sum of 
+   *   <code>offset</code> and <code>count</code> exceeds <code>length</code> 
+   *   then all characters from <code>offset</code> to the end of the data 
+   *   are deleted.
+   * @exception DOMException
+   *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater 
+   *   than the number of characters in <code>data</code>, or if the 
+   *   specified <code>count</code> is negative.
+   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+  void               deleteData(int offset, 
+                                       int count);
+  /**
+   * Replace the characters starting at the specified character offset with 
+   * the specified string.
+   *
+   * @param offset The offset from which to start replacing.
+   * @param count The number of characters to replace. If the sum of 
+   *   <code>offset</code> and <code>count</code> exceeds <code>length</code>
+   *   , then all characters to the end of the data are replaced (i.e., the 
+   *   effect is the same as a <code>remove</code> method call with the same 
+   *   range, followed by an <code>append</code> method invocation).
+   * @param arg The <code>DOMString</code> with which the range must be 
+   *   replaced.
+   * @exception DOMException
+   *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater 
+   *   than the number of characters in <code>data</code>, or if the 
+   *   specified <code>count</code> is negative.
+   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+  void               replaceData(int offset, 
+                                 int count, 
+                                 const DOMString &arg);
+
+  /**
+   * Sets the character data of the node that implements this interface. 
+   *
+   * @param data The <code>DOMString</code> to set.
+   */
+  void               setData(const DOMString &data);
+  //@}
+
+protected:
+    DOM_CharacterData(CharacterDataImpl *impl);
+
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_Comment.cpp b/src/dom/DOM_Comment.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6f9e937fc1426c87e0086165b5b5f58f65086453
--- /dev/null
+++ b/src/dom/DOM_Comment.cpp
@@ -0,0 +1,104 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:49  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:14  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Comment.hpp"
+#include "CommentImpl.hpp"
+
+
+DOM_Comment::DOM_Comment()
+: DOM_CharacterData(null)
+{
+};
+
+
+DOM_Comment::DOM_Comment(const DOM_Comment & other)
+: DOM_CharacterData(other)
+{
+};
+
+        
+DOM_Comment::DOM_Comment(CommentImpl *impl) :
+        DOM_CharacterData(impl)
+{
+};
+
+
+DOM_Comment::~DOM_Comment() 
+{
+};
+
+
+DOM_Comment & DOM_Comment::operator = (const DOM_Comment & other)
+{
+     return (DOM_Comment &) DOM_CharacterData::operator = (other);
+};
+
+DOM_Comment & DOM_Comment::operator = (const DOM_NullPtr *other)
+{
+     return (DOM_Comment &) DOM_Node::operator = (other);
+};
+
+
diff --git a/src/dom/DOM_Comment.hpp b/src/dom/DOM_Comment.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..bfc7cd4adc926223ddd7b54ce773fa75f8a736c5
--- /dev/null
+++ b/src/dom/DOM_Comment.hpp
@@ -0,0 +1,151 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:50  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:14  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_Comment_HEADER_GUARD_
+#define DOM_Comment_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_CharacterData.hpp>
+
+class CommentImpl;
+
+/**
+ * Class to refer to XML comment nodes in the DOM.
+ *
+ * <P>The string value contains all of the characters between 
+ * the starting '<code>&lt;!--</code>' and ending '<code>--&gt;</code>'.
+ */
+class CDOM_EXPORT DOM_Comment: public DOM_CharacterData {
+
+public:
+  /** @name Constructors and assignment operators */
+  //@{
+  /**
+    * Default constructor for DOM_Comment.  The resulting object does not
+    * refer to an actual Comment node; it will compare == to 0, and is similar
+    * to a null object reference variable in Java.  It may subsequently be
+    * assigned to refer to an actual comment node.
+    * <p>
+    * New comment nodes are created by DOM_Document::createComment().
+    *
+    */
+    DOM_Comment();
+
+  /**
+    * Copy constructor.   Creates a new <code>DOM_Comment</code> that refers to the
+    * same underlying node as the original.  See also DOM_Node::clone(),
+    * which will copy the actual Comment node, rather than just creating a new
+    * reference to the original node.
+    *
+    * @param other The object to be copied.
+    */
+    DOM_Comment(const DOM_Comment &other);
+  /**
+    * Assignment operator.
+    *
+    * @param other The object to be copied.
+    */
+    DOM_Comment & operator = (const DOM_Comment &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Comment & operator = (const DOM_NullPtr *val);
+
+
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_Comment.  The object being destroyed is the reference
+      * object, not the underlying Comment node itself.
+      * 
+	  */
+    ~DOM_Comment();
+    //@}
+
+private:
+    DOM_Comment(CommentImpl *comment);
+
+    friend class DOM_Document;
+
+
+
+};
+
+#endif
+
diff --git a/src/dom/DOM_DOMException.cpp b/src/dom/DOM_DOMException.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..96587464b62cdd416e44e0dfcc819dd32100889e
--- /dev/null
+++ b/src/dom/DOM_DOMException.cpp
@@ -0,0 +1,94 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:53  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:14  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_DOMException.hpp"
+#include "DOMString.hpp"
+
+
+DOM_DOMException::DOM_DOMException()
+: msg(0)
+{
+        code = (ExceptionCode) 0;
+};
+
+
+DOM_DOMException::DOM_DOMException(short exCode, const DOMString &message) 
+: msg(message) 
+{
+   code = (ExceptionCode) exCode;
+};
+
+
+DOM_DOMException::DOM_DOMException(const DOM_DOMException &other) 
+: msg(other.msg)
+{
+        code = other.code;
+};
+
+
+DOM_DOMException::~DOM_DOMException() 
+{
+};
diff --git a/src/dom/DOM_DOMException.hpp b/src/dom/DOM_DOMException.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..76f7b0ff90d53d14f1463d3b1e809bae695ee008
--- /dev/null
+++ b/src/dom/DOM_DOMException.hpp
@@ -0,0 +1,162 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:53  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:14  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOMException_HEADER_GUARD_
+#define DOMException_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOMString.hpp>
+
+/**
+  * Encapsulate a general DOM error or warning.
+  *
+  * <p> The DOM will create and throw an instance of DOMException
+  * when an error condition is detected.  Exceptions can occur
+  * when an application directly manipulates the DOM document
+  * tree that is produced by the parser, or when a document tree
+  * is created from scratch using the DOM API.  DOM exceptions will
+  * not be generated by the parser while constructing a document
+  * tree from an XML source document.
+  *
+  * <p>Unlike the other classes in the C++ DOM API, DOM_DOMException
+  * is NOT a reference to an underlying implementation class, and
+  * does not provide automatic memory management.  Code that catches
+  * a DOM exception is responsible for deleting it, or otherwise
+  * arranging for its disposal.
+  *
+  */
+class CDOM_EXPORT DOM_DOMException  {
+public:
+        enum ExceptionCode {
+                INDEX_SIZE_ERR       = 1,
+                DOMSTRING_SIZE_ERR   = 2,
+                HIERARCHY_REQUEST_ERR = 3,
+                WRONG_DOCUMENT_ERR   = 4,
+                INVALID_CHARACTER_ERR = 5,
+                NO_DATA_ALLOWED_ERR  = 6,
+                NO_MODIFICATION_ALLOWED_ERR = 7,
+                NOT_FOUND_ERR        = 8,
+                NOT_SUPPORTED_ERR    = 9,
+                INUSE_ATTRIBUTE_ERR  = 10,
+				INVALID_STATE_ERR		= 11
+        };
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_DOMException.
+      *
+      */
+    DOM_DOMException();
+
+    /**
+      * Constructor which takes an error code and a message.
+      *
+      * @param code The error code which indicates the exception
+      * @param message The string containing the error message
+      */
+    DOM_DOMException(short code, const DOMString &message);
+
+    /**
+      * Copy constructor.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_DOMException(const DOM_DOMException &other);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_DOMException.  Applications are responsible
+      * for deleting DOM_Exception objects that they catch after they
+      * have completed their exception processing.
+	  *
+	  */
+    virtual ~DOM_DOMException();
+    //@}
+
+    /** @name Public variables. */
+     //@{
+	 /**
+	  * A code value, from the set defined by the ExceptionCode enum,
+      * indicating the type of error that occured.
+	  */
+   ExceptionCode   code;
+
+	 /**
+	  * A string value.  Applications may use this field to hold an error
+      *  message.  The field value is not set by the DOM implementation,
+      *  meaning that the string will be empty when an exception is first
+      *  thrown.
+	  */
+    DOMString msg;
+    //@}
+
+};
+
+#endif
+
diff --git a/src/dom/DOM_DOMImplementation.cpp b/src/dom/DOM_DOMImplementation.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e3a39883d45e0d26e33a5dcb5e2d64a1b06a0ec8
--- /dev/null
+++ b/src/dom/DOM_DOMImplementation.cpp
@@ -0,0 +1,169 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:56  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:15  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_DOMImplementation.hpp"
+#include "DOM_Document.hpp"
+#include "DOM_DocumentType.hpp"
+#include "DOM_DOMException.hpp"
+#include "DocumentImpl.hpp"
+#include "DocumentTypeImpl.hpp"
+#include "DStringPool.hpp"
+#include "util/PlatformUtils.hpp"
+
+//
+//  Static constants.  These are lazily initialized on first usage.
+//                     (Static constructors can not be safely used because
+//                      of order of initialization dependencies.)
+
+static DOM_DOMImplementation    *gDomimp;   // Points to the singleton instance
+                                            //  of DOMImplementation that is returned
+                                            //  by any call to getImplementation().
+
+static DOMString                *gXML;      // Points to "XML"
+static DOMString                *gxml;      // Points to "xml"
+static DOMString                *g1_0;      // Points to "1.0"
+
+
+// Note #1136 - There needs to be a separate implementation class for
+//              DOMImplementation, so that the user programming model
+//              is consistent with the rest of the C++ DOM API, and
+//              so that hasFeature will only work on the result of
+//              getImplementation(), and not on DOM_DOMImplemenation objects
+//              created with the default constructor.
+//
+DOM_DOMImplementation::DOM_DOMImplementation() {
+};
+
+
+
+DOM_DOMImplementation::DOM_DOMImplementation(const DOM_DOMImplementation & other)
+{
+};
+
+
+DOM_DOMImplementation::~DOM_DOMImplementation()
+{
+};
+
+
+DOM_DOMImplementation & DOM_DOMImplementation::operator = (const DOM_DOMImplementation & other)
+{
+    return *this;
+};
+
+
+//  getImplementation()  - Always returns the same singleton instance, which
+//                         is lazily created on the first call.  Note that
+//                         DOM_Implementation must be thread-safe because
+//                         it is common to all DOM documents, and while a single
+//                         document is not thread-safe within itself, we do
+//                         promise that different documents can safely be
+//                         used concurrently by different threads.
+//
+DOM_DOMImplementation &DOM_DOMImplementation::getImplementation() {
+    if (gDomimp == 0)
+    {
+        DOM_DOMImplementation *t = new DOM_DOMImplementation;
+        if (XMLPlatformUtils::compareAndSwap((void **)&gDomimp, t, 0) != 0)
+            delete t;
+    }
+    return *gDomimp;
+};
+
+
+bool  DOM_DOMImplementation::hasFeature(const DOMString &feature,  const DOMString &version) 
+{
+    // Currently, we support only XML Level 1 version 1.0
+    // Note #965:  A true case-insensitve compare is needed here.
+    if(feature.equals(DStringPool::getStaticString("XML", &gXML)) ||
+       feature.equals(DStringPool::getStaticString("xml", &gxml)))
+    {
+        if(version.equals(DStringPool::getStaticString("1.0", &g1_0)))
+            return true;
+    }
+    return false;
+}
+
+
+//Introduced in DOM Level 2
+
+DOM_DocumentType DOM_DOMImplementation::createDocumentType(const DOMString &qualifiedName,
+	const DOMString &publicID, const DOMString &systemID,
+	const DOMString &internalSubset)
+{
+    if (!DocumentImpl::isXMLName(qualifiedName))
+        throw new DOM_DOMException(
+        DOM_DOMException::INVALID_CHARACTER_ERR, null);
+    
+    return DOM_DocumentType(new DocumentTypeImpl(qualifiedName, publicID, systemID, internalSubset));
+}
+
+DOM_Document DOM_DOMImplementation::createDocument(const DOMString &namespaceURI,
+	const DOMString &qualifiedName, const DOM_DocumentType &doctype)
+{
+    return DOM_Document(new DocumentImpl(namespaceURI, qualifiedName,
+	doctype == null ? null : (DocumentTypeImpl *) doctype.fImpl));
+}
diff --git a/src/dom/DOM_DOMImplementation.hpp b/src/dom/DOM_DOMImplementation.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..d98034a580156e74216bc72e8ec940c1edd2f197
--- /dev/null
+++ b/src/dom/DOM_DOMImplementation.hpp
@@ -0,0 +1,186 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:57  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:15  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOMImplementation_HEADER_GUARD_
+#define DOMImplementation_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOMString.hpp>
+
+class DOM_Document;
+class DOM_DocumentType;
+
+/**
+ *   This class provides a way to query the capabilities of an implementation
+ *   of the DOM
+ */
+
+
+class CDOM_EXPORT DOM_DOMImplementation {
+ private:
+    DOM_DOMImplementation(const DOM_DOMImplementation &other);
+
+ public:
+/** @name Constructors and assignment operators */
+//@{  
+ /**
+   * Construct a DOM_Implementation reference variable, which should
+   * be assigned to the return value from 
+   * <code>DOM_Implementation::getImplementation()</code>.
+   */
+    DOM_DOMImplementation();
+
+ /**
+   * Assignment operator
+   *
+   */
+    DOM_DOMImplementation & operator = (const DOM_DOMImplementation &other);
+//@}
+
+  /** @name Destructor */
+  //@{  
+  /**
+    * Destructor.  The object being destroyed is a reference to the DOMImplemenentation,
+    * not the underlying DOMImplementation object itself, which is owned by
+    * the implementation code.
+    *
+    */
+
+    ~DOM_DOMImplementation();
+	//@}
+
+  /** @name Getter functions */
+  //@{
+
+ /**
+   * Test if the DOM implementation implements a specific feature.
+   *
+   * @param feature The package name of the feature to test. This
+   *   implemenation supports XML, but does not support HTML.
+   * @param version This is the version number of the package name to test.  
+   *   In Level 1, this is the string "1.0". If the version is not specified, 
+   *   supporting any version of the  feature will cause the method to return 
+   *   <code>true</code>. 
+   * @return <code>true</code> if the feature is implemented in the specified 
+   *   version, <code>false</code> otherwise.
+   */
+ bool  hasFeature(const DOMString &feature,  const DOMString &version);
+
+
+  /** Return a reference to a DOM_Implementation object for this 
+    *  DOM implementation. 
+    *
+    * Intended to support applications that may be
+    * using DOMs retrieved from several different sources, potentially
+    * with different underlying implementations.
+    */
+ static DOM_DOMImplementation &getImplementation();
+  
+ //@}
+
+    /** @name Functions introduced in DOM Level 2. */
+    //@{
+    /**
+     * Creates an empty <code>DocumentType</code> node.
+     * Entity declarations and notations are not made available.
+     * Entity reference expansions and default attribute additions
+     * do not occur. It is expected that a future version of the DOM
+     * will provide a way for populating a <code>DocumentType</code>.
+     * @param qualifiedName The <em>qualified name</em>
+     * of the document type to be created.
+     * @param publicID The external subset public identifier.
+     * @param systemID The external subset system identifier.
+     * @param internalSubset The internal subset as a string. This should be valid.
+     * @return A new <code>DocumentType</code> node with
+     * <code>Node.ownerDocument</code> set to <code>null</code>.
+     */
+    DOM_DocumentType createDocumentType(const DOMString &qualifiedName,
+	const DOMString &publicID, const DOMString &systemID,
+	const DOMString &internalSubset);
+
+    /**
+     * Creates an XML <code>Document</code> object of the specified type
+     * with its document element.
+     * @param namespaceURI The <em>namespace URI</em> of
+     * the document element to create, or <code>null</code>.
+     * @param qualifiedName The <em>qualified name</em>
+     * of the document element to be created.
+     * @param doctype The type of document to be created or <code>null</code>.
+     * <p>When <code>doctype</code> is not <code>null</code>, its
+     * <code>Node.ownerDocument</code> attribute is set to the document
+     * being created.
+     * @return A new <code>Document</code> object.
+     * @exception DOMException
+     *   WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
+     *   been used with a different document.
+     */
+    DOM_Document createDocument(const DOMString &namespaceURI,
+	const DOMString &qualifiedName, const DOM_DocumentType &doctype);
+    //@}
+
+};
+
+#endif
diff --git a/src/dom/DOM_Document.cpp b/src/dom/DOM_Document.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..03707e2be1038e176691622fa14512c395991a30
--- /dev/null
+++ b/src/dom/DOM_Document.cpp
@@ -0,0 +1,259 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:50  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:44:15  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include "DOM_Document.hpp"
+#include "DeepNodeListImpl.hpp"
+#include "DocumentImpl.hpp"
+#include "NodeIteratorImpl.hpp"
+#include "TreeWalkerImpl.hpp"
+
+
+
+DOM_Document::DOM_Document (DocumentImpl *impl) :
+    DOM_Node(impl)
+{
+};
+
+
+DOM_Document::DOM_Document() :
+        DOM_Node(null)
+{
+};
+
+
+DOM_Document::DOM_Document(const DOM_Document &other)
+: DOM_Node(other)
+{
+};
+
+
+DOM_Document::~DOM_Document()
+{
+};
+
+DOM_Document & DOM_Document::operator = (const DOM_Document &other)
+{
+    return (DOM_Document &) DOM_Node::operator = (other);
+};
+
+
+DOM_Document & DOM_Document::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_Document &) DOM_Node::operator = (other);
+};
+
+
+DOM_Document    DOM_Document::createDocument()
+{
+        return DOM_Document(new DocumentImpl);
+};
+
+
+DOM_Notation    DOM_Document::createNotation(const DOMString &name)
+{
+        return DOM_Notation(((DocumentImpl *)fImpl)->createNotation(name));
+};
+
+
+DOM_DocumentType       DOM_Document::getDoctype() const {
+        return DOM_DocumentType(((DocumentImpl *)fImpl)->getDoctype());
+};
+
+
+DOM_DOMImplementation  &DOM_Document::getImplementation() const {
+        return DOM_DOMImplementation::getImplementation();
+};
+
+DOM_Element            DOM_Document::getDocumentElement() const {
+        return DOM_Element(((DocumentImpl *)fImpl)->getDocumentElement());
+};
+
+
+DOM_Element            DOM_Document::createElement(const DOMString &tagName)
+{
+        return DOM_Element(((DocumentImpl *)fImpl)->createElement(tagName));
+};
+
+
+
+DOM_Element            DOM_Document::createElement(const XMLCh *tagName)
+{
+        return DOM_Element(((DocumentImpl *)fImpl)->createElement(tagName));
+};
+
+
+
+DOM_Entity            DOM_Document::createEntity(const DOMString &name)
+{
+        return DOM_Entity(((DocumentImpl *)fImpl)->createEntity(name));
+};
+
+
+
+DOM_DocumentFragment   DOM_Document::createDocumentFragment()
+{
+        return DOM_DocumentFragment(((DocumentImpl *)fImpl)->createDocumentFragment());
+};
+
+
+DOM_DocumentType DOM_Document::createDocumentType(const DOMString &name)
+{
+        return DOM_DocumentType(((DocumentImpl *)fImpl)->createDocumentType(name));
+};
+
+
+
+DOM_Text               DOM_Document::createTextNode(const DOMString &data) {
+        return DOM_Text(((DocumentImpl *)fImpl)->createTextNode(data));
+};
+
+
+DOM_Comment            DOM_Document::createComment(const DOMString &data) {
+        return DOM_Comment(((DocumentImpl *)fImpl)->createComment(data));
+};
+
+
+DOM_CDATASection       DOM_Document::createCDATASection(const DOMString &data) {
+        return DOM_CDATASection(((DocumentImpl *)fImpl)->createCDATASection(data));
+};
+
+
+DOM_ProcessingInstruction DOM_Document::createProcessingInstruction(const DOMString &target,
+                                                     const DOMString &data) {
+        return DOM_ProcessingInstruction(((DocumentImpl *)fImpl)->createProcessingInstruction(target, data));
+};
+
+
+DOM_Attr               DOM_Document::createAttribute(const DOMString &name) {
+        return DOM_Attr(((DocumentImpl *)fImpl)->createAttribute(name));
+};
+
+
+DOM_EntityReference    DOM_Document::createEntityReference(const DOMString &name) {
+        return DOM_EntityReference(((DocumentImpl *)fImpl)->createEntityReference(name));
+};
+
+
+DOM_NodeIterator       DOM_Document::createNodeIterator(DOM_Node root, short whatToShow, DOM_NodeFilter filter) {
+        return DOM_NodeIterator(DocumentImpl::createNodeIterator(root, whatToShow, filter, 0L));
+};
+
+
+DOM_TreeWalker         DOM_Document::createTreeWalker(DOM_Node root, short whatToShow, DOM_NodeFilter filter) {
+        return DOM_TreeWalker(DocumentImpl::createTreeWalker(root, whatToShow, filter, 0L));
+};
+
+
+DOM_NodeIterator       DOM_Document::createNodeIterator(DOM_Node root, short whatToShow, NodeFilterImpl* filterThatWillBeAdopted) {
+        return DOM_NodeIterator(DocumentImpl::createNodeIterator(root, whatToShow, 0L, filterThatWillBeAdopted));
+};
+
+
+DOM_TreeWalker         DOM_Document::createTreeWalker(DOM_Node root, short whatToShow, NodeFilterImpl* filterThatWillBeAdopted) {
+        return DOM_TreeWalker(DocumentImpl::createTreeWalker(root, whatToShow, 0L, filterThatWillBeAdopted));
+};
+
+
+
+DOM_NodeList           DOM_Document::getElementsByTagName(const DOMString &tagname) const  {
+        return DOM_NodeList(((DocumentImpl *)fImpl)->getElementsByTagName(tagname));
+};
+
+
+//Introduced in DOM Level 2
+
+DOM_Node               DOM_Document::importNode(const DOM_Node &source, bool deep)
+{
+        return DOM_Node(((DocumentImpl *)fImpl)->importNode(source.fImpl, deep));
+};
+
+
+DOM_Element         DOM_Document::createElementNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName)
+{
+        return DOM_Element(((DocumentImpl *)fImpl)->createElementNS(namespaceURI, qualifiedName));
+}
+
+
+DOM_Attr            DOM_Document::createAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName)
+{
+        return DOM_Attr(((DocumentImpl *)fImpl)->createAttributeNS(namespaceURI, qualifiedName));
+}
+
+
+DOM_NodeList        DOM_Document::getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName) const
+{
+        return DOM_NodeList(((DocumentImpl *)fImpl)->getElementsByTagNameNS(namespaceURI, localName));
+}
+
+
+DOM_Element         DOM_Document::getElementById(const DOMString &elementId)
+{
+        return DOM_Element(((DocumentImpl *)fImpl)->getElementById(elementId));
+}
diff --git a/src/dom/DOM_Document.hpp b/src/dom/DOM_Document.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..ccef6a0f53757ddd667a733f15cbced3731a97c7
--- /dev/null
+++ b/src/dom/DOM_Document.hpp
@@ -0,0 +1,481 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:51  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:44:15  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+*/
+
+#ifndef DOM_Document_HEADER_GUARD_
+#define DOM_Document_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_DocumentType.hpp>
+#include <dom/DOM_DOMImplementation.hpp>
+#include <dom/DOM_Element.hpp>
+#include <dom/DOM_DocumentFragment.hpp>
+#include <dom/DOM_Comment.hpp>
+#include <dom/DOM_CDATASection.hpp>
+#include <dom/DOM_ProcessingInstruction.hpp>
+#include <dom/DOM_Attr.hpp>
+#include <dom/DOM_Entity.hpp>
+#include <dom/DOM_EntityReference.hpp>
+#include <dom/DOM_NodeList.hpp>
+#include <dom/DOM_Notation.hpp>
+#include <dom/DOM_Text.hpp>
+#include <dom/DOM_Node.hpp>
+#include <dom/DOM_NodeIterator.hpp>
+#include <dom/DOM_TreeWalker.hpp>
+
+class DocumentImpl;
+class NodeIteratorImpl;
+
+
+/**
+* Class to refer to XML Document nodes in the DOM.
+*
+* Conceptually, a DOM document node is the root of the document tree, and provides
+* the  primary access to the document's data.
+* <p>Since elements, text nodes, comments, processing instructions, etc.
+* cannot exist outside the context of a <code>Document</code>, the
+* <code>Document</code> interface also contains the factory methods needed
+* to create these objects.  The <code>Node</code> objects created have a
+* <code>ownerDocument</code> attribute which associates them with the
+* <code>Document</code> within whose  context they were created.
+*/
+class CDOM_EXPORT DOM_Document: public DOM_Node {
+
+public:
+    /** @name Constructors and assignment operators */
+    //@{
+    /**
+     * The default constructor for DOM_Document creates a null
+     * DOM_Document object that refers to no document.  It may subsequently be
+     * assigned to refer to an actual Document node.
+     *
+     * To create a new document, use the static method
+     *   <code> DOM_Document::createDocument(). </code>
+     *
+     */
+    DOM_Document();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_Document</code> that refers to the
+      * same underlying actual document as the original.
+      *
+      * @param other The object to be copied
+      */
+    DOM_Document(const DOM_Document &other);
+    /**
+      * Assignment operator
+      *
+      * @param other The object to be copied
+      */
+    DOM_Document & operator = (const DOM_Document &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Document & operator = (const DOM_NullPtr *val);
+
+
+
+	//@}
+  /** @name Destructor */
+  //@{
+	
+  /**
+    * Destructor.  The object being destroyed is the reference
+    * object, not the underlying Document itself.
+    *
+    * <p>The reference counting memory management will
+    *  delete the underlying document itself if this
+    * DOM_Document is the last remaining to refer to the Document,
+    * and if there are no remaining references to any of the nodes
+    * within the document tree.  If other live references do remain,
+    * the underlying document itself remains also.
+    *
+    */
+    ~DOM_Document();
+
+  //@}
+  /** @name Factory methods to create new nodes for the Document */
+  //@{
+
+    /**
+    *   Create a new empty document.
+    *
+    *   This differs from the <code> DOM_Document </code> default
+    *   constructor, which creates
+    *   a null reference only, not an actual document.
+    *
+    *   <p>This function is an extension to the DOM API, which
+    *   lacks any mechanism for the creation of new documents.
+    *   @return A new <code>DOM_Document</code>, which may then
+    *   be populated using the DOM API calls.
+    */
+    static DOM_Document   createDocument();
+
+    /**
+    *  Create a new entity.
+    *
+    *  Non-standard extension.
+    * @param name The name of the entity to instantiate
+    *
+    */
+    DOM_Entity     createEntity(const DOMString &name);
+
+    /**
+    * Creates an element of the type specified.
+    *
+    * Note that the instance returned
+    * implements the Element interface, so attributes can be specified
+    * directly  on the returned object.
+    * @param tagName The name of the element type to instantiate.
+    * @return A <code>DOM_Element</code> that reference the new element.
+    * @exception DOMException
+    *   INVALID_CHARACTER_ERR: Raised if the specified name contains an
+    *   invalid character.
+    */
+    DOM_Element     createElement(const DOMString &tagName);
+
+    /**
+    * Creates an element of the type specified.
+    * This non-standard overload of createElement, with the name specified as
+    * raw Unicode string, is intended for use from XML parsers,
+    * and is the best performing way to create elements.  The name
+    * string is not checked for conformance to the XML rules for valid
+    * element names.
+    *
+    *
+    * @param tagName The name of the element type to instantiate, as
+    *    a null-terminated unicode string.
+    * @return A <code>DOM_Element</code> that reference the new element.
+    */
+    DOM_Element     createElement(const XMLCh *tagName);
+
+
+    /**
+    * Creates an empty DocumentFragment object.
+    *
+    * @return A <code>DOM_DocumentFragment</code> that references the newly
+    * created document fragment.
+    */
+    DOM_DocumentFragment   createDocumentFragment();
+
+    /**
+    * Creates a Text node given the specified string.
+    *
+    * @param data The data for the node.
+    * @return A <code>DOM_Text</code> object that references the newly
+    *  created text node.
+    */
+    DOM_Text         createTextNode(const DOMString &data);
+
+    /**
+    * Creates a Comment node given the specified string.
+    *
+    * @param data The data for the comment.
+    * @return A <code>DOM_Comment</code> that references the newly
+    *  created comment node.
+    */
+    DOM_Comment      createComment(const DOMString &data);
+
+    /**
+    * Creates a CDATASection node whose value  is the specified
+    * string.
+    *
+    * @param data The data for the <code>DOM_CDATASection</code> contents.
+    * @return A <code>DOM_CDATASection</code> object.
+    * @exception DOMException
+    *   NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
+    */
+    DOM_CDATASection   createCDATASection(const DOMString &data);
+
+    /**
+    *  Create a DocumentType node.  Non-standard extension.
+    *
+    * @return A <code>DOM_DocumentType</code> that references the newly
+    *  created DocumentType node.
+    *
+    */
+    DOM_DocumentType createDocumentType(const DOMString &name);
+
+
+    /**
+    *  Create a Notation.
+    *
+    *  Non-standard extension.
+    *
+    *  @param name The name of the notation to instantiate
+    * @return A <code>DOM_Notation</code> that references the newly
+    *  created Notation node.
+    */
+    DOM_Notation createNotation(const DOMString &name);
+
+
+    /**
+    * Creates a ProcessingInstruction node given the specified
+    * name and data strings.
+    *
+    * @param target The target part of the processing instruction.
+    * @param data The data for the node.
+    * @return A <code>DOM_ProcessingInstruction</code> that references the newly
+    *  created PI node.
+    * @exception DOMException
+    *   INVALID_CHARACTER_ERR: Raised if an invalid character is specified.
+    */
+    DOM_ProcessingInstruction createProcessingInstruction(const DOMString &target,
+        const DOMString &data);
+
+
+    /**
+     * Creates an Attr of the given name.
+     *
+     * Note that the
+     * <code>Attr</code> instance can then be attached to an Element
+     * using the <code>DOMElement::setAttribute()</code> method.
+     * @param name The name of the attribute.
+     * @return A <code>DOM_Attr</code> that references the newly
+     *  created Attr.
+     * @exception DOMException
+     *   INVALID_CHARACTER_ERR: Raised if the specified name contains an
+     *   invalid character.
+     */
+    DOM_Attr     createAttribute(const DOMString &name);
+
+
+    /**
+     * Creates an EntityReference object.
+     *
+     * @param name The name of the entity to reference.
+     * @return A <code>DOM_EntityReference</code> that references the newly
+     *  created EntityReference node.
+     * @exception DOMException
+     *   INVALID_CHARACTER_ERR: Raised if the specified name contains an
+     *   invalid character.
+     */
+    DOM_EntityReference    createEntityReference(const DOMString &name);
+
+
+    /**
+     * Creates a NodeIterator object.   (DOM2)
+     */
+
+    static DOM_NodeIterator       createNodeIterator(DOM_Node root, short whatToShow, DOM_NodeFilter  filter);
+
+    // Same as above, but conveniently allows a pointer to an implementation of a filter to be passed. This filter will be
+    //  wrapped internally by a DOM_NodeFilter, and when you get the filter from the interator/walker, you will get a
+    //  DOM_NodeFilter object.
+    static DOM_NodeIterator       createNodeIterator(DOM_Node root, short whatToShow, NodeFilterImpl* filterThatWillBeAdopted);
+
+
+    /**
+     * Creates a TreeWalker object.   (DOM2)
+     */
+
+    static DOM_TreeWalker         createTreeWalker(DOM_Node root, short whatToShow, DOM_NodeFilter  filter);
+
+    // Same as above, but conveniently allows a pointer to an implementation of a filter to be passed. This filter will be
+    //  wrapped internally by a DOM_NodeFilter, and when you get the filter from the interator/walker, you will get a
+    //  DOM_NodeFilter object.
+    static DOM_TreeWalker         createTreeWalker(DOM_Node root, short whatToShow, NodeFilterImpl* filterThatWillBeAdopted);
+
+
+	//@}
+    /** @name Getter functions */
+    //@{
+    /**
+     * Get Document Type Declaration (see <code>DOM_DocumentType</code>) associated
+     * with  this document.
+     *
+     * For documents without
+     * a document type declaration this returns <code>null</code> reference object. The DOM Level
+     *  1 does not support editing the Document Type Declaration, therefore
+     * <code>docType</code> cannot be altered in any way.
+     */
+    DOM_DocumentType       getDoctype() const;
+
+
+
+    /**
+     * Return the <code>DOMImplementation</code> object that handles this document.
+     */
+    DOM_DOMImplementation  &getImplementation() const;
+
+
+    /**
+     * Return a reference to the root element of the document.
+     */
+    DOM_Element     getDocumentElement() const;
+
+    /**
+     * Returns a <code>DOM_NodeList</code> of all the elements with a
+     * given tag name.  The returned node list is "live", in that changes
+     * to the document tree made after a nodelist was initially
+     * returned will be immediately reflected in the node list.
+     *
+     * The elements in the node list are ordered in the same order in which they
+     * would be encountered in a
+     * preorder traversal of the <code>Document</code> tree.
+     * @param tagname The name of the tag to match on. The special value "*"
+     *   matches all tags.
+     * @return A reference to a NodeList containing all the matched
+     *   <code>Element</code>s.
+     */
+    DOM_NodeList           getElementsByTagName(const DOMString &tagname) const;
+
+    //@}
+    /** @name Functions introduced in DOM Level 2. */
+    //@{
+
+    /**
+      *  Import a copy of a node from another document into this document.
+      *  The source node, which may belong to a different document, is
+      *  copied, with the copy belonging to this document.  The copy
+      *  is not placed into the document (the parent node is null).
+      *
+      * @param deep If true, recursively import the subtree under the specified
+      *  node; if flase, import only the node itself (and its attributes, if
+      *  if is a DOM_Element.
+      * @return The newly created copy of the source node, belonging to this document
+      */
+    DOM_Node            importNode(const DOM_Node &source, bool deep);
+
+    /**
+     * Creates an element of the given qualified name and namespace URI.
+     * @param namespaceURI The <em>namespace URI</em> of
+     *   the element to create. When it is <code>null</code> or an empty
+     *   string, this method behaves like <code>createElement</code>.
+     * @param qualifiedName The <em>qualified name</em>
+     *   of the element type to instantiate.
+     * @return A new <code>DOM_Element</code> object.
+     * @exception DOMException
+     *   INVALID_CHARACTER_ERR: Raised if the specified name contains
+     *                          an invalid character.
+     */
+    DOM_Element         createElementNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName);
+
+    /**
+     * Creates an attribute of the given qualified name and namespace URI.
+     * @param namespaceURI The <em>namespace URI</em> of
+     *   the attribute to create. When it is <code>null</code> or an empty
+     *   string, this method behaves like <code>createAttribute</code>.
+     * @param qualifiedName The <em>qualified name</em>
+     *   of the attribute type to instantiate.
+     * @return A new <code>DOM_Attr</code> object.
+     * @exception DOMException
+     *   INVALID_CHARACTER_ERR: Raised if the specified name contains
+     *                          an invalid character.
+     */
+    DOM_Attr            createAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName);
+
+    /**
+     * Returns a <code>DOM_NodeList</code> of all the <code>DOM_Element</code>s
+     * with a given <em>local name</em> and
+     * namespace URI in the order in which they would be encountered in a
+     * preorder traversal of the <code>Document</code> tree.
+     * @param namespaceURI The <em>namespace URI</em> of
+     *   the elements to match on. The special value "*" matches all
+     *   namespaces. When it is <code>null</code> or an empty string, this
+     *   method behaves like <code>getElementsByTagName</code>.
+     * @param localName The <em>local name</em> of the
+     *   elements to match on. The special value "*" matches all local names.
+     * @return A new <code>DOM_NodeList</code> object containing all the matched
+     *  <code>Element</code>s.
+     */
+    DOM_NodeList        getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName) const;
+
+    /**
+     * Returns the <code>Element</code> whose ID is given by <code>elementId</code>.
+     * If no such element exists, returns <code>null</code>.
+     * Behavior is not defined if more than one element has this <code>ID</code>.
+     * @param elementId The unique <code>id</code> value for an element.
+     * @return The matching element.
+     */
+    DOM_Element         getElementById(const DOMString &elementId);
+
+    //@}
+
+private:
+    DOM_Document (DocumentImpl *impl);
+
+    friend class DOM_Node;
+    friend class NodeIteratorImpl;
+    friend class DOM_DOMImplementation;
+
+};
+
+
+#endif
diff --git a/src/dom/DOM_DocumentFragment.cpp b/src/dom/DOM_DocumentFragment.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9d768423d0487bc9cbf92b0a20c1d316cdfff144
--- /dev/null
+++ b/src/dom/DOM_DocumentFragment.cpp
@@ -0,0 +1,106 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:51  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:16  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_DocumentFragment.hpp"
+#include "DocumentFragmentImpl.hpp"
+
+
+
+DOM_DocumentFragment::DOM_DocumentFragment()
+: DOM_Node(null)
+{
+};
+
+
+DOM_DocumentFragment::DOM_DocumentFragment(const DOM_DocumentFragment & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_DocumentFragment::DOM_DocumentFragment(DocumentFragmentImpl *impl) :
+        DOM_Node(impl)
+{
+};
+
+
+DOM_DocumentFragment::~DOM_DocumentFragment() 
+{
+};
+
+
+DOM_DocumentFragment & DOM_DocumentFragment::operator = (const DOM_DocumentFragment & other)
+{
+     return (DOM_DocumentFragment &) DOM_Node::operator = (other);
+};
+
+
+DOM_DocumentFragment & DOM_DocumentFragment::operator = (const DOM_NullPtr *other)
+{
+     return (DOM_DocumentFragment &) DOM_Node::operator = (other);
+};
+
+
diff --git a/src/dom/DOM_DocumentFragment.hpp b/src/dom/DOM_DocumentFragment.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..dbe61158209c86df94e3d48e5d8a621a97f44f71
--- /dev/null
+++ b/src/dom/DOM_DocumentFragment.hpp
@@ -0,0 +1,183 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:51  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:16  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+*/
+
+#ifndef DOM_DocumentFragment_HEADER_GUARD_
+#define DOM_DocumentFragment_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class DocumentFragmentImpl;
+
+/**
+ * <code>DocumentFragment</code> is a "lightweight" or "minimal" 
+ * <code>Document</code> object. 
+ *
+ * It is very common to want to be able to 
+ * extract a portion of a document's tree or to create a new fragment of a 
+ * document. Imagine implementing a user command like cut or rearranging a 
+ * document by moving fragments around. It is desirable to have an object 
+ * which can hold such fragments and it is quite natural to use a Node for 
+ * this purpose. While it is true that a <code>Document</code> object could 
+ * fulfil this role,  a <code>Document</code> object can potentially be a 
+ * heavyweight  object, depending on the underlying implementation. What is 
+ * really needed for this is a very lightweight object.  
+ * <code>DocumentFragment</code> is such an object.
+ * <p>Furthermore, various operations -- such as inserting nodes as children 
+ * of another <code>Node</code> -- may take <code>DocumentFragment</code> 
+ * objects as arguments;  this results in all the child nodes of the 
+ * <code>DocumentFragment</code>  being moved to the child list of this node.
+ * <p>The children of a <code>DocumentFragment</code> node are zero or more 
+ * nodes representing the tops of any sub-trees defining the structure of the 
+ * document. <code>DocumentFragment</code> nodes do not need to be 
+ * well-formed XML documents (although they do need to follow the rules 
+ * imposed upon well-formed XML parsed entities, which can have multiple top 
+ * nodes).  For example, a <code>DocumentFragment</code> might have only one 
+ * child and that child node could be a <code>Text</code> node. Such a 
+ * structure model  represents neither an HTML document nor a well-formed XML 
+ * document.  
+ * <p>When a <code>DocumentFragment</code> is inserted into a  
+ * <code>Document</code> (or indeed any other <code>Node</code> that may take 
+ * children) the children of the <code>DocumentFragment</code> and not the 
+ * <code>DocumentFragment</code>  itself are inserted into the 
+ * <code>Node</code>. This makes the <code>DocumentFragment</code> very 
+ * useful when the user wishes to create nodes that are siblings; the 
+ * <code>DocumentFragment</code> acts as the parent of these nodes so that the
+ *  user can use the standard methods from the <code>Node</code>  interface, 
+ * such as <code>insertBefore()</code> and  <code>appendChild()</code>.  
+ */
+
+class CDOM_EXPORT DOM_DocumentFragment: public DOM_Node {
+
+public:
+    /** @name Constructors and assignment operators */
+    //@{
+    /**
+    * Default constructor for <code>DOM_DocumentFragment</code>.  The resulting object does not
+    * refer to an actual Document Fragment node; it will compare == to 0, and is similar
+    * to a null object reference variable in Java.  It may subsequently be
+    * assigned to refer to an actual Document Fragment node.
+    * <p>
+    * New document fragment nodes are created by DOM_Document::createDocumentFragment().
+    *
+    */
+
+    DOM_DocumentFragment();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_DocumentFragment</code> that refers to the
+      *   same underlying node as the original.  See also DOM_Node::clone(),
+      * which will copy the actual Document fragment node, rather than just creating a new
+      * reference to the original node.
+      *
+      * @param other The object to be copied
+      */
+    DOM_DocumentFragment(const DOM_DocumentFragment &other);
+
+    /**
+      * Assignment operator
+      *
+      * @param other The object to be copied
+      */
+    DOM_DocumentFragment & operator = (const DOM_DocumentFragment &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_DocumentFragment & operator = (const DOM_NullPtr *val);
+
+	//@}
+    /** @name Destructor */
+    //@{
+	    
+    /**
+      * Destructor.  The object being destroyed is the reference
+      * object, not the underlying Comment node itself.
+      *
+      */
+    ~DOM_DocumentFragment();
+
+	//@}
+
+private:
+    DOM_DocumentFragment(DocumentFragmentImpl *);
+
+    friend class DOM_Document;
+
+
+};
+
+#endif
diff --git a/src/dom/DOM_DocumentType.cpp b/src/dom/DOM_DocumentType.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..63e4868a16eeba21bd38b403726295c339fc1b88
--- /dev/null
+++ b/src/dom/DOM_DocumentType.cpp
@@ -0,0 +1,145 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:52  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:16  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_DocumentType.hpp"
+#include "DocumentTypeImpl.hpp"
+#include "DOM_NamedNodeMap.hpp"
+
+
+
+DOM_DocumentType::DOM_DocumentType()
+: DOM_Node(null)
+{
+};
+
+
+DOM_DocumentType::DOM_DocumentType(const DOM_DocumentType & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_DocumentType::DOM_DocumentType(DocumentTypeImpl *impl) :
+        DOM_Node(impl)
+{
+};
+
+
+DOM_DocumentType::~DOM_DocumentType() 
+{
+};
+
+
+DOM_DocumentType & DOM_DocumentType::operator = (const DOM_DocumentType & other)
+{
+     return (DOM_DocumentType &) DOM_Node::operator = (other);
+};
+
+
+DOM_DocumentType & DOM_DocumentType::operator = (const DOM_NullPtr *other)
+{
+     return (DOM_DocumentType &) DOM_Node::operator = (other);
+};
+
+
+DOMString       DOM_DocumentType::getName() const
+{
+        return ((DocumentTypeImpl *)fImpl)->getName();
+};
+
+
+
+DOM_NamedNodeMap DOM_DocumentType::getEntities() const
+{
+        return DOM_NamedNodeMap(((DocumentTypeImpl *)fImpl)->getEntities());
+};
+
+
+
+DOM_NamedNodeMap DOM_DocumentType::getNotations() const
+{
+        return DOM_NamedNodeMap(((DocumentTypeImpl *)fImpl)->getNotations());
+};
+
+
+//Introduced in DOM Level 2
+
+DOMString     DOM_DocumentType::getPublicID() const
+{
+        return ((DocumentTypeImpl *)fImpl)->getPublicID();
+}
+
+
+DOMString     DOM_DocumentType::getSystemID() const
+{
+        return ((DocumentTypeImpl *)fImpl)->getSystemID();
+}
+
+
+DOMString     DOM_DocumentType::getInternalSubset() const
+{
+        return ((DocumentTypeImpl *)fImpl)->getInternalSubset();
+}
diff --git a/src/dom/DOM_DocumentType.hpp b/src/dom/DOM_DocumentType.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..3273b886ff527a0e4023bc6eb1b122e7f0bbb295
--- /dev/null
+++ b/src/dom/DOM_DocumentType.hpp
@@ -0,0 +1,203 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:52  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:16  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_DocumentType_HEADER_GUARD_
+#define DOM_DocumentType_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class DOM_NamedNodeMap;
+class DocumentTypeImpl;
+
+/**
+ * Each <code>Document</code> has a <code>doctype</code> whose value 
+ * is either <code>null</code> or a <code>DocumentType</code> object. 
+ *
+ * The <code>DOM_DocumentType</code> class provides access
+ *  to the list of entities and notations that are defined for the document.
+ * <p>The DOM Level 1 doesn't support editing <code>DocumentType</code> nodes.
+ */
+class CDOM_EXPORT DOM_DocumentType: public DOM_Node {
+
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_DocumentType.  The resulting object does not
+      * refer to an actual DocumentType node; it will compare == to 0, and is similar
+      * to a null object reference variable in Java.  It may subsequently be
+      * assigned to refer to the actual DocumentType node.
+      * <p>
+      * A new DocumentType node for a document that does not already have one
+      * can be created by DOM_Document::createDocumentType().     
+      *
+      */
+    DOM_DocumentType();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_Comment</code> that refers to the
+      * same underlying node as the original.  
+      *
+      *
+      * @param other The object to be copied.
+      */
+    DOM_DocumentType(const DOM_DocumentType &other);
+
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_DocumentType & operator = (const DOM_DocumentType &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_DocumentType & operator = (const DOM_NullPtr *val);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_DocumentType.  The object being destroyed is the reference
+      * object, not the underlying DocumentType node itself.
+	  *
+	  */
+    ~DOM_DocumentType();
+    //@}
+
+    /** @name Getter functions. */
+    //@{
+  /**
+   * The name of DTD; i.e., the name immediately following the 
+   * <code>DOCTYPE</code> keyword in an XML source document.
+   */
+  DOMString       getName() const;
+
+  /**
+   * This function returns a  <code>NamedNodeMap</code> containing the general entities, both 
+   * external and internal, declared in the DTD. Duplicates are discarded. 
+   * <p>
+   * Note: this functionality is not implemented in the initial release
+   * of the parser, and the returned NamedNodeMap will be empty.
+   */
+  DOM_NamedNodeMap getEntities() const;
+
+
+  /**
+   * This function returns a named node map containing an entry for
+   * each notation declared in a document's DTD.  Duplicates are discarded.
+   *
+   * <p>
+   * Note: this functionality is not implemented in the initial release
+   * of the parser, and the returned NamedNodeMap will be empty.
+   */
+  DOM_NamedNodeMap getNotations() const;
+  //@}
+
+    /** @name Functions introduced in DOM Level 2. */
+    //@{
+    /**
+     * Get the public identifier of the external subset.
+     * @return The public identifier of the external subset.
+     */
+    DOMString     getPublicID() const;
+
+    /**
+     * Get the system identifier of the external subset.
+     * @return The system identifier of the external subset.
+     */
+    DOMString     getSystemID() const;
+
+    /**
+     * Get the internal subset as a string.
+     * @return The internal subset as a string.
+     */
+    DOMString     getInternalSubset() const;
+    //@}
+
+private:
+    DOM_DocumentType(DocumentTypeImpl *);
+
+    friend class DOM_Document;
+    friend class DOM_DOMImplementation;
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_Element.cpp b/src/dom/DOM_Element.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9b952f7b1a0518e7081c9cd5d88d2a38c57d429a
--- /dev/null
+++ b/src/dom/DOM_Element.cpp
@@ -0,0 +1,209 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:57  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:17  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Element.hpp"
+#include "DOM_Attr.hpp"
+#include "DOM_NodeList.hpp"
+#include "ElementImpl.hpp"
+#include "DeepNodeListImpl.hpp"
+
+
+DOM_Element::DOM_Element()
+: DOM_Node(null)
+{
+};
+
+
+DOM_Element::DOM_Element(const DOM_Element & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_Element::DOM_Element(ElementImpl *impl) :
+        DOM_Node(impl)
+{
+};
+
+
+DOM_Element::~DOM_Element() 
+{
+};
+
+
+DOM_Element & DOM_Element::operator = (const DOM_Element & other)
+{
+    return (DOM_Element &) DOM_Node::operator = (other);
+};
+
+
+DOM_Element & DOM_Element::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_Element &) DOM_Node::operator = (other);
+};
+
+
+DOMString DOM_Element::getTagName() const
+{
+        return ((ElementImpl *)fImpl)->getTagName();
+};
+
+
+DOMString DOM_Element::getAttribute(const DOMString &name) const
+{
+        return ((ElementImpl *)fImpl)->getAttribute(name);
+};
+
+
+void      DOM_Element::setAttribute(const DOMString &name, 
+                                    const DOMString &value)
+{
+        ((ElementImpl *)fImpl)->setAttribute(name, value);
+};
+
+
+
+void      DOM_Element::removeAttribute(const DOMString &name)
+{
+        ((ElementImpl *)fImpl)->removeAttribute(name);
+};
+
+
+DOM_Attr  DOM_Element::getAttributeNode(const DOMString &name) const
+{
+        return DOM_Attr(((ElementImpl *)fImpl)->getAttributeNode(name));
+};
+
+
+DOM_Attr  DOM_Element::setAttributeNode(DOM_Attr newAttr)
+{
+        return DOM_Attr(((ElementImpl *)fImpl)->
+                             setAttributeNode((AttrImpl *)newAttr.fImpl));
+};
+
+
+DOM_Attr  DOM_Element::removeAttributeNode(DOM_Attr oldAttr)
+{
+        return DOM_Attr(((ElementImpl *)fImpl)->
+                                                removeAttributeNode((AttrImpl *)oldAttr.fImpl));
+};
+
+
+DOM_NodeList DOM_Element::getElementsByTagName(const DOMString &name) const
+{
+        return DOM_NodeList(((ElementImpl *)fImpl)->getElementsByTagName(name));
+
+};
+
+
+void      DOM_Element::normalize()
+{
+        ((ElementImpl *)fImpl)->normalize();
+};
+
+
+//Introduced in DOM Level 2
+
+DOMString DOM_Element::getAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName) const
+{
+    return ((ElementImpl *)fImpl)->getAttributeNS(namespaceURI, localName);
+}
+
+void DOM_Element::setAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName, const DOMString &value)
+{
+    ((ElementImpl *)fImpl)->setAttributeNS(namespaceURI, qualifiedName, value);
+}
+
+
+void DOM_Element::removeAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    ((ElementImpl *)fImpl)->removeAttributeNS(namespaceURI, localName);
+}
+
+
+DOM_Attr DOM_Element::getAttributeNodeNS(const DOMString &namespaceURI,
+	const DOMString &localName) const
+{
+    return DOM_Attr(((ElementImpl *)fImpl)->getAttributeNodeNS(namespaceURI, localName));
+}
+
+
+DOM_Attr DOM_Element::setAttributeNodeNS(DOM_Attr newAttr)
+{
+    return DOM_Attr(((ElementImpl *)fImpl)->
+                             setAttributeNodeNS((AttrImpl *)newAttr.fImpl));
+}
+
+
+DOM_NodeList DOM_Element::getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName) const
+{
+    return DOM_NodeList(((ElementImpl *)fImpl)->getElementsByTagNameNS(namespaceURI,
+	localName));
+}
diff --git a/src/dom/DOM_Element.hpp b/src/dom/DOM_Element.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..977cfed9342cf4e676bb49e9845d8b640198e36c
--- /dev/null
+++ b/src/dom/DOM_Element.hpp
@@ -0,0 +1,420 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:57  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:17  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_Element_HEADER_GUARD_
+#define DOM_Element_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class DOM_Attr;
+class DOM_NodeList;
+class ElementImpl;
+
+/**
+ * By far the vast majority of objects (apart from text) that authors 
+ * encounter when traversing a document are <code>DOM_Element</code> nodes.  
+ *
+ * Assume the following XML document:&lt;elementExample id="demo"&gt; 
+ * &lt;subelement1/&gt; 
+ * &lt;subelement2&gt;&lt;subsubelement/&gt;&lt;/subelement2&gt;
+ * &lt;/elementExample&gt;  
+ * <p>When represented using DOM, the top node is an <code>DOM_Element</code> node 
+ * for "elementExample", which contains two child <code>DOM_Element</code> nodes, 
+ * one for "subelement1" and one for "subelement2". "subelement1" contains no 
+ * child nodes.
+ * <p>Elements may have attributes associated with them; since the 
+ * <code>DOM_Element</code> interface inherits from <code>DOM_Node</code>, the generic
+ *  <code>DOM_Node</code> interface method <code>getAttributes</code> may be used 
+ * to retrieve the set of all attributes for an element.  There are methods on
+ *  the <code>DOM_Element</code> interface to retrieve either an <code>DOM_Attr</code>
+ *  object by name or an attribute value by name. In XML, where an attribute 
+ * value may contain entity references, an <code>DOM_Attr</code> object should be 
+ * retrieved to examine the possibly fairly complex sub-tree representing the 
+ * attribute value. On the other hand, in HTML, where all attributes have 
+ * simple string values, methods to directly access an attribute value can 
+ * safely be used as a convenience.
+ */
+
+class CDOM_EXPORT DOM_Element: public DOM_Node {
+private:
+
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+    * Default constructor for DOM_Element.  The resulting object does not
+    * refer to an actual Element node; it will compare == to 0, and is similar
+    * to a null object reference variable in Java.  It may subsequently be
+    * assigned to refer to an actual Element node.
+    * <p>
+    * New comment nodes are created by DOM_Document::createElement().
+      *
+      */
+    DOM_Element();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_Element</code> that refers to the
+      * same underlying actual element as the original.
+      *
+      * @param other The object to be copied
+      */
+    DOM_Element(const DOM_Element &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Element & operator = (const DOM_Element &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Element & operator = (const DOM_NullPtr *val);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+      * Destructor.  The object being destroyed is the reference
+      * object, not the underlying Element itself.
+	  *
+	  */
+    ~DOM_Element();
+    //@}
+    /** @name Getter functions. */
+    //@{
+
+  /**
+   * The name of the element. 
+   *
+   * For example, in: &lt;elementExample 
+   * id="demo"&gt;  ... &lt;/elementExample&gt; , <code>tagName</code> has 
+   * the value <code>"elementExample"</code>. Note that this is 
+   * case-preserving in XML, as are all of the operations of the DOM. 
+   */
+  DOMString         getTagName() const;
+
+  /**
+   * Retrieves an attribute value by name.
+   *
+   * @param name The name of the attribute to retrieve.
+   * @return The <code>DOM_Attr</code> value as a string, or the empty  string if 
+   *   that attribute does not have a specified or default value.
+   */
+  DOMString         getAttribute(const DOMString &name) const;
+
+  /**
+   * Retrieves an <code>DOM_Attr</code> node by name.
+   *
+   * @param name The name of the attribute to retrieve.
+   * @return The <code>DOM_Attr</code> node with the specified attribute name or 
+   *   <code>null</code> if there is no such attribute.
+   */
+  DOM_Attr        getAttributeNode(const DOMString &name) const;
+
+  /**
+   * Returns a <code>NodeList</code> of all descendant elements with a given 
+   * tag name, in the order in which they would be encountered in a preorder 
+   * traversal of the <code>DOM_Element</code> tree.
+   *
+   * @param name The name of the tag to match on. The special value "*" 
+   *   matches all tags.
+   * @return A list of matching <code>DOM_Element</code> nodes.
+   */
+  DOM_NodeList    getElementsByTagName(const DOMString &name) const;
+
+  //@}
+  /** @name Set functions. */
+  //@{
+
+  /**
+   * Adds a new attribute. 
+   * 
+   * If an attribute with that name is already present 
+   * in the element, its value is changed to be that of the value parameter. 
+   * This value is a simple string, it is not parsed as it is being set. So 
+   * any markup (such as syntax to be recognized as an entity reference) is 
+   * treated as literal text, and needs to be appropriately escaped by the 
+   * implementation when it is written out. In order to assign an attribute 
+   * value that contains entity references, the user must create an 
+   * <code>DOM_Attr</code> node plus any <code>Text</code> and 
+   * <code>EntityReference</code> nodes, build the appropriate subtree, and 
+   * use <code>setAttributeNode</code> to assign it as the value of an 
+   * attribute.
+   * @param name The name of the attribute to create or alter.
+   * @param value Value to set in string form.
+   * @exception DOMException
+   *   INVALID_CHARACTER_ERR: Raised if the specified name contains an 
+   *   invalid character.
+   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+   void             setAttribute(const DOMString &name, 
+                                 const DOMString &value);
+   /**
+    * Adds a new attribute. 
+    * 
+    * If an attribute with that name is already present 
+    * in the element, it is replaced by the new one.
+    * @param newAttr The <code>DOM_Attr</code> node to add to the attribute list.
+    * @return If the <code>newAttr</code> attribute replaces an existing 
+    *   attribute with the same name, the  previously existing 
+    *   <code>DOM_Attr</code> node is returned, otherwise <code>null</code> is 
+    *   returned.
+    * @exception DOMException
+    *   WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 
+    *   different document than the one that created the element.
+    *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+    *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 
+    *   attribute of another <code>DOM_Element</code> object. The DOM user must 
+    *   explicitly clone <code>DOM_Attr</code> nodes to re-use them in other 
+    *   elements.
+    */
+   DOM_Attr        setAttributeNode(DOM_Attr newAttr);
+
+   //@}
+   /** @name Functions which modify the Element. */
+   //@{
+  /**
+   * Removes the specified attribute.
+   *
+   * @param oldAttr The <code>DOM_Attr</code> node to remove from the attribute 
+   *   list. If the removed <code>DOM_Attr</code> has a default value it is 
+   *   immediately replaced.
+   * @return The <code>DOM_Attr</code> node that was removed.
+   * @exception DOMException
+   *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   *   <br>NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an attribute 
+   *   of the element.
+   */
+  DOM_Attr        removeAttributeNode(DOM_Attr oldAttr);
+
+  /**
+   * Puts all <code>Text</code> nodes in the full depth of the sub-tree 
+   * underneath this <code>DOM_Element</code> into a "normal" form.
+    
+   * In the "normal" form  
+   * markup (e.g., tags, comments, processing instructions, CDATA sections, 
+   * and entity references) separates <code>Text</code> nodes, i.e., there 
+   * are no adjacent <code>Text</code> nodes.  This can be used to ensure 
+   * that the DOM view of a document is the same as if it were saved and 
+   * re-loaded, and is useful when operations (such as XPointer lookups) that 
+   * depend on a particular document tree structure are to be used.
+   */
+  void              normalize();
+
+  /**
+   * Removes an attribute by name. 
+   *
+   * If the removed attribute has a default 
+   * value it is immediately replaced.
+   * @param name The name of the attribute to remove.
+   * @exception DOMException
+   *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+  void              removeAttribute(const DOMString &name);
+
+  //@}
+  /** @name Functions introduced in DOM Level 2. */
+  //@{
+
+  /**
+   * Retrieves an attribute value by local name and namespace URI.
+   *
+   * @param namespaceURI The <em>namespace URI</em> of
+   *    the attribute to retrieve. When it is <code>null</code> or an empty
+   *    string, this method behaves like <code>getAttribute</code>.
+   * @param localName The <em>local name</em> of the
+   *    attribute to retrieve.
+   * @return The <code>DOM_Attr</code> value as a string, or an empty string if
+   *    that attribute does not have a specified or default value.
+   */
+  DOMString         getAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName) const;
+
+  /**
+   * Adds a new attribute. If an attribute with the same local name and
+   * namespace URI is already present in the element, its prefix is changed
+   * to be that of the <code>qualifiedName</code> parameter,
+   * and its value is changed to be that of the <code>value</code> parameter.
+   * This value is a simple string, it is
+   * not parsed as it is being set. So any markup (such as syntax to be
+   * recognized as an entity reference) is treated as literal text, and
+   * needs to be appropriately escaped by the implementation when it is
+   * written out. In order to assign an attribute value that contains entity
+   * references, the user must create a <code>DOM_Attr</code> node plus any
+   * <code>DOM_Text</code> and <code>DOM_EntityReference</code> nodes, build the
+   * appropriate subtree, and use <code>setAttributeNodeNS</code> or
+   * <code>setAttributeNode</code> to assign it as the value of an
+   * attribute.
+   * @param namespaceURI The <em>namespace URI</em> of
+   *    the attribute to create or alter. When it is <code>null</code> or an empty
+   *    string, this method behaves like <code>setAttribute</code>.
+   * @param localName The <em>local name</em> of the
+   *    attribute to create or alter.
+   * @param value The value to set in string form.
+   * @exception DOMException
+   *   INVALID_CHARACTER_ERR: Raised if the specified name contains an 
+   *   invalid character.
+   *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+   void             setAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName, const DOMString &value);
+
+  /**
+   * Removes an attribute by local name and namespace URI. If the
+   * removed attribute has a default value it is immediately replaced.
+   *
+   * @param namespaceURI The <em>namespace URI</em> of
+   *    the attribute to remove. When it is <code>null</code> or an empty
+   *    string, this method behaves like <code>removeAttribute</code>.
+   * @param localName The <em>local name</em> of the
+   *    attribute to remove.
+   * @exception DOMException
+   *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+   */
+  void              removeAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+
+  /**
+   * Retrieves an <code>DOM_Attr</code> node by local name and namespace URI.
+   *
+   * @param namespaceURI The <em>namespace URI</em> of
+   *    the attribute to retrieve. When it is <code>null</code> or an empty
+   *    string, this method behaves like <code>getAttributeNode</code>.
+   * @param localName The <em>local name</em> of the
+   *    attribute to retrieve.
+   * @return The <code>DOM_Attr</code> node with the specified attribute local
+   *    name and namespace URI or <code>null</code> if there is no such attribute.
+   */
+  DOM_Attr        getAttributeNodeNS(const DOMString &namespaceURI,
+	const DOMString &localName) const;
+
+   /**
+    * Adds a new attribute. 
+    * 
+    * If an attribute with that local name and namespace URI is already present 
+    * in the element, it is replaced by the new one.
+    * @param newAttr The <code>DOM_Attr</code> node to add to the attribute list.
+    *    When the node has no <code>namespaceURI</code>, this method behaves like
+    *    <code>setAttributeNode</code>.
+    * @return If the <code>newAttr</code> attribute replaces an existing
+    *    attribute with the same <em>local name</em> and <em>namespace URI</em>,
+    *    the previously existing <code>DOM_Attr</code> node is
+    *    returned, otherwise <code>null</code> is returned.
+    * @exception DOMException
+    *   WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 
+    *   different document than the one that created the element.
+    *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+    *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 
+    *   attribute of another <code>DOM_Element</code> object. The DOM user must 
+    *   explicitly clone <code>DOM_Attr</code> nodes to re-use them in other 
+    *   elements.
+    */
+   DOM_Attr        setAttributeNodeNS(DOM_Attr newAttr);
+
+  /**
+   * Returns a <code>DOM_NodeList</code> of all the <code>DOM_Element</code>s
+   * with a given local name and namespace URI in the order in which they
+   * would be encountered in a preorder traversal of the
+   * <code>DOM_Document</code> tree, starting from this node.
+   *
+   * @param namespaceURI The <em>namespace URI</em> of
+   *    the elements to match on. The special value "*" matches all
+   *    namespaces. When it is <code>null</code> or an empty string, this
+   *    method behaves like <code>getElementsByTagName</code>.
+   * @param localName The <em>local name</em> of the
+   *    elements to match on. The special value "*" matches all local names.
+   * @return A new <code>DOM_NodeList</code> object containing all the matched
+   *    <code>Element</code>s.
+   */
+  DOM_NodeList    getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName) const;
+
+  //@}
+
+  private:
+     DOM_Element(ElementImpl *impl);
+
+     friend class DOM_Document;
+     friend class DOM_Attr;
+
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_Entity.cpp b/src/dom/DOM_Entity.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..40721b6a41c3fc587bc4ca41bf975a7bcb3edf25
--- /dev/null
+++ b/src/dom/DOM_Entity.cpp
@@ -0,0 +1,139 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:57  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:17  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Entity.hpp"
+#include "EntityImpl.hpp"
+
+
+
+
+DOM_Entity::DOM_Entity()
+: DOM_Node(null)
+{
+};
+
+
+DOM_Entity::DOM_Entity(const DOM_Entity & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_Entity::DOM_Entity(EntityImpl *impl) :
+        DOM_Node(impl)
+{
+};
+
+
+DOM_Entity::~DOM_Entity() 
+{
+};
+
+
+DOM_Entity & DOM_Entity::operator = (const DOM_Entity & other)
+{
+     return (DOM_Entity &) DOM_Node::operator = (other);
+};
+
+
+DOM_Entity & DOM_Entity::operator = (const DOM_NullPtr *other)
+{
+     return (DOM_Entity &) DOM_Node::operator = (other);
+};
+
+
+DOMString  DOM_Entity::getPublicId() const
+{
+        return ((EntityImpl *)fImpl)->getPublicId();
+};
+
+DOMString  DOM_Entity::getSystemId() const
+{
+        return ((EntityImpl *)fImpl)->getSystemId();
+};
+
+
+DOMString  DOM_Entity::getNotationName() const
+{
+        return ((EntityImpl *)fImpl)->getNotationName();
+};
+
+
+void DOM_Entity::setNotationName(const DOMString &name)
+{
+    ((EntityImpl *)fImpl)->setNotationName(name);
+};
+
+void DOM_Entity::setPublicId(const DOMString &id)
+{
+    ((EntityImpl *)fImpl)->setPublicId(id);
+};
+
+void DOM_Entity::setSystemId(const DOMString &id)
+{
+    ((EntityImpl *)fImpl)->setSystemId(id);
+};
+
diff --git a/src/dom/DOM_Entity.hpp b/src/dom/DOM_Entity.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..29af4e1affb8af012b47e7fa9a82b02cd45b613d
--- /dev/null
+++ b/src/dom/DOM_Entity.hpp
@@ -0,0 +1,199 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:58  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:17  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_Entity_HEADER_GUARD_
+#define DOM_Entity_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class EntityImpl;
+
+/**
+ * This interface represents an entity, either parsed or unparsed, in an XML 
+ * document. 
+ *
+ * Note that this models the entity itself not the entity 
+ * declaration. <code>Entity</code> declaration modeling has been left for a 
+ * later Level of the DOM specification.
+ * <p>The <code>nodeName</code> attribute that is inherited from 
+ * <code>Node</code> contains the name of the entity.
+ * <p>An XML processor may choose to completely expand entities before  the 
+ * structure model is passed to the DOM; in this case there will be no 
+ * <code>EntityReference</code> nodes in the document tree.
+ *
+ * <p>Note: the first release of this parser does not create entity
+ *    nodes when reading an XML document.  Entities may be
+ *    programatically created using DOM_Document::createEntity().
+ */
+class CDOM_EXPORT DOM_Entity: public DOM_Node {
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_Entity.
+      *
+      */
+    DOM_Entity();
+
+    /**
+      * Copy constructor.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Entity(const DOM_Entity &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Entity & operator = (const DOM_Entity &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Entity & operator = (const DOM_NullPtr *val);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_Entity.
+	  *
+	  */
+    ~DOM_Entity();
+
+    //@}
+    /** @name Get functions. */
+    //@{
+  /**
+   * The public identifier associated with the entity, if specified. 
+   *
+   * If the public identifier was not specified, this is <code>null</code>.
+   */
+  DOMString        getPublicId() const;
+
+  /**
+   * The system identifier associated with the entity, if specified. 
+   *
+   * If the system identifier was not specified, this is <code>null</code>.
+   */
+  DOMString        getSystemId() const;
+
+  /**
+   * For unparsed entities, the name of the notation for the entity. 
+   *
+   * For parsed entities, this is <code>null</code>. 
+   */
+  DOMString        getNotationName() const;
+  //@}
+
+  /** @name Set functions. */
+  //@{
+  /**
+   * Set the Notation name.
+   *
+   * This is a non-standard IBM extension
+   */
+  void              setNotationName(const DOMString &name);
+
+  /**
+   * Set the public ID.
+   *
+   * This is a non-standard IBM extension.
+   *
+   */
+  void              setPublicId(const DOMString &Id);
+
+  /**
+   * Set the system ID.
+   *
+   * This is a non-standard IBM extension.
+   *
+   */
+  void              setSystemId(const DOMString &Id);
+
+  //@}
+
+private:
+    DOM_Entity(EntityImpl *impl);
+
+    friend class DOM_Document;
+};
+
+#endif
+
diff --git a/src/dom/DOM_EntityReference.cpp b/src/dom/DOM_EntityReference.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..cc357387f091364d3468f956aee512ec3d547d9e
--- /dev/null
+++ b/src/dom/DOM_EntityReference.cpp
@@ -0,0 +1,105 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:58  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:18  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_EntityReference.hpp"
+#include "EntityReferenceImpl.hpp"
+
+
+DOM_EntityReference::DOM_EntityReference()
+: DOM_Node(null)
+{
+};
+
+
+DOM_EntityReference::DOM_EntityReference(const DOM_EntityReference & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_EntityReference::DOM_EntityReference(EntityReferenceImpl *impl) :
+        DOM_Node(impl)
+{
+};
+
+
+DOM_EntityReference::~DOM_EntityReference() 
+{
+};
+
+
+DOM_EntityReference & DOM_EntityReference::operator = (const DOM_EntityReference & other)
+{
+    return (DOM_EntityReference &) DOM_Node::operator = (other);
+};
+
+
+DOM_EntityReference & DOM_EntityReference::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_EntityReference &) DOM_Node::operator = (other);
+};
+
+
diff --git a/src/dom/DOM_EntityReference.hpp b/src/dom/DOM_EntityReference.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..500e4abd667db9c86441c2a8690bdb008915c7cf
--- /dev/null
+++ b/src/dom/DOM_EntityReference.hpp
@@ -0,0 +1,150 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:58  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:18  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_EntityReference_HEADER_GUARD_
+#define DOM_EntityReference_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class EntityReferenceImpl;
+
+/**
+ * <code>EntityReference</code> nodes will appear in the structure 
+ * model when an entity reference is in the source document, or when the user 
+ * wishes to insert an entity reference. 
+ *
+ * The expansion of the entity will appear as child nodes of the entity
+ * reference node.  The expansion may be just simple text, or it may
+ * be more complex, containing additional entity refs.
+ *
+*/
+
+class CDOM_EXPORT DOM_EntityReference: public DOM_Node {
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_EntityReference.  The resulting object does not
+    * refer to an actual Entity Reference node; it will compare == to 0, and is similar
+    * to a null object reference variable in Java.  It may subsequently be
+    * assigned to refer to an actual entity reference node.
+    * <p>
+    * New entity reference nodes are created by DOM_Document::createEntityReference().
+      *
+      */
+    DOM_EntityReference();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_EntityReference</code> that refers to the
+    * same underlying node as the original.  
+      *
+      * @param other The object to be copied.
+      */
+    DOM_EntityReference(const DOM_EntityReference &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_EntityReference & operator = (const DOM_EntityReference &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_EntityReference & operator = (const DOM_NullPtr *val);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_EntityReference.  The object being destroyed is the reference
+      * object, not the underlying entity reference node itself.
+	  *
+	  */
+    ~DOM_EntityReference();
+    //@}
+
+private:
+    DOM_EntityReference(EntityReferenceImpl *impl);
+
+    friend class DOM_Document;
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_NamedNodeMap.cpp b/src/dom/DOM_NamedNodeMap.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d3c2fc1d7657b795bc9148c9c5a89a6fbd89e2c6
--- /dev/null
+++ b/src/dom/DOM_NamedNodeMap.cpp
@@ -0,0 +1,184 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:59  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:18  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Node.hpp"
+#include "DOM_NamedNodeMap.hpp"
+#include "NamedNodeMapImpl.hpp"
+
+
+DOM_NamedNodeMap::DOM_NamedNodeMap()
+{
+    fImpl = null;
+};
+
+
+DOM_NamedNodeMap::DOM_NamedNodeMap(const DOM_NamedNodeMap & other)
+{
+    this->fImpl = other.fImpl;
+    NamedNodeMapImpl::addRef(fImpl);
+};
+
+
+DOM_NamedNodeMap::DOM_NamedNodeMap(NamedNodeMapImpl *impl)
+{
+    fImpl = impl;
+    NamedNodeMapImpl::addRef(fImpl);
+};
+
+
+
+DOM_NamedNodeMap::~DOM_NamedNodeMap() 
+{
+    NamedNodeMapImpl::removeRef(fImpl);
+};
+
+bool DOM_NamedNodeMap::operator == (const DOM_NamedNodeMap &other) const
+{
+    return this->fImpl == other.fImpl;
+};
+
+
+bool DOM_NamedNodeMap::operator != (const DOM_NamedNodeMap &other) const
+{
+    return this->fImpl != other.fImpl;
+};
+
+
+bool DOM_NamedNodeMap::operator == (const DOM_NullPtr *p) const
+{
+    return this->fImpl == 0;
+};
+
+
+bool DOM_NamedNodeMap::operator != (const DOM_NullPtr *p) const
+{
+    return this->fImpl != 0;
+};
+
+
+DOM_NamedNodeMap & DOM_NamedNodeMap::operator = (const DOM_NamedNodeMap & other)
+{
+    if (this->fImpl != other.fImpl) 
+    {
+        NamedNodeMapImpl::removeRef(fImpl);
+        this->fImpl = other.fImpl;
+        NamedNodeMapImpl::addRef(fImpl);
+    }
+    return *this;
+};
+
+
+DOM_NamedNodeMap & DOM_NamedNodeMap::operator = (const DOM_NullPtr *other)
+{
+    NamedNodeMapImpl::removeRef(fImpl);
+    this->fImpl = 0;
+    return *this;
+};
+
+
+DOM_Node DOM_NamedNodeMap::getNamedItem(const DOMString &name)
+{
+    return DOM_Node(fImpl->getNamedItem(name));
+};
+
+
+DOM_Node DOM_NamedNodeMap::setNamedItem(DOM_Node arg)
+{
+    return DOM_Node(fImpl->setNamedItem(arg.fImpl));
+};
+
+
+DOM_Node DOM_NamedNodeMap::removeNamedItem(const DOMString &name)
+{
+    return DOM_Node(fImpl->removeNamedItem(name));
+};
+
+
+DOM_Node DOM_NamedNodeMap::item(int index)
+{
+    return DOM_Node(fImpl->item(index));
+};
+
+
+int     DOM_NamedNodeMap::getLength()
+{
+    return fImpl->getLength();
+};
+
+
+//Introduced in DOM Level 2
+
+DOM_Node DOM_NamedNodeMap::getNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    return DOM_Node(fImpl->getNamedItemNS(namespaceURI, localName));
+}
+
+DOM_Node DOM_NamedNodeMap::removeNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &name)
+{
+    return DOM_Node(fImpl->removeNamedItemNS(namespaceURI, name));
+}
diff --git a/src/dom/DOM_NamedNodeMap.hpp b/src/dom/DOM_NamedNodeMap.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..92cd7b329328bb2b7e9fa706787bc3017c4584cf
--- /dev/null
+++ b/src/dom/DOM_NamedNodeMap.hpp
@@ -0,0 +1,297 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:59  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:18  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_NamedNodeMap_HEADER_GUARD_
+#define DOM_NamedNodeMap_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+
+#include <dom/DOM_Node.hpp>
+class NamedNodeMapImpl;
+
+/**
+*  <code>NamedNodeMap</code>s  are used to 
+* represent collections of nodes that can be accessed by name.
+*
+* Note that <code>NamedNodeMap</code> does not inherit from <code>NodeList</code>; 
+* <code>NamedNodeMap</code>s are not maintained in any particular order. 
+* Nodes contained in a <code>NamedNodeMap</code> may 
+* also be accessed by an ordinal index, but this is simply to allow 
+* convenient enumeration of the contents, and 
+* does not imply that the DOM specifies an order to these Nodes. 
+*/
+class CDOM_EXPORT DOM_NamedNodeMap {
+private:
+    NamedNodeMapImpl        *fImpl;
+    
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_NamedNodeMap.  The resulting object does not
+      * refer to an actual DOM_NamedNodeMap node; it will compare == to 0, and is similar
+      * to a null object reference variable in Java. NamedNopes are instantiated
+      * by these methods:  DOM_Node::getAttributes, DOM_DocumentType::getEntities
+      * andDOM_DocumentType::getNotations
+      *
+      */
+    DOM_NamedNodeMap();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_NamedNodeMap</code> reference object 
+      * that refers to the same underlying NamedNodeMap as the original.  
+      *
+      * @param other The object to be copied.
+      */
+    DOM_NamedNodeMap(const DOM_NamedNodeMap &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_NamedNodeMap & operator = (const DOM_NamedNodeMap &other);
+    DOM_NamedNodeMap & operator = (const DOM_NullPtr *other);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_NamedNodeMap.  The object being destroyed is the reference
+      * object, not the underlying NamedNodeMap itself.
+      *
+      * <p>Like most other DOM types in this implementation, memory management
+      * of named node maps is automatic.  Instances of DOM_NamedNodeMap function
+      * as references to an underlying heap based implementation object,
+      * and should never be explicitly new-ed or deleted in application code, but
+      * should appear only as local variables or function parameters.
+	  *
+	  */
+    ~DOM_NamedNodeMap();
+    
+    //@}
+
+    /** @Comparisons. */
+    //@{
+    /*
+     *  Test whether this NamedNodeMap reference refers to the same underlying
+     *  named node map as the other reference object.  This does not
+     *  compare the contents of two different objects.
+     */
+    bool operator == (const DOM_NamedNodeMap &other) const;
+    bool operator != (const DOM_NamedNodeMap &other) const;
+
+
+    /*
+     *  Use this comparison operator to test whether a Named Node Map reference
+     *  is null.
+     *  @param arg p The value to be compared, which must be 0 or null.
+     *
+     */
+    bool operator == (const DOM_NullPtr *p) const;
+    bool operator != (const DOM_NullPtr *p) const;
+
+    //@}
+
+    /** @name Set functions. */
+    //@{
+
+    /**
+    * Adds a node using its <code>nodeName</code>. 
+    *
+    * <br>As the <code>nodeName</code> attribute is used to derive the name 
+    * which the node must be stored under, multiple nodes of certain types 
+    * (those that have a "special" string value) cannot be stored as the names 
+    * would clash. This is seen as preferable to allowing nodes to be aliased.
+    * @param arg A node to store in a named node map. The node will later be 
+    *   accessible using the value of the <code>nodeName</code> attribute of 
+    *   the node. If a node with that name is already present in the map, it 
+    *   is replaced by the new one.
+    * @return If the new <code>Node</code> replaces an existing node with the 
+    *   same name  the previously existing <code>Node</code> is returned, 
+    *   otherwise <code>null</code> is returned.
+    * @exception DOMException
+    *   WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a 
+    *   different document than the one that created the 
+    *   <code>NamedNodeMap</code>.
+    *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this 
+    *   <code>NamedNodeMap</code> is readonly.
+    *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an 
+    *   <code>Attr</code> that is already an attribute of another 
+    *   <code>Element</code> object. The DOM user must explicitly clone 
+    *   <code>Attr</code> nodes to re-use them in other elements.
+    */
+    DOM_Node               setNamedItem(DOM_Node arg);
+
+    /**
+    * Returns the <code>index</code>th item in the map. 
+    *
+    * If <code>index</code> 
+    * is greater than or equal to the number of nodes in the map, this returns 
+    * <code>null</code>.
+    * @param index Index into the map.
+    * @return The node at the <code>index</code>th position in the 
+    *   <code>NamedNodeMap</code>, or <code>null</code> if that is not a valid 
+    *   index.
+    */
+    DOM_Node               item(int index);
+
+    //@}
+    /** @name Get functions. */
+    //@{
+
+    /**
+    * Retrieves a node specified by name.
+    *
+    * @param name Name of a node to retrieve.
+    * @return A <code>Node</code> (of any type) with the specified name, or 
+    *   null <code>DOM_Node</code> if the specified name did not identify any node in 
+    *   the map. 
+    */
+    DOM_Node               getNamedItem(const DOMString &name);
+
+    /**
+    * The number of nodes in the map. 
+    *
+    * The range of valid child node indices is 
+    * 0 to <code>length-1</code> inclusive. 
+    */
+    int                    getLength();
+
+    //@}
+    /** @name Functions to change the node collection. */
+    //@{
+
+    /**
+    * Removes a node specified by name.
+    *
+    * If the removed node is an 
+    * <code>Attr</code> with a default value it is immediately replaced.
+    * @param name The name of a node to remove.
+    * @return The node removed from the map or <code>null</code> if no node 
+    *   with such a name exists.
+    * @exception DOMException
+    *   NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in 
+    *   the map.
+    */
+    DOM_Node               removeNamedItem(const DOMString &name);
+
+    //@}
+    /** @name Functions introduced in DOM Level 2. */
+    //@{
+
+    /**
+     * Retrieves a node specified by local name and namespace URI.
+     *
+     * @param namespaceURI The <em>namespace URI</em> of
+     *    the node to retrieve. When it is <code>null</code> or an empty
+     *    string, this method behaves like <code>getNamedItem</code>.
+     * @param localName The <em>local name</em> of the node to retrieve.
+     * @return A <code>DOM_Node</code> (of any type) with the specified
+     *    name, or <code>null</code> if the specified name did not
+     *    identify any node in the map.
+     */
+    DOM_Node               getNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+
+    /**
+     * Removes a node specified by local name and namespace URI.
+     *
+     * @param namespaceURI The <em>namespace URI</em> of
+     *    the node to remove. When it is <code>null</code> or an empty
+     *    string, this method behaves like <code>removeNamedItem</code>.
+     * @param name The <em>local name</em> of the
+     *    node to remove. When this <code>DOM_NamedNodeMap</code> contains the
+     *    attributes attached to an element, as returned by the attributes
+     *    attribute of the <code>DOM_Node</code> interface, if the removed
+     *    attribute is known to have a default value, an attribute
+     *    immediately appears containing the default value.
+     * @return The node removed from the map if a node with such a local name
+     *    and namespace URI exists.
+     * @exception DOMException
+     *   NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in 
+     *   the map.
+     * <br>
+     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this <code>NamedNodeMap</code>
+     *   is readonly.
+     */
+    DOM_Node               removeNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &name);
+
+    //@}
+
+ private:
+
+    DOM_NamedNodeMap(NamedNodeMapImpl *impl);
+
+    friend class DOM_DocumentType;
+    friend class DOM_Node;
+
+
+};
+
+#endif
+
diff --git a/src/dom/DOM_Node.cpp b/src/dom/DOM_Node.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a52de2742b91ddd36501f1698c8f360526b89ead
--- /dev/null
+++ b/src/dom/DOM_Node.cpp
@@ -0,0 +1,299 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:59  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:19  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Node.hpp"
+#include "DOM_NodeList.hpp"
+#include "DOM_NamedNodeMap.hpp"
+#include "DOM_Document.hpp"
+
+#include "NodeImpl.hpp"
+#include <assert.h>
+
+DOM_Node::DOM_Node() 
+{
+    fImpl = null;
+};
+
+
+DOM_Node::DOM_Node(NodeImpl *impl) 
+{
+    fImpl = impl;
+    RefCountedImpl::addRef(fImpl);
+};
+
+
+DOM_Node::DOM_Node(const DOM_Node &other)
+{
+	this->fImpl = other.fImpl;
+    RefCountedImpl::addRef(fImpl);
+};
+
+
+DOM_Node & DOM_Node::operator = (const DOM_Node &other)
+{
+    if (this->fImpl != other.fImpl)
+    {
+        RefCountedImpl::removeRef(this->fImpl);
+        this->fImpl = other.fImpl;
+        RefCountedImpl::addRef(this->fImpl);
+    }
+    return *this;
+};
+
+
+DOM_Node & DOM_Node::operator = (const DOM_NullPtr *other)
+{
+    RefCountedImpl::removeRef(this->fImpl);
+    this->fImpl = 0;
+    return *this;
+};
+
+
+
+DOM_Node::~DOM_Node() 
+{
+    RefCountedImpl::removeRef (this->fImpl);
+    fImpl = 0;
+};
+
+//
+//      Comparison operators.  Equivalent of Java object reference ==
+//                                         Null references compare ==.
+//
+bool       DOM_Node::operator != (const DOM_Node & other) const
+{
+    return this->fImpl != other.fImpl;
+};
+
+
+bool       DOM_Node::operator == (const DOM_Node & other) const
+{
+    return this->fImpl == other.fImpl;
+};
+
+bool       DOM_Node::operator != (const DOM_NullPtr * other) const
+{
+    return this->fImpl != 0;
+};
+
+
+bool       DOM_Node::operator == (const DOM_NullPtr * other) const
+{
+    return this->fImpl == 0;
+};
+
+
+
+
+DOM_Node   DOM_Node::appendChild(const DOM_Node &newChild)
+{
+    return DOM_Node(fImpl->appendChild(newChild.fImpl));
+};
+ 
+  
+DOM_Node      DOM_Node::cloneNode(bool deep) const 
+{
+    return DOM_Node(fImpl->cloneNode(deep));
+};
+
+
+DOMString  DOM_Node::getNodeName()  const 
+{
+    return fImpl->getNodeName();
+};
+
+  
+DOMString  DOM_Node::getNodeValue() const
+{
+    return fImpl->getNodeValue();
+};
+
+  
+short   DOM_Node::getNodeType() const
+{
+    return fImpl->getNodeType();
+};
+
+  
+DOM_Node      DOM_Node::getParentNode() const
+{
+    return DOM_Node(fImpl->getParentNode());
+};
+
+  
+DOM_NodeList      DOM_Node::getChildNodes() const
+{
+    return DOM_NodeList(fImpl);
+};
+ 
+  
+DOM_Node      DOM_Node::getFirstChild() const
+{
+    return DOM_Node(fImpl->getFirstChild());
+};
+
+  
+DOM_Node      DOM_Node::getLastChild() const
+{
+    return DOM_Node(fImpl->getLastChild());
+};
+ 
+  
+DOM_Node      DOM_Node::getPreviousSibling() const
+{
+    return DOM_Node(fImpl->getPreviousSibling());
+};
+ 
+  
+DOM_Node       DOM_Node::getNextSibling() const
+{
+    return DOM_Node(fImpl->getNextSibling());
+};
+  
+
+void          *DOM_Node::getUserData() const
+{
+    return fImpl->getUserData ();
+}
+  
+DOM_NamedNodeMap DOM_Node::getAttributes() const
+{
+    return DOM_NamedNodeMap(fImpl->getAttributes());
+};
+
+  
+DOM_Document   DOM_Node::getOwnerDocument() const
+{
+    return fImpl->getOwnerDocument();
+};
+
+  
+bool           DOM_Node::hasChildNodes() const
+{
+    return fImpl->hasChildNodes();
+};
+
+  
+DOM_Node       DOM_Node::insertBefore(const DOM_Node &newChild, const DOM_Node &refChild){
+    return DOM_Node(fImpl->insertBefore(newChild.fImpl, refChild.fImpl));
+};
+
+
+bool               DOM_Node::isNull() const
+{
+    return fImpl == null;
+};
+
+
+DOM_Node       DOM_Node::replaceChild(const DOM_Node &newChild, const DOM_Node &oldChild){
+    return DOM_Node(fImpl->replaceChild(newChild.fImpl, oldChild.fImpl));
+};
+
+  
+DOM_Node       DOM_Node::removeChild(const DOM_Node &oldChild){
+    return DOM_Node(fImpl->removeChild(oldChild.fImpl));
+};
+
+  
+void           DOM_Node::setNodeValue(const DOMString &nodeValue)
+{
+    fImpl->setNodeValue(nodeValue);
+};
+
+
+void            DOM_Node::setUserData(void *p)
+{
+    fImpl->setUserData(p);
+}
+
+
+//Introduced in DOM Level 2
+
+bool              DOM_Node::supports(const DOMString &feature,
+	                       const DOMString &version) const
+{
+    return fImpl->supports(feature, version);
+}
+
+DOMString         DOM_Node::getNamespaceURI() const
+{
+    return fImpl->getNamespaceURI();
+}
+
+DOMString         DOM_Node::getPrefix() const
+{
+    return fImpl->getPrefix();
+}
+
+DOMString         DOM_Node::getLocalName() const
+{
+    return fImpl->getLocalName();
+}
+
+void              DOM_Node::setPrefix(const DOMString &prefix)
+{
+    fImpl->setPrefix(prefix);
+}
diff --git a/src/dom/DOM_Node.hpp b/src/dom/DOM_Node.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..3d4a31114fe4f7daa2879fc8ed7e305765f8f8f2
--- /dev/null
+++ b/src/dom/DOM_Node.hpp
@@ -0,0 +1,586 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:59  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:44:19  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_Node_HEADER_GUARD_
+#define DOM_Node_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOMString.hpp>
+
+class DOM_NodeList;
+class DOM_NamedNodeMap;
+class DOM_Document;
+class NodeImpl;
+
+class DOM_NullPtr;  // A dummy class, with no implementation, that is
+                    //  used as in overloaded functions as a way to
+                    //  pass 0 or null.
+
+/**
+ * The <code>Node</code> interface is the primary datatype for the entire
+ * Document Object Model.
+ *
+ * It represents a single node in the document tree.
+ * While all objects implementing the <code>Node</code> interface expose
+ * methods for dealing with children, not all objects implementing the
+ * <code>Node</code> interface may have children. For example,
+ * <code>Text</code> nodes may not have children, and adding children to such
+ * nodes results in a <code>DOMException</code> being raised.
+ * <p>The attributes <code>nodeName</code>, <code>nodeValue</code>  and
+ * <code>attributes</code> are  included as a mechanism to get at node
+ * information without  casting down to the specific derived interface. In
+ * cases where  there is no obvious mapping of these attributes for a specific
+ *  <code>nodeType</code> (e.g., <code>nodeValue</code> for an Element  or
+ * <code>attributes</code>  for a Comment), this returns <code>null</code>.
+ * Note that the  specialized interfaces may contain additional and more
+ * convenient mechanisms to get and set the relevant information.
+ */
+class  CDOM_EXPORT DOM_Node {
+
+    public:
+    /** @name Constructors and assignment operators */
+    //@{
+    /**
+      * Default constructor for DOM_Node.  The resulting object does not
+      * refer to an actual  node; it will compare == to 0, and is similar
+      * to a null object reference variable in Java.  It may subsequently be
+      * assigned to refer to an actual node.  "Acutal Nodes" will always
+      * be of some derived type, such as Element or Attr.
+      *
+      */
+    DOM_Node();
+
+    /**
+      * Copy constructor.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Node(const DOM_Node &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The source to be assigned.
+      */
+    DOM_Node & operator = (const DOM_Node &other);
+
+     /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Node & operator = (const DOM_NullPtr *val);
+
+   //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_Node.  The object being destroyed is the reference
+      * object, not the underlying node itself.
+	  *
+	  */
+    ~DOM_Node();
+
+    //@}
+    /** @name Equality and Inequality operators. */
+    //@{
+    /**
+     * The equality operator.  This compares to references to nodes, and
+     * returns true if they both refer to the same underlying node.  It
+     * is exactly analogous to Java's operator ==  on object reference
+     * variables.  This operator can not be used to compare the values
+     * of two different nodes in the document tree.
+     *
+     * @param other The object reference with which <code>this</code> object is compared
+     * @returns True if both <code>DOM_Node</code>s refer to the same
+     *  actual node, or are both null; return false otherwise.
+     */
+    bool operator == (const DOM_Node & other)const;
+
+    /**
+      *  Compare with a pointer.  Intended only to allow a convenient
+      *    comparison with null.
+      *
+      */
+    bool operator == (const DOM_NullPtr *other) const;
+
+    /**
+     * The inequality operator.  See operator ==.
+     *
+     */
+    bool operator != (const DOM_Node & other) const;
+
+     /**
+      *  Compare with a pointer.  Intended only to allow a convenient
+      *    comparison with null.
+      *
+      */
+   bool operator != (const DOM_NullPtr * other) const;
+
+
+    enum NodeType {
+        ELEMENT_NODE         = 1,
+        ATTRIBUTE_NODE       = 2,
+        TEXT_NODE            = 3,
+        CDATA_SECTION_NODE   = 4,
+        ENTITY_REFERENCE_NODE = 5,
+        ENTITY_NODE          = 6,
+        PROCESSING_INSTRUCTION_NODE = 7,
+        COMMENT_NODE         = 8,
+        DOCUMENT_NODE        = 9,
+        DOCUMENT_TYPE_NODE   = 10,
+        DOCUMENT_FRAGMENT_NODE = 11,
+        NOTATION_NODE        = 12
+    };
+
+    //@}
+    /** @name Get functions. */
+    //@{
+
+    /**
+     * The name of this node, depending on its type; see the table above.
+     */
+    DOMString       getNodeName() const;
+
+    /**
+     * Gets the value of this node, depending on its type.
+     *
+     * @exception DOMException
+     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
+     * @exception DOMException
+     *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than
+     *   fit in a <code>DOMString</code> variable on the implementation
+     *   platform.
+     */
+    DOMString       getNodeValue() const;
+
+    /**
+     * An enum value representing the type of the underlying object.
+     */
+    short           getNodeType() const;
+
+    /**
+     * Gets the parent of this node.
+     *
+     * All nodes, except <code>Document</code>,
+     * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent.
+     * However, if a node has just been created and not yet added to the tree,
+     * or if it has been removed from the tree, a <code>null</code> DOM_Node
+     * is returned.
+     */
+    DOM_Node        getParentNode() const;
+
+    /**
+     * Gets a <code>NodeList</code> that contains all children of this node.
+     *
+     * If there
+     * are no children, this is a <code>NodeList</code> containing no nodes.
+     * The content of the returned <code>NodeList</code> is "live" in the sense
+     * that, for instance, changes to the children of the node object that
+     * it was created from are immediately reflected in the nodes returned by
+     * the <code>NodeList</code> accessors; it is not a static snapshot of the
+     * content of the node. This is true for every <code>NodeList</code>,
+     * including the ones returned by the <code>getElementsByTagName</code>
+     * method.
+     */
+    DOM_NodeList    getChildNodes() const;
+    /**
+     * Gets the first child of this node.
+     *
+     * If there is no such node, this returns <code>null</code>.
+     */
+    DOM_Node        getFirstChild() const;
+
+    /**
+     * Gets the last child of this node.
+     *
+     * If there is no such node, this returns <code>null</code>.
+     */
+    DOM_Node        getLastChild() const;
+
+    /**
+     * Gets the node immediately preceding this node.
+     *
+     * If there is no such node, this returns <code>null</code>.
+     */
+    DOM_Node        getPreviousSibling() const;
+
+    /**
+     * Gets the node immediately following this node.
+     *
+     * If there is no such node, this returns <code>null</code>.
+     */
+    DOM_Node        getNextSibling() const;
+
+    /**
+     * Gets a <code>NamedNodeMap</code> containing the attributes of this node (if it
+     * is an <code>Element</code>) or <code>null</code> otherwise.
+     */
+    DOM_NamedNodeMap  getAttributes() const;
+
+    /**
+     * Gets the <code>Document</code> object associated with this node.
+     *
+     * This is also
+     * the <code>Document</code> object used to create new nodes. When this
+     * node is a <code>Document</code> or a <code>DocumentType</code>,
+     * which is not used with any <code>Document</code> yet, this is
+     * <code>null</code>.
+     */
+    DOM_Document      getOwnerDocument() const;
+
+    /**
+      * Return the user data pointer.
+      *
+      * User data allows application programs
+      * to attach extra data to DOM nodes, and can be set using the
+      * function <code>DOM_Node::setUserData(p)</code>.
+      * @return The user data pointer.
+      */
+    void              *getUserData() const;
+
+    //@}
+    /** @name Cloning function. */
+    //@{
+
+    /**
+     * Returns a duplicate of this node.
+     *
+     * This function serves as a generic copy constructor for nodes.
+     *
+     * The duplicate node has no parent (
+     * <code>parentNode</code> returns <code>null</code>.).
+     * <br>Cloning an <code>Element</code> copies all attributes and their
+     * values, including those generated by the  XML processor to represent
+     * defaulted attributes, but this method does not copy any text it contains
+     * unless it is a deep clone, since the text is contained in a child
+     * <code>Text</code> node. Cloning any other type of node simply returns a
+     * copy of this node.
+     * @param deep If <code>true</code>, recursively clone the subtree under the
+     *   specified node; if <code>false</code>, clone only the node itself (and
+     *   its attributes, if it is an <code>Element</code>).
+     * @return The duplicate node.
+     */
+    DOM_Node         cloneNode(bool deep) const;
+
+    //@}
+    /** @name Functions to modify the DOM Node. */
+    //@{
+
+    /**
+     * Inserts the node <code>newChild</code> before the existing child node
+     * <code>refChild</code>.
+     *
+     * If <code>refChild</code> is <code>null</code>,
+     * insert <code>newChild</code> at the end of the list of children.
+     * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
+     * all of its children are inserted, in the same order, before
+     * <code>refChild</code>. If the <code>newChild</code> is already in the
+     * tree, it is first removed.  Note that a <code>DOM_Node</code> that
+     * has never been assigned to refer to an actual node is == null.
+     * @param newChild The node to insert.
+     * @param refChild The reference node, i.e., the node before which the new
+     *   node must be inserted.
+     * @return The node being inserted.
+     * @exception DOMException
+     *   HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
+     *   allow children of the type of the <code>newChild</code> node, or if
+     *   the node to insert is one of this node's ancestors.
+     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
+     *   from a different document than the one that created this node.
+     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+     *   <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
+     *   this node.
+     */
+    DOM_Node               insertBefore(const DOM_Node &newChild,
+                                        const DOM_Node &refChild);
+
+
+    /**
+     * Replaces the child node <code>oldChild</code> with <code>newChild</code>
+     * in the list of children, and returns the <code>oldChild</code> node.
+     *
+     * If the <code>newChild</code> is already in the tree, it is first removed.
+     * @param newChild The new node to put in the child list.
+     * @param oldChild The node being replaced in the list.
+     * @return The node replaced.
+     * @exception DOMException
+     *   HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
+     *   allow children of the type of the <code>newChild</code> node, or it
+     *   the node to put in is one of this node's ancestors.
+     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
+     *   from a different document than the one that created this node.
+     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+     *   <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
+     *   this node.
+     */
+    DOM_Node       replaceChild(const DOM_Node &newChild,
+                                const DOM_Node &oldChild);
+    /**
+     * Removes the child node indicated by <code>oldChild</code> from the list
+     * of children, and returns it.
+     *
+     * @param oldChild The node being removed.
+     * @return The node removed.
+     * @exception DOMException
+     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+     *   <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
+     *   this node.
+     */
+    DOM_Node        removeChild(const DOM_Node &oldChild);
+
+    /**
+     * Adds the node <code>newChild</code> to the end of the list of children of
+     * this node.
+     *
+     * If the <code>newChild</code> is already in the tree, it is
+     * first removed.
+     * @param newChild The node to add.If it is a  <code>DocumentFragment</code>
+     *   object, the entire contents of the document fragment are moved into
+     *   the child list of this node
+     * @return The node added.
+     * @exception DOMException
+     *   HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
+     *   allow children of the type of the <code>newChild</code> node, or if
+     *   the node to append is one of this node's ancestors.
+     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
+     *   from a different document than the one that created this node.
+     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+     */
+    DOM_Node        appendChild(const DOM_Node &newChild);
+
+    //@}
+    /** @name Query functions. */
+    //@{
+
+    /**
+     *  This is a convenience method to allow easy determination of whether a
+     * node has any children.
+     *
+     * @return  <code>true</code> if the node has any children,
+     *   <code>false</code> if the node has no children.
+     */
+    bool             hasChildNodes() const;
+
+
+    /**
+     * Test whether this node is null.
+     *
+     * This C++ class, <code>DOM_Node<code>
+     * functions much like an object reference to an underlying Node, and
+     * this function tests for that reference being null.  Several DOM
+     * APIs, <code>Node.getNextSibling()</code> for example, can return null, and
+     * this function is used to test for that condition.
+     *
+     * <p>Operator == provides another way to perform this null test on a
+     * DOM_Node.
+     */
+    bool                    isNull() const;
+
+    //@}
+    /** @name Set functions. */
+    //@{
+
+
+    /**
+    * Sets the value of the node.
+    *
+    * Any node which can have a nodeValue (@see getNodeValue) will
+    * also accept requests to set it to a string. The exact response to
+    * this varies from node to node -- Attribute, for example, stores
+    * its values in its children and has to replace them with a new Text
+    * holding the replacement value.
+    *
+    * For most types of Node, value is null and attempting to set it
+    * will throw DOMException(NO_MODIFICATION_ALLOWED_ERR). This will
+    * also be thrown if the node is read-only.
+    */
+    void              setNodeValue(const DOMString &nodeValue);
+
+    /**
+      * Set the user data for a node.
+      *
+      * User data allows application programs
+      * to attach extra data to DOM nodes, and can be retrieved using the
+      * function <code>DOM_Node::getUserData(p)</code>.
+      * <p>
+      * Deletion of the user data remains the responsibility of the
+      * application program; it will not be automatically deleted when
+      * the nodes themselves are reclaimed.
+      *
+      * <p> Because DOM_Node is not designed to be subclassed, userdata
+      * provides an alternative means for extending the the information
+      * kept with nodes by an application program.
+      *
+      * @param p The pointer to be kept with the node.
+      */
+    void              setUserData(void *p);
+
+    //@}
+    /** @name Functions introduced in DOM Level 2. */
+    //@{
+
+    /**
+     * Tests whether the DOM implementation implements a specific
+     * feature and that feature is supported by this node.
+     * @param feature The string of the feature to test. This is the same
+     * name as what can be passed to the method <code>hasFeature</code> on
+     * <code>DOMImplementation</code>.
+     * @param version This is the version number of the feature to test. In
+     * Level 2, version 1, this is the string "2.0". If the version is not
+     * specified, supporting any version of the feature will cause the
+     * method to return <code>true</code>.
+     * @return Returns <code>true</code> if the specified feature is supported
+     * on this node, <code>false</code> otherwise.
+     */
+    bool              supports(const DOMString &feature,
+	                       const DOMString &version) const;
+
+    /**
+     * Get the <em>namespace URI</em> of
+     * this node, or <code>null</code> if it is unspecified. When this node is
+     * of any type other than <code>ELEMENT_NODE</code> and
+     * <code>ATTRIBUTE_NODE</code>, this is always <code>null</code> and
+     * setting it has no effect.
+     * <p>
+     * This is not a computed value that is the result of a namespace lookup
+     * based on an examination of the namespace declarations in scope. It is
+     * merely the namespace URI given at creation time.
+     * <p>
+     * For nodes created with a DOM Level 1 method, such as
+     * <code>createElement</code> from the <code>DOM_Document</code> interface,
+     * this is <code>null</code>.
+     */
+    DOMString         getNamespaceURI() const;
+
+    /**
+     * Get the <em>namespace prefix</em>
+     * of this node, or <code>null</code> if it is unspecified. When this node
+     * is of any type other than <code>ELEMENT_NODE</code> and
+     * <code>ATTRIBUTE_NODE</code> this is always <code>null</code> and
+     * setting it has no effect.
+     * <p>
+     * For nodes created with a DOM Level 1 method, such as
+     * <code>createElement</code> from the <code>DOM_Document</code> interface,
+     * this is <code>null</code>.
+     */
+    DOMString         getPrefix() const;
+
+    /**
+     * Returns the local part of the <em>qualified name</em> of this node.
+     * <p>
+     * For nodes created with a DOM Level 1 method, such as
+     * <code>createElement</code> from the <code>DOM_Document</code> interface,
+     * and for nodes of any type other than <code>ELEMENT_NODE</code> and
+     * <code>ATTRIBUTE_NODE</code> this is the same as the
+     * <code>nodeName</code> attribute.
+     */
+    DOMString         getLocalName() const;
+
+    /**
+     * Get the <em>namespace prefix</em> of this node.
+     * <p>
+     * Note that setting this attribute changes the <code>nodeName</code>
+     * attribute, which holds the <em>qualified name</em>,
+     * as well as the <code>tagName</code> and
+     * <code>name</code> attributes of the <code>Element</code> and
+     * <code>Attr</code> interfaces, when applicable.
+     *
+     * @param prefix The prefix of this node.
+     * @exception DOMException
+     *   INVALID_CHARACTER_ERR: Raised if the specified prefix contains
+     *                          an invalid character.
+     * <br>
+     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+     */
+    void              setPrefix(const DOMString &prefix);
+
+    //@}
+
+protected:
+    NodeImpl   *fImpl;
+
+    DOM_Node(NodeImpl *);
+
+    friend class DOM_Document;
+    friend class DocumentImpl;
+    friend class TreeWalkerImpl;
+    friend class NodeIteratorImpl;
+    friend class DOM_NamedNodeMap;
+    friend class DOM_NodeList;
+};
+
+
+#endif
+
diff --git a/src/dom/DOM_NodeFilter.cpp b/src/dom/DOM_NodeFilter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..758bfd4349ddcd9a968763991bbf6174aac92478
--- /dev/null
+++ b/src/dom/DOM_NodeFilter.cpp
@@ -0,0 +1,139 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:00  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:19  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// DOM_NodeFilter.cpp: implementation of the DOM_NodeFilter class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "DOM_NodeFilter.hpp"
+#include "NodeFilterImpl.hpp"
+
+
+DOM_NodeFilter::DOM_NodeFilter() {
+    fImpl = 0;
+}
+
+
+DOM_NodeFilter::DOM_NodeFilter(NodeFilterImpl *impl) {
+    fImpl = impl;
+    RefCountedImpl::addRef(fImpl);
+}
+
+
+DOM_NodeFilter::DOM_NodeFilter(const DOM_NodeFilter &other){
+    fImpl = other.fImpl;
+    RefCountedImpl::addRef(fImpl);
+}
+
+
+DOM_NodeFilter & DOM_NodeFilter::operator = (const DOM_NodeFilter &other) {
+    if (this->fImpl != other.fImpl)
+    {
+        RefCountedImpl::removeRef(this->fImpl);
+        this->fImpl = other.fImpl;
+        RefCountedImpl::addRef(this->fImpl);
+    }
+    return *this;
+}
+
+
+DOM_NodeFilter & DOM_NodeFilter::operator = (const DOM_NullPtr *other) {
+    RefCountedImpl::removeRef(this->fImpl);
+    this->fImpl = 0;
+    return *this;
+}
+
+
+DOM_NodeFilter::~DOM_NodeFilter() {
+    RefCountedImpl::removeRef(this->fImpl);
+    fImpl = 0;
+}
+
+
+bool DOM_NodeFilter::operator == (const DOM_NodeFilter &other) const {
+    return this->fImpl == other.fImpl;
+}
+
+
+bool DOM_NodeFilter::operator != (const DOM_NodeFilter &other) const {
+    return this->fImpl != other.fImpl;
+}
+
+
+bool DOM_NodeFilter::operator == (const DOM_NullPtr *nullPtr) const
+{
+    return this->fImpl == 0;
+}
+
+
+bool DOM_NodeFilter::operator != (const DOM_NullPtr *nullPtr) const {
+    return this->fImpl != 0;
+}
+
+
+DOM_NodeFilter::FilterAction DOM_NodeFilter::acceptNode (DOM_Node node) {
+    return this->fImpl->acceptNode(node);
+}
diff --git a/src/dom/DOM_NodeFilter.hpp b/src/dom/DOM_NodeFilter.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..9ed21008669dc16cc95ef60b09d4b640ec996a87
--- /dev/null
+++ b/src/dom/DOM_NodeFilter.hpp
@@ -0,0 +1,110 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:00  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:19  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// DOM_NodeFilter.h: interface for the DOM_NodeFilter class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef DOM_NodeFilter_HEADER_GUARD_
+#define DOM_NodeFilter_HEADER_GUARD_
+
+#include "DOM_Node.hpp"
+
+class NodeFilterImpl;
+
+
+/*
+*	This class wraps a NodeFilterImpl object, which is reference counted. Users
+*	are expected to subclass NodeFilterImpl to provide the desired filter. An example
+*	of this is in NameNodeFilterImpl.[cpp,hpp]
+*/
+
+
+class CDOM_EXPORT DOM_NodeFilter
+{
+	public:
+		enum FilterAction {ACCEPT, REJECT, SKIP};
+
+    DOM_NodeFilter (NodeFilterImpl* refCountedFilter);
+
+    DOM_NodeFilter();
+    DOM_NodeFilter(const DOM_NodeFilter &other);
+    DOM_NodeFilter & operator = (const DOM_NodeFilter &other);
+    DOM_NodeFilter & operator = (const DOM_NullPtr *val);
+    ~DOM_NodeFilter();
+    bool operator == (const DOM_NodeFilter &other) const;
+    bool operator != (const DOM_NodeFilter &other) const;
+
+    bool operator == (const DOM_NullPtr *nullPtr) const;
+    bool operator != (const DOM_NullPtr *nullPtr) const;
+
+		virtual FilterAction acceptNode (DOM_Node node);
+
+  private:
+    NodeFilterImpl*   fImpl;
+};
+
+#endif
diff --git a/src/dom/DOM_NodeIterator.cpp b/src/dom/DOM_NodeIterator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..050e8356115e210643f18e49a26b9a09d7d65b19
--- /dev/null
+++ b/src/dom/DOM_NodeIterator.cpp
@@ -0,0 +1,191 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:01  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:20  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_NodeIterator.hpp"
+#include "NodeIteratorImpl.hpp"
+#include "RefCountedImpl.hpp"
+
+
+
+// Constants for whatToShow...
+
+const int DOM_NodeIterator::SHOW_ALL				= 0xFFFF;
+const int DOM_NodeIterator::SHOW_ELEMENT			= 0x00000001;
+const int DOM_NodeIterator::SHOW_ATTRIBUTE			= 0x00000002;
+const int DOM_NodeIterator::SHOW_TEXT				= 0x00000004;
+const int DOM_NodeIterator::SHOW_CDATA_SECTION			= 0x00000008;
+const int DOM_NodeIterator::SHOW_ENTITY_REFERENCE		= 0x00000010;
+const int DOM_NodeIterator::SHOW_ENTITY				= 0x00000020;
+const int DOM_NodeIterator::SHOW_PROCESSING_INSTRUCTION		= 0x00000040;
+const int DOM_NodeIterator::SHOW_COMMENT			= 0x00000080;
+const int DOM_NodeIterator::SHOW_DOCUMENT			= 0x00000100;
+const int DOM_NodeIterator::SHOW_DOCUMENT_TYPE			= 0x00000200;
+const int DOM_NodeIterator::SHOW_DOCUMENT_FRAGMENT		= 0x00000400;
+const int DOM_NodeIterator::SHOW_NOTATION			= 0x00000800;
+
+
+
+
+DOM_NodeIterator::DOM_NodeIterator()
+{
+    fImpl = 0;
+}
+
+
+DOM_NodeIterator::DOM_NodeIterator(NodeIteratorImpl *impl)
+{
+    fImpl = impl;
+    RefCountedImpl::addRef(fImpl);
+}
+
+
+DOM_NodeIterator::DOM_NodeIterator(const DOM_NodeIterator &other)
+{
+	  this->fImpl = other.fImpl;
+    RefCountedImpl::addRef(fImpl);
+}
+
+
+DOM_NodeIterator & DOM_NodeIterator::operator = (const DOM_NodeIterator &other)
+{
+    if (this->fImpl != other.fImpl)
+    {
+        RefCountedImpl::removeRef(this->fImpl);
+        this->fImpl = other.fImpl;
+        RefCountedImpl::addRef(this->fImpl);
+    }
+    return *this;
+};
+
+
+DOM_NodeIterator & DOM_NodeIterator::operator = (const DOM_NullPtr *other)
+{
+    RefCountedImpl::removeRef(this->fImpl);
+    this->fImpl = 0;
+    return *this;
+};
+
+
+
+DOM_NodeIterator::~DOM_NodeIterator()
+{
+    RefCountedImpl::removeRef (this->fImpl);
+    fImpl = 0;
+};
+
+//
+//      Comparison operators.  Equivalent of Java object reference ==
+//                                         Null references compare ==.
+//
+bool       DOM_NodeIterator::operator != (const DOM_NodeIterator & other) const
+{
+    return this->fImpl != other.fImpl;
+};
+
+
+bool       DOM_NodeIterator::operator == (const DOM_NodeIterator & other) const
+{
+    return this->fImpl == other.fImpl;
+};
+
+bool       DOM_NodeIterator::operator != (const DOM_NullPtr * other) const
+{
+    return this->fImpl != 0;
+};
+
+
+bool       DOM_NodeIterator::operator == (const DOM_NullPtr * other) const
+{
+    return this->fImpl == 0;
+}
+
+
+void DOM_NodeIterator::detach ()
+{
+	fImpl->detach();
+}
+
+
+
+int DOM_NodeIterator::getWhatToShow ()
+{
+	  return fImpl->getWhatToShow();
+}
+
+
+DOM_NodeFilter     DOM_NodeIterator::getFilter() {
+    return fImpl->getFilter();
+}
+
+
+DOM_Node            DOM_NodeIterator::nextNode() {
+    return fImpl->nextNode();
+}
+
+
+DOM_Node            DOM_NodeIterator::previousNode() {
+  return fImpl->previousNode();
+}
diff --git a/src/dom/DOM_NodeIterator.hpp b/src/dom/DOM_NodeIterator.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..669f02a9a9c474243f08a690692574f208fc28fa
--- /dev/null
+++ b/src/dom/DOM_NodeIterator.hpp
@@ -0,0 +1,116 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:01  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:20  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_NodeIterator_HEADER_GUARD_
+#define DOM_NodeIterator_HEADER_GUARD_
+
+#include "DOM_NodeFilter.hpp"
+#include "DOM_Node.hpp"
+
+class NodeIteratorImpl;
+
+class CDOM_EXPORT DOM_NodeIterator
+{
+	public:
+    // Constants for whatToShow...
+
+    static const int            SHOW_ALL;
+    static const int            SHOW_ELEMENT;
+    static const int            SHOW_ATTRIBUTE;
+    static const int            SHOW_TEXT;
+    static const int            SHOW_CDATA_SECTION;
+    static const int            SHOW_ENTITY_REFERENCE;
+    static const int            SHOW_ENTITY;
+    static const int            SHOW_PROCESSING_INSTRUCTION;
+    static const int            SHOW_COMMENT;
+    static const int            SHOW_DOCUMENT;
+    static const int            SHOW_DOCUMENT_TYPE;
+    static const int            SHOW_DOCUMENT_FRAGMENT;
+    static const int            SHOW_NOTATION;
+
+    DOM_NodeIterator ();
+    DOM_NodeIterator (NodeIteratorImpl* impl);
+    DOM_NodeIterator(const DOM_NodeIterator &other);
+    DOM_NodeIterator & operator = (const DOM_NodeIterator &other);
+    DOM_NodeIterator & operator = (const DOM_NullPtr *val);
+   ~DOM_NodeIterator();
+    bool operator == (const DOM_NodeIterator & other)const;
+    bool operator == (const DOM_NullPtr *other) const;
+    bool operator != (const DOM_NodeIterator & other) const;
+    bool operator != (const DOM_NullPtr * other) const;
+
+    virtual int                 getWhatToShow();
+
+    virtual DOM_NodeFilter      getFilter();
+    virtual DOM_Node            nextNode();
+    virtual DOM_Node            previousNode();
+	virtual void				detach();
+
+    private:
+      NodeIteratorImpl*                 fImpl;
+};
+
+#endif
diff --git a/src/dom/DOM_NodeList.cpp b/src/dom/DOM_NodeList.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..be14423a35f288a098b365861316b84f5619a9c7
--- /dev/null
+++ b/src/dom/DOM_NodeList.cpp
@@ -0,0 +1,154 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:01  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:20  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_NodeList.hpp"
+#include "NodeListImpl.hpp"
+#include "DOM_Node.hpp"
+#include <assert.h>
+
+DOM_NodeList::DOM_NodeList()
+{
+    fImpl = 0;
+};
+
+
+DOM_NodeList::DOM_NodeList(NodeListImpl *impl) 
+{
+    fImpl = impl;
+    RefCountedImpl::addRef(fImpl);
+};
+
+
+DOM_NodeList::DOM_NodeList(const DOM_NodeList &other)
+{
+    fImpl = other.fImpl;
+    RefCountedImpl::addRef(fImpl);
+};
+
+
+DOM_NodeList & DOM_NodeList::operator = (const DOM_NodeList &other)
+{
+    if (this->fImpl != other.fImpl)
+    {
+        RefCountedImpl::removeRef(this->fImpl);
+        this->fImpl = other.fImpl;
+        RefCountedImpl::addRef(this->fImpl);
+    }
+    return *this;
+};
+
+
+DOM_NodeList & DOM_NodeList::operator = (const DOM_NullPtr *other)
+{
+    RefCountedImpl::removeRef(this->fImpl);
+    this->fImpl = 0;
+    return *this;
+};
+
+
+DOM_NodeList::~DOM_NodeList() 
+{
+    RefCountedImpl::removeRef(this->fImpl);
+    fImpl = 0;
+};
+
+
+bool DOM_NodeList::operator == (const DOM_NodeList &other) const
+{
+    return this->fImpl == other.fImpl;
+};
+
+
+bool DOM_NodeList::operator != (const DOM_NodeList &other) const
+{
+    return this->fImpl != other.fImpl;
+};
+
+
+bool DOM_NodeList::operator == (const DOM_NullPtr *nullPtr) const
+{
+    return this->fImpl == 0;
+};
+
+
+bool DOM_NodeList::operator != (const DOM_NullPtr *nullPtr) const
+{
+    return this->fImpl != 0;
+};
+
+
+
+
+DOM_Node  DOM_NodeList::item(int index) const
+{
+    return DOM_Node(fImpl->item(index));
+};
+
+
+int       DOM_NodeList::getLength() const
+{
+    return fImpl->getLength();
+};
diff --git a/src/dom/DOM_NodeList.hpp b/src/dom/DOM_NodeList.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..553b76694bbceb17a5f6f4937522ab4946c2aff6
--- /dev/null
+++ b/src/dom/DOM_NodeList.hpp
@@ -0,0 +1,203 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:02  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:20  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_NodeList_HEADER_GUARD_
+#define DOM_NodeList_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class NodeListImpl;
+
+/**
+ * The <code>NodeList</code> interface provides the abstraction of an ordered 
+ * collection of nodes.  NodeLists are created by DOM_Document::getElementsByTagName(), 
+ * DOM_Node::getChildNodes(), 
+ *
+ * <p>The items in the <code>NodeList</code> are accessible via an integral 
+ * index, starting from 0. 
+ *
+ * NodeLists are "live", in that any changes to the document tree are immediately
+ * reflected in any NodeLists that may have been created for that tree.
+ */
+
+class  CDOM_EXPORT DOM_NodeList {
+private:
+    NodeListImpl *fImpl;
+
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_NodeList.  The resulting object does not
+      * refer to an actual NodeList; it will compare == to 0, and is similar
+      * to a null object reference variable in Java.  It may subsequently be
+      * assigned to refer to an actual NodeList.
+      *
+      */
+    DOM_NodeList();
+
+    /**
+      * Copy constructor.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_NodeList(const DOM_NodeList &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_NodeList & operator = (const DOM_NodeList &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_NodeList & operator = (const DOM_NullPtr *val);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_NodeList.  The object being destroyed is the reference
+      * object, not the underlying NodeList node itself.
+	  *
+      * <p>Like most other DOM types in this implementation, memory management
+      * of Node Lists is automatic.  Instances of DOM_NodeList function
+      * as references to an underlying heap based implementation object,
+      * and should never be explicitly new-ed or deleted in application code, but
+      * should appear only as local variables or function parameters.
+	  */
+    ~DOM_NodeList();
+    //@}
+
+    /** @name Comparison operators. */
+    //@{
+
+    /**
+      *  Equality operator.  Note that compares whether two node list
+      *  variables refer to the same underlying node list.  It does
+      *  not compare the contents of the node lists themselves.
+      */
+    bool operator == (const DOM_NodeList &other) const;
+
+     /**
+      *  Equality operator.  Note that compares whether two node list
+      *  variables refer to the same underlying node list.  It does
+      *  not compare the contents of the node lists themselves.
+      */
+    bool operator != (const DOM_NodeList &other) const;
+
+   bool operator == (const DOM_NullPtr *nullPtr) const;
+   bool operator != (const DOM_NullPtr *nullPtr) const; 
+    //@}
+
+
+    /** @name Get functions. */
+    //@{
+    /**
+     * Returns the <code>index</code>th item in the collection. 
+     *
+     * If <code>index</code> is greater than or equal to the number of nodes in 
+     * the list, this returns <code>null</code>.
+     *
+     * @param index Index into the collection.
+     * @return The node at the <code>index</code>th position in the 
+     *   <code>NodeList</code>, or <code>null</code> if that is not a valid 
+     *   index.
+     */
+    DOM_Node  item(int index) const;
+
+    /**
+     * Returns the number of nodes in the list. 
+     *
+     * The range of valid child node indices is 0 to <code>length-1</code> inclusive. 
+     */
+    int       getLength() const;
+    //@}
+
+private:
+    DOM_NodeList(NodeListImpl *impl);
+
+    friend class DOM_Document;
+    friend class DOM_Element;
+    friend class DOM_Node;
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_Notation.cpp b/src/dom/DOM_Notation.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6c2dadc9287522a0bd43a5665be474abd966e687
--- /dev/null
+++ b/src/dom/DOM_Notation.cpp
@@ -0,0 +1,129 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:02  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:21  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Notation.hpp"
+#include "NotationImpl.hpp"
+
+
+DOM_Notation::DOM_Notation()
+: DOM_Node(null)
+{
+};
+
+
+DOM_Notation::DOM_Notation(const DOM_Notation & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_Notation::DOM_Notation(NotationImpl *impl) :
+        DOM_Node(impl)
+{
+};
+
+
+DOM_Notation::~DOM_Notation() 
+{
+};
+
+
+DOM_Notation & DOM_Notation::operator = (const DOM_Notation & other)
+{
+     return (DOM_Notation &) DOM_Node::operator = (other);
+};
+
+
+DOM_Notation & DOM_Notation::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_Notation &) DOM_Node::operator = (other);
+};
+
+
+
+DOMString DOM_Notation::getPublicId() const
+{
+     return ((NotationImpl *)fImpl)->getPublicId();
+};
+
+
+DOMString  DOM_Notation::getSystemId() const
+{
+        return ((NotationImpl *)fImpl)->getSystemId();
+};
+
+
+
+void       DOM_Notation::setPublicId(const DOMString &id)
+{
+        ((NotationImpl *)fImpl)->setPublicId(id);
+};
+
+
+void       DOM_Notation::setSystemId(const DOMString &id)
+{
+        ((NotationImpl *)fImpl)->setSystemId(id);
+};
diff --git a/src/dom/DOM_Notation.hpp b/src/dom/DOM_Notation.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..51808b4085747d5cccaf8af53d7ee56e91ba4c65
--- /dev/null
+++ b/src/dom/DOM_Notation.hpp
@@ -0,0 +1,200 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:03  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:21  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_Notation_HEADER_GUARD_
+#define DOM_Notation_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class NotationImpl;
+
+/**
+ * This interface represents a notation declared in the DTD. A notation either 
+ * declares, by name, the format of an unparsed entity (see section 4.7 of 
+ * the XML 1.0 specification), or is used for formal declaration of 
+ * Processing Instruction targets (see section 2.6 of the XML 1.0 
+ * specification). The <code>nodeName</code> attribute inherited from 
+ * <code>Node</code> is set to the declared name of the notation.
+ * <p>The DOM Level 1 does not support editing <code>Notation</code> nodes; 
+ * they are therefore readonly.
+ * <p>A <code>Notation</code> node does not have any parent.
+ */
+class CDOM_EXPORT DOM_Notation: public DOM_Node {
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_Notation.  The resulting object does not
+    * refer to an actual Notation node; it will compare == to 0, and is similar
+    * to a null object reference variable in Java.  It may subsequently be
+    * assigned to refer to an actual Notation node.
+    * <p>
+    * New notation nodes are created by DOM_Document::createNotation().
+    *
+      *
+      */
+    DOM_Notation();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_Notation</code> that refers to the
+      * same underlying node as the original.  See also DOM_Node::clone(),
+      * which will copy the actual notation node, rather than just creating a new
+      * reference to the original node.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Notation(const DOM_Notation &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Notation & operator = (const DOM_Notation &other);
+
+     /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Notation & operator = (const DOM_NullPtr *val);
+
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_Notation.  The object being destroyed is the reference
+      * object, not the underlying Notation node itself.
+      * 
+	  */
+    ~DOM_Notation();
+
+    //@}
+    /** @name Get functions. */
+    //@{
+
+    /**
+     * Get the public identifier of this notation. 
+     * 
+     * If the  public identifier was not 
+     * specified, this is <code>null</code>.
+     * @return Returns the public identifier of the notation
+     */
+    DOMString        getPublicId() const;
+    /**
+     * Get the system identifier of this notation. 
+     *
+     * If the  system identifier was not 
+     * specified, this is <code>null</code>.
+     * @return Returns the system identifier of the notation
+     */
+    DOMString        getSystemId() const;
+
+
+    //@}
+    /** @name Set functions. */
+    //@{
+
+    /**
+     * Sets the public identifier of this notation. 
+     *
+     * This function is a non-standard IBM Extension.
+     * @param id The string containing the public id to be set
+     *
+     */
+    void             setPublicId(const DOMString &id);
+
+    /**
+     * Sets the system identifier of this notation. 
+     *
+     * This function is a non-standard IBM Extension.
+     * @param id The string containing the system id to be set
+     *
+     */
+    void             setSystemId(const DOMString &id);
+
+    //@}
+
+private:
+    DOM_Notation(NotationImpl *impl);
+
+    friend class DOM_Document;
+
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_ProcessingInstruction.cpp b/src/dom/DOM_ProcessingInstruction.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..945c0fc5b01f724f907d31b39e898091089e6f14
--- /dev/null
+++ b/src/dom/DOM_ProcessingInstruction.cpp
@@ -0,0 +1,129 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:03  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:21  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_ProcessingInstruction.hpp"
+#include "ProcessingInstructionImpl.hpp"
+
+
+
+
+DOM_ProcessingInstruction::DOM_ProcessingInstruction()
+: DOM_Node(null)
+{
+};
+
+
+DOM_ProcessingInstruction::DOM_ProcessingInstruction(
+                                               const DOM_ProcessingInstruction & other)
+: DOM_Node(other)
+{
+};
+
+        
+DOM_ProcessingInstruction::DOM_ProcessingInstruction(
+                                               ProcessingInstructionImpl *impl)
+:  DOM_Node(impl)
+{
+};
+
+
+DOM_ProcessingInstruction::~DOM_ProcessingInstruction() 
+{
+};
+
+
+DOM_ProcessingInstruction & DOM_ProcessingInstruction::operator = (
+                                        const DOM_ProcessingInstruction & other)
+{
+    return (DOM_ProcessingInstruction &) DOM_Node::operator = (other);
+};
+
+
+DOM_ProcessingInstruction & DOM_ProcessingInstruction::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_ProcessingInstruction &) DOM_Node::operator = (other);
+};
+
+
+
+DOMString DOM_ProcessingInstruction::getTarget() const
+{
+    return ((ProcessingInstructionImpl *)fImpl)->getTarget();
+};
+
+
+DOMString DOM_ProcessingInstruction::getData() const
+{
+    return ((ProcessingInstructionImpl *)fImpl)->getData();
+};
+
+
+void      DOM_ProcessingInstruction::setData(const DOMString &data)
+{
+    ((ProcessingInstructionImpl *)fImpl)->setData(data);
+};
+
+
diff --git a/src/dom/DOM_ProcessingInstruction.hpp b/src/dom/DOM_ProcessingInstruction.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..01e7e5474a6aa608286ea5b20fb3d8592d4cfe9e
--- /dev/null
+++ b/src/dom/DOM_ProcessingInstruction.hpp
@@ -0,0 +1,182 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:03  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:21  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_ProcessingInstruction_HEADER_GUARD_
+#define DOM_ProcessingInstruction_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_Node.hpp>
+
+class ProcessingInstructionImpl;
+
+/**
+ * The <code>ProcessingInstruction</code> interface represents a  "processing 
+ * instruction", used in XML as a way to keep processor-specific information 
+ * in the text of the document.
+ */
+class  CDOM_EXPORT DOM_ProcessingInstruction: public DOM_Node {
+public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_ProcessingInstruction.  The resulting object
+      *  does not refer to an actual PI node; it will compare == to 0, and is similar
+      * to a null object reference variable in Java.  It may subsequently be
+      * assigned to refer to an actual PI node.
+      * <p>
+      * New Processing Instruction nodes are created by DOM_Document::createProcessingInstruction().
+      *
+      *
+      */
+    DOM_ProcessingInstruction();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_ProcessingInstruction</code> that refers to the
+      * same underlying node as the original.  See also DOM_Node::clone(),
+      * which will copy the actual PI node, rather than just creating a new
+      * reference to the original node.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_ProcessingInstruction(const DOM_ProcessingInstruction &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_ProcessingInstruction & operator = (const DOM_ProcessingInstruction &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_ProcessingInstruction & operator = (const DOM_NullPtr *val);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_processingInstruction.  The object being destroyed is the reference
+      * object, not the underlying PI node itself.
+	  *
+	  */
+    ~DOM_ProcessingInstruction();
+
+    //@}
+    /** @name Get functions. */
+    //@{
+    /**
+     * The target of this processing instruction. 
+     *
+     * XML defines this as being the 
+     * first token following the markup that begins the processing instruction.
+     */
+    DOMString        getTarget() const;
+
+    /**
+     * The content of this processing instruction. 
+     *
+     * This is from the first non 
+     * white space character after the target to the character immediately 
+     * preceding the <code>?&gt;</code>.
+     * @exception DOMException
+     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
+     */
+    DOMString        getData() const;
+
+    //@}
+    /** @name Set functions. */
+    //@{
+    /**
+    * Sets the content of this processing instruction. 
+    *
+    * This is from the first non 
+    * white space character after the target to the character immediately 
+    * preceding the <code>?&gt;</code>.
+    * @param data The string containing the processing instruction
+    */
+    void             setData(const DOMString &data);
+    //@}
+
+private:
+    DOM_ProcessingInstruction(ProcessingInstructionImpl *impl);
+
+    friend class DOM_Document;
+
+};
+
+#endif
+
diff --git a/src/dom/DOM_Text.cpp b/src/dom/DOM_Text.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..82f0330cf430ba42a342fdad5b3d352e1622162a
--- /dev/null
+++ b/src/dom/DOM_Text.cpp
@@ -0,0 +1,110 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:04  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:22  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_Text.hpp"
+#include "TextImpl.hpp"
+
+
+
+DOM_Text::DOM_Text()
+: DOM_CharacterData(null)
+{
+};
+
+
+DOM_Text::DOM_Text(const DOM_Text & other)
+: DOM_CharacterData(other)
+{
+};
+
+        
+DOM_Text::DOM_Text(TextImpl *impl) :
+        DOM_CharacterData(impl)
+{
+};
+
+
+DOM_Text::~DOM_Text() 
+{
+};
+
+
+DOM_Text & DOM_Text::operator = (const DOM_Text & other)
+{
+    return (DOM_Text &) DOM_CharacterData::operator = (other);
+};
+
+
+DOM_Text & DOM_Text::operator = (const DOM_NullPtr *other)
+{
+    return (DOM_Text &) DOM_Node::operator = (other);
+};
+
+
+DOM_Text DOM_Text::splitText(int offset)
+{
+        return DOM_Text(((TextImpl *)fImpl)->splitText(offset));
+};
diff --git a/src/dom/DOM_Text.hpp b/src/dom/DOM_Text.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..31453723736edd7a08b5d4aa2921d1478935d0a8
--- /dev/null
+++ b/src/dom/DOM_Text.hpp
@@ -0,0 +1,186 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:04  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:22  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_Text_HEADER_GUARD_
+#define DOM_Text_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOM_CharacterData.hpp>
+
+class TextImpl;
+
+
+/**
+ * The <code>Text</code> interface represents the textual content (termed 
+ * character  data in XML) of an <code>Element</code> or <code>Attr</code>.  
+ * If there is no markup inside an element's content, the text is contained 
+ * in a single object implementing the <code>Text</code> interface that is 
+ * the only child of the element. If there is markup, it is parsed into a 
+ * list of elements and <code>Text</code> nodes that form the list of 
+ * children of the element.
+ * <p>When a document is first made available via the DOM, there is  only one 
+ * <code>Text</code> node for each block of text. Users may create  adjacent 
+ * <code>Text</code> nodes that represent the  contents of a given element 
+ * without any intervening markup, but should be aware that there is no way 
+ * to represent the separations between these nodes in XML, so they 
+ * will not (in general) persist between DOM editing sessions. The 
+ * <code>normalize()</code> method on <code>Element</code> merges any such 
+ * adjacent <code>Text</code> objects into a single node for each block of 
+ * text; this is  recommended before employing operations that depend on a 
+ * particular document structure, such as navigation with 
+ * <code>XPointers.</code> 
+ */
+class CDOM_EXPORT DOM_Text: public DOM_CharacterData {
+
+    public:
+    /** @name Constructors and assignment operator */
+    //@{
+    /**
+      * Default constructor for DOM_Text.  The resulting object does not
+      * refer to an actual Text node; it will compare == to 0, and is similar
+      * to a null object reference variable in Java.  It may subsequently be
+      * assigned to refer to an actual comment node.
+      *
+      */
+    DOM_Text();
+
+    /**
+      * Copy constructor.  Creates a new <code>DOM_Text</code> that refers to the
+      * same underlying node as the original.  See also DOM_Node::clone(),
+      * which will copy the actual Text node, rather than just creating a new
+      * reference to the original node.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Text(const DOM_Text &other);
+
+    /**
+      * Assignment operator.
+      *
+      * @param other The object to be copied.
+      */
+    DOM_Text & operator = (const DOM_Text &other);
+
+    /**
+      * Assignment operator.  This overloaded variant is provided for
+      *   the sole purpose of setting a DOM_Node reference variable to
+      *   zero.  Nulling out a reference variable in this way will decrement
+      *   the reference count on the underlying Node object that the variable
+      *   formerly referenced.  This effect is normally obtained when reference
+      *   variable goes out of scope, but zeroing them can be useful for
+      *   global instances, or for local instances that will remain in scope
+      *   for an extended time,  when the storage belonging to the underlying
+      *   node needs to be reclaimed.
+      *
+      * @param val.  Only a value of 0, or null, is allowed.
+      */
+    DOM_Text & operator = (const DOM_NullPtr *val);
+
+    //@}
+    /** @name Destructor. */
+    //@{
+	 /**
+	  * Destructor for DOM_Text. The object being destroyed is the reference
+      * object, not the underlying Comment node itself.
+	  *
+	  */
+    ~DOM_Text();
+
+    //@}
+    /** @name Functions to modify the Text node. */
+    //@{
+
+    /**
+     * Breaks this <code>Text</code> node into two Text nodes at the specified 
+     * offset, keeping both in the tree as siblings. 
+     *
+     * This node then only 
+     * contains all the content up to the <code>offset</code> point. And a new 
+     * <code>Text</code> node, which is inserted as the next sibling of  this 
+     * node, contains all the content at and after the <code>offset</code> 
+     * point.
+     * @param offset The offset at which to split, starting from 0.
+     * @return The new <code>Text</code> node.
+     * @exception DOMException
+     *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater 
+     *   than the number of characters in <code>data</code>.
+     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
+     */
+    DOM_Text splitText(int offset);
+    //@}
+
+protected:
+    DOM_Text(TextImpl *);
+
+    friend class DOM_Document;
+
+
+
+};
+
+#endif
+
+
diff --git a/src/dom/DOM_TreeWalker.cpp b/src/dom/DOM_TreeWalker.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..27c7543bfa566cde68bbf61acc434594d0078802
--- /dev/null
+++ b/src/dom/DOM_TreeWalker.cpp
@@ -0,0 +1,220 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:05  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:22  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_TreeWalker.hpp"
+#include "RefCountedImpl.hpp"
+#include "TreeWalkerImpl.hpp"
+
+
+const int DOM_TreeWalker::SHOW_ALL             = 0x0000FFFF;
+const int DOM_TreeWalker::SHOW_ELEMENT         = 0x00000001;
+const int DOM_TreeWalker::SHOW_ATTRIBUTE       = 0x00000002;
+const int DOM_TreeWalker::SHOW_TEXT            = 0x00000004;
+const int DOM_TreeWalker::SHOW_CDATA_SECTION   = 0x00000008;
+const int DOM_TreeWalker::SHOW_ENTITY_REFERENCE = 0x00000010;
+const int DOM_TreeWalker::SHOW_ENTITY          = 0x00000020;
+const int DOM_TreeWalker::SHOW_PROCESSING_INSTRUCTION = 0x00000040;
+const int DOM_TreeWalker::SHOW_COMMENT         = 0x00000080;
+const int DOM_TreeWalker::SHOW_DOCUMENT        = 0x00000100;
+const int DOM_TreeWalker::SHOW_DOCUMENT_TYPE   = 0x00000200;
+const int DOM_TreeWalker::SHOW_DOCUMENT_FRAGMENT = 0x00000400;
+const int DOM_TreeWalker::SHOW_NOTATION        = 0x00000800;
+
+
+
+DOM_TreeWalker::DOM_TreeWalker()
+{
+    fImpl = 0;
+}
+
+
+DOM_TreeWalker::DOM_TreeWalker(TreeWalkerImpl *impl)
+{
+    fImpl = impl;
+    RefCountedImpl::addRef(fImpl);
+}
+
+
+DOM_TreeWalker::DOM_TreeWalker(const DOM_TreeWalker &other)
+{
+	this->fImpl = other.fImpl;
+    RefCountedImpl::addRef(fImpl);
+}
+
+
+DOM_TreeWalker & DOM_TreeWalker::operator = (const DOM_TreeWalker &other)
+{
+    if (this->fImpl != other.fImpl)
+    {
+        RefCountedImpl::removeRef(this->fImpl);
+        this->fImpl = other.fImpl;
+        RefCountedImpl::addRef(this->fImpl);
+    }
+    return *this;
+};
+
+
+DOM_TreeWalker & DOM_TreeWalker::operator = (const DOM_NullPtr *other)
+{
+    RefCountedImpl::removeRef(this->fImpl);
+    this->fImpl = 0;
+    return *this;
+};
+
+
+
+DOM_TreeWalker::~DOM_TreeWalker()
+{
+    RefCountedImpl::removeRef (this->fImpl);
+    fImpl = 0;
+};
+
+//
+//      Comparison operators.  Equivalent of Java object reference ==
+//                                         Null references compare ==.
+//
+bool       DOM_TreeWalker::operator != (const DOM_TreeWalker & other) const
+{
+    return this->fImpl != other.fImpl;
+};
+
+
+bool       DOM_TreeWalker::operator == (const DOM_TreeWalker & other) const
+{
+    return this->fImpl == other.fImpl;
+};
+
+bool       DOM_TreeWalker::operator != (const DOM_NullPtr * other) const
+{
+    return this->fImpl != 0;
+};
+
+
+bool       DOM_TreeWalker::operator == (const DOM_NullPtr * other) const
+{
+    return this->fImpl == 0;
+};
+
+
+
+int											DOM_TreeWalker::getWhatToShow() {
+    return fImpl->getWhatToShow();
+}
+
+
+DOM_NodeFilter					DOM_TreeWalker::getFilter() {
+    return fImpl->getFilter();
+}
+
+
+DOM_Node								DOM_TreeWalker::getCurrentNode() {
+    return fImpl->getCurrentNode();
+}
+
+
+void										DOM_TreeWalker::setCurrentNode(DOM_Node currentNode) {
+    fImpl->setCurrentNode(currentNode);
+}
+
+
+DOM_Node								DOM_TreeWalker::parentNode() {
+    return fImpl->parentNode();
+}
+
+
+DOM_Node								DOM_TreeWalker::firstChild() {
+    return fImpl->firstChild();
+}
+
+
+DOM_Node								DOM_TreeWalker::lastChild() {
+    return fImpl->lastChild();
+}
+
+
+DOM_Node								DOM_TreeWalker::previousSibling() {
+    return fImpl->previousSibling();
+}
+
+
+DOM_Node								DOM_TreeWalker::nextSibling() {
+    return fImpl->nextSibling();
+}
+
+
+DOM_Node								DOM_TreeWalker::previousNode() {
+    return fImpl->previousNode();
+}
+
+
+DOM_Node								DOM_TreeWalker::nextNode() {
+    return fImpl->nextNode();
+}
+
+
+void DOM_TreeWalker::detach () {	
+	fImpl->detach();
+}
diff --git a/src/dom/DOM_TreeWalker.hpp b/src/dom/DOM_TreeWalker.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..33e4a865bbab5b842f734576a709eeecc1a5aa6b
--- /dev/null
+++ b/src/dom/DOM_TreeWalker.hpp
@@ -0,0 +1,124 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:05  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:22  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef DOM_TreeWalker_HEADER_GUARD_
+#define DOM_TreeWalker_HEADER_GUARD_
+
+#include "DOM_Node.hpp"
+#include "DOM_NodeFilter.hpp"
+
+class TreeWalkerImpl;
+
+
+class CDOM_EXPORT DOM_TreeWalker {
+
+    public:
+			// Constants for whatToShow
+			static const int             SHOW_ALL;
+			static const int             SHOW_ELEMENT;
+			static const int             SHOW_ATTRIBUTE;
+			static const int             SHOW_TEXT;
+			static const int             SHOW_CDATA_SECTION;
+			static const int             SHOW_ENTITY_REFERENCE;
+			static const int             SHOW_ENTITY;
+			static const int             SHOW_PROCESSING_INSTRUCTION;
+			static const int             SHOW_COMMENT;
+			static const int             SHOW_DOCUMENT;
+			static const int             SHOW_DOCUMENT_TYPE;
+			static const int             SHOW_DOCUMENT_FRAGMENT;
+			static const int             SHOW_NOTATION;
+
+      DOM_TreeWalker ();
+      DOM_TreeWalker (TreeWalkerImpl* impl);
+      DOM_TreeWalker(const DOM_TreeWalker &other);
+      DOM_TreeWalker & operator = (const DOM_TreeWalker &other);
+      DOM_TreeWalker & operator = (const DOM_NullPtr *val);
+     ~DOM_TreeWalker();
+      bool operator == (const DOM_TreeWalker & other)const;
+      bool operator == (const DOM_NullPtr *other) const;
+      bool operator != (const DOM_TreeWalker & other) const;
+      bool operator != (const DOM_NullPtr * other) const;
+
+			virtual int								getWhatToShow();
+			virtual DOM_NodeFilter					getFilter();
+			virtual DOM_Node						getCurrentNode();
+			virtual void							setCurrentNode(DOM_Node currentNode);
+			virtual DOM_Node						parentNode();
+			virtual DOM_Node						firstChild();
+			virtual DOM_Node						lastChild();
+			virtual DOM_Node						previousSibling();
+			virtual DOM_Node						nextSibling();
+			virtual DOM_Node						previousNode();
+			virtual DOM_Node						nextNode();
+
+			virtual void							detach();
+
+    private:
+      TreeWalkerImpl*                 fImpl;
+};
+
+
+#endif
diff --git a/src/dom/DStringPool.cpp b/src/dom/DStringPool.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..76f5cc35c23ea9a690ccef993aa71c92515025e9
--- /dev/null
+++ b/src/dom/DStringPool.cpp
@@ -0,0 +1,189 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:05  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:23  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+// file DStringPool.cpp
+//
+
+#include "DStringPool.hpp"
+#include <util/XMLString.hpp>
+#include <util/PlatformUtils.hpp>
+
+//
+//  DStringPoolEntry - one of these structs is allocated for each
+//                      DOMString in the pool.  Each slot in the
+//                      hash table array itself is a pointer to the head
+//                      of a singly-linked list of these structs.
+//
+struct DStringPoolEntry
+{
+    DStringPoolEntry    *fNext;
+    DOMString           fString;
+};
+
+
+
+DStringPool::DStringPool(int hashTableSize)
+{
+    fHashTableSize = hashTableSize;
+    fHashTable = new DStringPoolEntry *[hashTableSize];
+    for (int i=0; i<fHashTableSize; i++)
+        fHashTable[i] = 0;
+};
+
+
+//  Destructor.   Iterate through the pool, deleting each of the 
+//                DSTringPoolEntry structs, then delete the hash
+//                array itself.
+//
+DStringPool::~DStringPool()
+{
+    for (int slot=0; slot<fHashTableSize; slot++)
+    {
+        DStringPoolEntry    *spe;
+        DStringPoolEntry    *nextSPE;
+        for (spe=fHashTable[slot]; spe != 0; spe = nextSPE )
+        {
+            // spe->string = 0;
+            nextSPE = spe->fNext;
+            delete spe;    // Note that this will invoke the destructor
+                           //   on spe->fString.
+        }
+    }
+    delete fHashTable;
+    fHashTable = 0;
+};
+
+
+const DOMString &DStringPool::getPooledString(const XMLCh *in)
+{
+    DStringPoolEntry    **pspe;
+    DStringPoolEntry    *spe;
+
+    int    inHash     = XMLString::hash(in, fHashTableSize);
+    pspe = &fHashTable[inHash];
+    while (*pspe != 0)
+    {
+        if ((*pspe)->fString.equals(in))
+            return (*pspe)->fString;
+        pspe = &((*pspe)->fNext);
+    }
+    *pspe = spe = new DStringPoolEntry;
+    spe->fNext = 0;
+    spe->fString = DOMString(in);
+    return spe->fString;
+};
+
+
+const DOMString &DStringPool::getPooledString(const DOMString &in)
+{
+    DStringPoolEntry    **pspe;
+    DStringPoolEntry    *spe;
+
+    XMLCh *inCharData = in.rawBuffer();
+    int    inLength   = in.length();
+    int    inHash     = XMLString::hashN(inCharData, inLength, fHashTableSize);
+
+    pspe = &fHashTable[inHash];
+    while (*pspe != 0)
+    {
+        if ((*pspe)->fString.equals(in))
+            return (*pspe)->fString;
+        pspe = &((*pspe)->fNext);
+    }
+    *pspe = spe = new DStringPoolEntry;
+    spe->fNext = 0;
+    spe->fString = DOMString(in);
+    return spe->fString;
+};
+
+
+
+//
+//  getLiteralString
+//
+//     This is a static function that is somewhat separate from the rest
+//      of the string pool.  It is used to manage the one-time creation of 
+//      static strings that are reused freqently within the DOM implementation.
+//      This is primarily things like the default names for the various
+//      node types ("#text" and the like).
+//
+const DOMString &DStringPool::getStaticString(const char *in, DOMString **loc)
+{
+    if (*loc == 0)
+    {
+        DOMString *t = new DOMString(in);   // This is one of the very few
+                                            //   places that a DOMString variable
+                                            //   is heap allocated.  Normal usage
+                                            //   is to create local instances and
+                                            //   pass them around by value.
+        if (XMLPlatformUtils::compareAndSwap((void **)loc, t, 0) != 0)
+            delete t;
+    }
+    return **loc;
+}
+
+
diff --git a/src/dom/DStringPool.hpp b/src/dom/DStringPool.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..409efaf57119d2014de480b353ee26d5052c327b
--- /dev/null
+++ b/src/dom/DStringPool.hpp
@@ -0,0 +1,107 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+
+//
+// file DStringPool.hpp
+//
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#ifndef DStringPool_HEADER_GUARD_
+#define DStringPool_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include <dom/DOMString.hpp>
+
+struct DStringPoolEntry;
+
+//
+// DStringPool is a hash table of DOMStrings.
+//  Each DOM Document maintains a DStringPool containing a DOMString
+//  for each Element tag name and Attribute Name that has been added
+//  to the document.  When creating additional elements or attributes,
+//  if the name has been seen before, the already existing string
+//  will be reused.
+//
+class DStringPool
+{
+public:
+    DStringPool(int  hashTableSize);  
+    ~DStringPool();
+
+    const DOMString &getPooledString(const DOMString &in);
+    const DOMString &getPooledString(const XMLCh *in);
+
+    static const DOMString &getStaticString(const char *in, DOMString **loc);
+
+
+private:
+    DStringPool(const DStringPool &other);      // Copy constructor and assignment
+    void operator = (const DStringPool &other); //  of DStringPool are not supported.
+
+    DStringPoolEntry **fHashTable;
+    int              fHashTableSize;
+};
+
+#endif
diff --git a/src/dom/DeepNodeListImpl.cpp b/src/dom/DeepNodeListImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8a9712bd8b1b992ea82843eb8a28266f25342f6f
--- /dev/null
+++ b/src/dom/DeepNodeListImpl.cpp
@@ -0,0 +1,225 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:42  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:23  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DeepNodeListImpl.hpp"
+#include "NodeVector.hpp"
+#include "NodeImpl.hpp"
+#include "ElementImpl.hpp"
+#include "DStringPool.hpp"
+#include <limits.h>
+
+static DOMString *kAstr;
+
+DeepNodeListImpl::DeepNodeListImpl(NodeImpl *rootNod, const DOMString &tagNam)
+{
+    changes = 0;
+    this->rootNode = rootNod;
+    this->tagName = tagNam;
+    nodes=new NodeVector();
+    matchAll = tagName.equals(DStringPool::getStaticString("*", &kAstr));
+    this->namespaceURI = null;	//DOM Level 2
+    this->matchAllURI = false;	//DOM Level 2
+};
+
+
+//DOM Level 2
+DeepNodeListImpl::DeepNodeListImpl(NodeImpl *rootNod,
+    const DOMString &namespaceURI, const DOMString &localName)
+{
+    changes = 0;
+    this->rootNode = rootNod;
+    this->tagName = localName;
+    nodes=new NodeVector();
+    matchAll = tagName.equals(DStringPool::getStaticString("*", &kAstr));
+    this->namespaceURI = namespaceURI;
+    this->matchAllURI = namespaceURI.equals(DStringPool::getStaticString("*", &kAstr));
+};
+
+
+DeepNodeListImpl::~DeepNodeListImpl()
+{
+    delete nodes;
+};
+
+
+int DeepNodeListImpl::getLength()
+{
+    // Preload all matching elements. (Stops when we run out of subtree!)
+    item(INT_MAX);
+    return nodes->size();
+};
+
+
+
+// Start from the first child and count forward, 0-based. index>length-1
+// should return null.
+//
+// Attempts to do only work actually requested, cache work already
+// done, and to flush that cache when the tree has changed.
+//
+// LIMITATION: ????? Unable to tell relevant tree-changes from
+// irrelevant ones.  Doing so in a really useful manner would seem
+// to involve a tree-walk in its own right, or maintaining our data
+// in a parallel tree.
+NodeImpl *DeepNodeListImpl::item(int index)
+{
+    NodeImpl *thisNode;
+    
+    if(rootNode->changes != changes)
+    {
+        nodes->reset();     // Tree changed. Do it all from scratch!
+        changes=rootNode->changes;
+    }
+    
+    if(index<nodes->size())      // In the cache
+        return nodes->elementAt(index);
+    else                        // Not yet seen
+    {
+        if(nodes->size()==0)     // Pick up where we left off
+            thisNode=rootNode; // (Which may be the beginning)
+        else
+            thisNode=nodes->lastElement();
+
+        while(thisNode!=null && index>=nodes->size() && thisNode!=null)
+        {
+            thisNode=nextMatchingElementAfter(thisNode);
+            if(thisNode!=null)
+                nodes->addElement(thisNode);
+        }
+        return thisNode;           // Either what we want, or null (not avail.)
+    }
+};
+
+
+
+/* Iterative tree-walker. When you have a Parent link, there's often no
+need to resort to recursion. NOTE THAT only Element nodes are matched
+since we're specifically supporting getElementsByTagName().
+*/
+
+NodeImpl *DeepNodeListImpl::nextMatchingElementAfter(NodeImpl *current)
+{
+    NodeImpl *next;
+    while (current != null)
+    {
+        // Look down to first child.
+        if (current->hasChildNodes())
+        {
+            current = current->getFirstChild();
+        }
+        // Look right to sibling (but not from root!)
+        else
+        {
+            if (current != rootNode && null != (next = current->getNextSibling()))
+            {
+                current = next;
+            }
+            // Look up and right (but not past root!)
+            else
+            {
+                next = null;
+                for (; current != rootNode; // Stop when we return to starting point
+                current = current->getParentNode())
+                {
+                    next = current->getNextSibling();
+                    if (next != null)
+                        break;
+                }
+                current = next;
+            }
+        }
+        
+        // Have we found an Element with the right tagName?
+        // ("*" matches anything.)
+        if (current != null && current != rootNode && current->isElementImpl()) {
+	    if (namespaceURI == null) {	//DOM Level 1
+		if (matchAll || ((ElementImpl *)current)->getTagName().equals(tagName))
+		    return current;
+	    } else {	//DOM Level 2
+		if (!matchAllURI && !(current -> getNamespaceURI().equals(namespaceURI)))
+		    continue;
+		if (matchAll || current -> getLocalName().equals(tagName))
+		    return current;
+	    }
+	}
+        
+        // Otherwise continue walking the tree
+    }
+    // Fell out of tree-walk; no more instances found
+    return null;
+};
+
+
+//
+//  unreferenced()      The RefCountedImpl base class calls back to this function
+//                      when the ref count goes to zero.
+//
+//          
+void DeepNodeListImpl::unreferenced()
+{
+    delete this;
+};
+
diff --git a/src/dom/DeepNodeListImpl.hpp b/src/dom/DeepNodeListImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..6d03bd7f5936b9316430e0ce12f55635b13fc90f
--- /dev/null
+++ b/src/dom/DeepNodeListImpl.hpp
@@ -0,0 +1,112 @@
+#ifndef DeepNodeListImpl_HEADER_GUARD_
+#define DeepNodeListImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:42  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:23  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeListImpl.hpp"
+#include "DOMString.hpp"
+#include "NodeImpl.hpp"
+
+class NodeImpl;
+class NodeVector;
+
+
+class  DeepNodeListImpl: public NodeListImpl {
+private:
+    NodeImpl            *rootNode;    
+    DOMString           tagName;      
+    bool                matchAll;
+    int                 changes;
+    NodeVector          *nodes;
+
+    //DOM Level 2
+    DOMString		namespaceURI;
+    bool		matchAllURI;
+    
+public:
+                        DeepNodeListImpl(NodeImpl *rootNode, const DOMString &tagName);
+                        DeepNodeListImpl(NodeImpl *rootNode,	//DOM Level 2
+			    const DOMString &namespaceURI, const DOMString &localName);
+    virtual             ~DeepNodeListImpl();
+    virtual int         getLength();
+    virtual NodeImpl    *item(int index);
+private:
+    virtual NodeImpl    *nextMatchingElementAfter(NodeImpl *current);
+    virtual void        unreferenced();
+};
+
+#endif
diff --git a/src/dom/DocumentFragmentImpl.cpp b/src/dom/DocumentFragmentImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1fb16b20f9016f10e78a30081cfcecad6114b3bd
--- /dev/null
+++ b/src/dom/DocumentFragmentImpl.cpp
@@ -0,0 +1,111 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:43  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:23  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DocumentFragmentImpl.hpp"
+#include "NodeImpl.hpp"
+#include "DOM_Node.hpp"
+#include "DOM_DOMException.hpp"
+#include "DStringPool.hpp"
+
+
+static DOMString *nam;   // Will be lazily initialized to "#document-fragment"
+
+DocumentFragmentImpl::DocumentFragmentImpl(DocumentImpl *masterDoc) :
+NodeImpl(masterDoc, DStringPool::getStaticString("#document-fragment", &nam),
+         DOM_Node::DOCUMENT_FRAGMENT_NODE,false,null)
+{
+};
+        
+
+DocumentFragmentImpl::DocumentFragmentImpl(const DocumentFragmentImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+};
+
+
+
+DocumentFragmentImpl::~DocumentFragmentImpl()
+{
+};
+
+
+        
+NodeImpl *DocumentFragmentImpl::cloneNode(bool deep)
+{
+    return new DocumentFragmentImpl(*this, deep);
+};
+
+
+bool DocumentFragmentImpl::isDocumentFragmentImpl()
+{
+        return true;
+};
+
+
+void DocumentFragmentImpl::setNodeValue(const DOMString &x)
+{
+        throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+};
diff --git a/src/dom/DocumentFragmentImpl.hpp b/src/dom/DocumentFragmentImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..6eab311bbacdb37b15ed2306316ee51743e0e12a
--- /dev/null
+++ b/src/dom/DocumentFragmentImpl.hpp
@@ -0,0 +1,95 @@
+#ifndef DocumentFragmentImpl_HEADER_GUARD_
+#define DocumentFragmentImpl_HEADER_GUARD_
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:43  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:24  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+
+class DocumentFragmentImpl: public NodeImpl {
+private:
+    DocumentFragmentImpl(DocumentImpl *);
+    DocumentFragmentImpl(const DocumentFragmentImpl &other, bool deep);
+    friend class DocumentImpl;
+    
+public:
+    virtual ~DocumentFragmentImpl();
+    virtual NodeImpl *cloneNode(bool deep);
+    virtual bool isDocumentFragmentImpl();
+    virtual void setNodeValue(const DOMString &);
+};
+
+#endif
+
diff --git a/src/dom/DocumentImpl.cpp b/src/dom/DocumentImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..162a54b550dd0af2b1ee4a8fedbe036fd0a11686
--- /dev/null
+++ b/src/dom/DocumentImpl.cpp
@@ -0,0 +1,579 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:43  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:44:24  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+// file DocumentImpl.cpp
+//
+
+#include "DocumentImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DOM_Node.hpp"
+
+#include "DocumentTypeImpl.hpp"
+#include "ElementImpl.hpp"
+#include "AttrImpl.hpp"
+#include "CDATASectionImpl.hpp"
+#include "CommentImpl.hpp"
+#include "DocumentFragmentImpl.hpp"
+#include "EntityImpl.hpp"
+#include "EntityReferenceImpl.hpp"
+#include "NotationImpl.hpp"
+#include "ProcessingInstructionImpl.hpp"
+#include "TextImpl.hpp"
+#include "DOM_DOMImplementation.hpp"
+#include "DeepNodeListImpl.hpp"
+#include "NamedNodeMapImpl.hpp"
+#include "DStringPool.hpp"
+#include <internal/XMLReader.hpp>
+#include "TreeWalkerImpl.hpp"
+#include "NodeIteratorImpl.hpp"
+#include "DOM_Document.hpp"
+
+static DOMString *nam = 0;  // Will be lazily initialized to "#document"
+
+DocumentImpl::DocumentImpl(): NodeImpl(null,
+                                       DStringPool::getStaticString("#document", &nam),
+                                       DOM_Node::DOCUMENT_NODE,
+                                       false,
+                                       null)
+{
+    docType=null;
+    docElement=null;
+    namePool = new DStringPool(257);
+    iterators = 0L;
+    treeWalkers = 0L;
+};
+
+
+//DOM Level 2
+DocumentImpl::DocumentImpl(const DOMString &namespaceURI,
+	const DOMString &qualifiedName, DocumentTypeImpl *doctype)
+: NodeImpl(null, namespaceURI, qualifiedName, DOM_Node::DOCUMENT_NODE, false, null)
+{
+    if (doctype != null && doctype->getOwnerDocument() != null)
+        throw new DOM_DOMException(
+	    DOM_DOMException::WRONG_DOCUMENT_ERR, null);
+    docType=doctype;
+    if (doctype != null)
+	doctype -> setOwnerDocument(this);
+    docElement=null;
+    namePool = new DStringPool(257);
+}
+
+
+DocumentImpl::~DocumentImpl()
+{
+    if (iterators != 0L) {
+        // The data in the vector is pointers owned by smart pointers, and will be cleaned up when they go away.
+        delete iterators;
+    }
+
+    if (treeWalkers != 0L) {
+        // The data in the vector is pointers owned by smart pointers, and will be cleaned up when they go away.
+        delete treeWalkers;
+    }
+
+    delete namePool;
+    // Do not delete docType and docElement pointers here.
+    //  These are also normal child nodes of the document,
+    //  and refcounting will take them out in the usual way.
+};
+
+
+NodeImpl *DocumentImpl::cloneNode(bool deep) {
+    DocumentImpl *newdoc=new DocumentImpl();
+    if (deep)
+        for(NodeImpl *n=getFirstChild();n!=null;n=n->getNextSibling())
+            newdoc->appendChild(newdoc->importNode(n,true));
+        return newdoc;
+};
+
+bool DocumentImpl::isDocumentImpl() {
+    return true;
+};
+
+
+AttrImpl *DocumentImpl::createAttribute(const DOMString &nam)
+{
+    if(!isXMLName(nam))
+        throw new DOM_DOMException(DOM_DOMException::INVALID_CHARACTER_ERR,null);
+    return new AttrImpl(this,nam);
+};
+
+
+
+CDATASectionImpl *DocumentImpl::createCDATASection(const DOMString &data) {
+    return new CDATASectionImpl(this,data);
+};
+
+
+
+CommentImpl *DocumentImpl::createComment(const DOMString &data)
+{
+    return new CommentImpl(this,data);
+};
+
+
+
+DocumentFragmentImpl *DocumentImpl::createDocumentFragment()
+{
+    return new DocumentFragmentImpl(this);
+};
+
+
+
+DocumentTypeImpl *DocumentImpl::createDocumentType(const DOMString &nam)
+{
+    if (!isXMLName(nam))
+        throw new DOM_DOMException(
+        DOM_DOMException::INVALID_CHARACTER_ERR, null);
+
+    return new DocumentTypeImpl(this, nam);
+};
+
+
+
+ElementImpl *DocumentImpl::createElement(const DOMString &tagName)
+{
+    if(!isXMLName(tagName))
+        throw new DOM_DOMException(DOM_DOMException::INVALID_CHARACTER_ERR,null);
+    DOMString pooledTagName = this->namePool->getPooledString(tagName);
+    return new ElementImpl(this,pooledTagName);
+};
+
+
+ElementImpl *DocumentImpl::createElement(const XMLCh *tagName)
+{
+    DOMString pooledTagName = this->namePool->getPooledString(tagName);
+    return new ElementImpl(this,pooledTagName);
+};
+
+
+
+
+EntityImpl *DocumentImpl::createEntity(const DOMString &nam)
+{
+    if (!isXMLName(nam))
+        throw new DOM_DOMException(
+        DOM_DOMException::INVALID_CHARACTER_ERR, null);
+
+    return new EntityImpl(this, nam);
+};
+
+
+
+EntityReferenceImpl *DocumentImpl::createEntityReference(const DOMString &nam)
+{
+    if (!isXMLName(nam))
+        throw new DOM_DOMException(
+        DOM_DOMException::INVALID_CHARACTER_ERR, null);
+
+    return new EntityReferenceImpl(this, nam);
+};
+
+
+
+NotationImpl *DocumentImpl::createNotation(const DOMString &nam)
+{
+    if (!isXMLName(nam))
+        throw new DOM_DOMException(
+        DOM_DOMException::INVALID_CHARACTER_ERR, null);
+
+    return new NotationImpl(this, nam);
+};
+
+
+
+ProcessingInstructionImpl *DocumentImpl::createProcessingInstruction(
+                                          const DOMString &target, const DOMString &data)
+{
+    if(!isXMLName(target))
+        throw new DOM_DOMException(DOM_DOMException::INVALID_CHARACTER_ERR,null);
+    return new ProcessingInstructionImpl(this,target,data);
+};
+
+
+
+
+TextImpl *DocumentImpl::createTextNode(const DOMString &data)
+{
+    return new TextImpl(this,data);
+};
+
+
+NodeIteratorImpl* DocumentImpl::createNodeIterator (DOM_Node root, short whatToShow, DOM_NodeFilter filter, NodeFilterImpl* fi)
+{
+		// Create the node iterator implementation object.
+		//	Add it to the vector of iterators that must be synchronized when a node is deleted.
+		//	The vector of iterators is kept in the "owner document" if there is one. If there isn't one, I assume that root is the
+		//	owner document.
+
+    NodeIteratorImpl* iter = new NodeIteratorImpl(root, whatToShow, filter, fi);
+    DOM_Document doc = root.getOwnerDocument();
+    DocumentImpl* impl;
+
+    if (! doc.isNull()) {
+        impl = (DocumentImpl *) doc.fImpl;
+    }
+    else
+        impl = (DocumentImpl *) root.fImpl;
+
+    if (impl->iterators == 0L) {
+        impl->iterators = new NodeIterators(1, false);
+        impl->iterators->addElement(iter);
+    }
+
+    return iter;
+}
+
+
+TreeWalkerImpl* DocumentImpl::createTreeWalker (DOM_Node root, short whatToShow, DOM_NodeFilter filter, NodeFilterImpl* fi)
+{
+		// See notes for createNodeIterator...
+
+    TreeWalkerImpl* twi = new TreeWalkerImpl(root, whatToShow, filter, fi);
+    DOM_Document doc = root.getOwnerDocument();
+    DocumentImpl* impl;
+
+    if (! doc.isNull()) {
+        impl = (DocumentImpl *) doc.fImpl;
+    }
+    else
+        impl = (DocumentImpl *) root.fImpl;
+
+    if (impl->treeWalkers == 0L) {
+        impl->treeWalkers = new TreeWalkers(1, false);
+        impl->treeWalkers->addElement(twi);
+    }
+
+    return twi;
+}
+
+
+
+
+DocumentTypeImpl *DocumentImpl::getDoctype()
+{
+    return docType;
+};
+
+
+
+ElementImpl *DocumentImpl::getDocumentElement()
+{
+    return docElement;
+};
+
+
+
+DeepNodeListImpl *DocumentImpl::getElementsByTagName(const DOMString &tagname)
+{
+    return new DeepNodeListImpl(this,tagname);
+};
+
+
+
+
+NodeImpl *DocumentImpl::importNode(NodeImpl *source, bool deep)
+{
+    NodeImpl *newnode=null;
+
+    switch (source->getNodeType())
+    {
+    case DOM_Node::ELEMENT_NODE :
+        {
+            ElementImpl *newelement = createElement(source->getNodeName());
+            NamedNodeMapImpl *srcattr=source->getAttributes();
+            if(srcattr!=null)
+                for(int i=0;i<srcattr->getLength();++i)
+                    newelement->setAttributeNode(
+                    (AttrImpl *)importNode(srcattr->item(i),true));
+                newnode=newelement;
+        }
+        break;
+    case DOM_Node::ATTRIBUTE_NODE :
+        newnode = createAttribute(source->getNodeName());
+        // Kids carry value
+        break;
+    case DOM_Node::TEXT_NODE :
+        newnode = createTextNode(source->getNodeValue());
+        break;
+    case DOM_Node::CDATA_SECTION_NODE :
+        newnode = createCDATASection(source->getNodeValue());
+        break;
+    case DOM_Node::ENTITY_REFERENCE_NODE :
+        newnode = createEntityReference(source->getNodeName());
+        deep=false; // ????? Right Thing?
+        // Value implied by doctype, so we should not copy it
+        // -- instead, refer to local doctype, if any.
+        break;
+    case DOM_Node::ENTITY_NODE :
+        {
+            EntityImpl *srcentity=(EntityImpl *)source;
+            EntityImpl *newentity = createEntity(source->getNodeName());
+            newentity->setPublicId(srcentity->getPublicId());
+            newentity->setSystemId(srcentity->getSystemId());
+            newentity->setNotationName(srcentity->getNotationName());
+            // Kids carry additional value
+            newnode=newentity;
+        }
+        break;
+    case DOM_Node::PROCESSING_INSTRUCTION_NODE :
+        newnode = createProcessingInstruction(source->getNodeName(), source->getNodeValue());
+        break;
+    case DOM_Node::COMMENT_NODE :
+        newnode = createComment(source->getNodeValue());
+        break;
+    case DOM_Node::DOCUMENT_TYPE_NODE :
+        {
+            DocumentTypeImpl *srcdoctype = (DocumentTypeImpl *)source;
+            DocumentTypeImpl *newdoctype = createDocumentType(source->getNodeName());
+            // Values are on NamedNodeMaps
+            NamedNodeMapImpl *smap=srcdoctype->getEntities();
+            NamedNodeMapImpl *tmap=newdoctype->getEntities();
+            if(smap!=null)
+                for(int i=0;i<smap->getLength();++i)
+                    tmap->setNamedItem(importNode(smap->item(i),true));
+                smap=srcdoctype->getNotations();
+                tmap=newdoctype->getNotations();
+                if(smap!=null)
+                    for(int i=0;i<smap->getLength();++i)
+                        tmap->setNamedItem(
+                        importNode(smap->item(i),true));
+                    // NOTE: At this time, the DOM definition of DocumentType
+                    // doesn't cover Elements and their Attributes. domimpl's
+                    // extentions in that area will not be preserved, even if
+                    // copying from domimpl to domimpl. We could special-case
+                    // that here. Arguably we should. Consider. ?????
+                    newnode=newdoctype;
+        }
+        break;
+    case DOM_Node::DOCUMENT_FRAGMENT_NODE :
+        newnode = createDocumentFragment();
+        // No name, kids carry value
+        break;
+    case DOM_Node::NOTATION_NODE :
+        {
+            NotationImpl *srcnotation=(NotationImpl *)source;
+            NotationImpl *newnotation = createNotation(source->getNodeName());
+            newnotation->setPublicId(srcnotation->getPublicId());
+            newnotation->setSystemId(srcnotation->getSystemId());
+            // Kids carry additional value
+            newnode=newnotation;
+            // No name, no value
+            break;
+        }
+
+    case DOM_Node::DOCUMENT_NODE : // Document can't be child of Document
+    default:                                                // Unknown node type
+        throw new DOM_DOMException(DOM_DOMException::HIERARCHY_REQUEST_ERR,null);
+    }
+
+    // If deep, replicate and attach the kids.
+    if (deep)
+        for (NodeImpl *srckid = source->getFirstChild(); srckid != null; srckid = srckid->getNextSibling())
+        {
+            newnode->appendChild(importNode(srckid, true));
+        }
+
+    return newnode;
+};
+
+
+
+NodeImpl *DocumentImpl::insertBefore(NodeImpl *newChild, NodeImpl *refChild)
+{
+    // Only one such child permitted
+    if(
+        (newChild->isElementImpl() && docElement!=null)
+        ||
+        (newChild->isDocumentTypeImpl() && docType!=null)
+        )
+        throw new DOM_DOMException(DOM_DOMException::HIERARCHY_REQUEST_ERR,null);
+
+    NodeImpl::insertBefore(newChild,refChild);
+
+    // If insert succeeded, cache the kid appropriately
+    if(newChild->isElementImpl())
+        docElement=(ElementImpl *)newChild;
+    else if(newChild->isDocumentTypeImpl())
+        docType=(DocumentTypeImpl *)newChild;
+
+    return newChild;
+};
+
+
+
+bool DocumentImpl::isXMLName(const DOMString &s)
+{
+    XMLCh       *nam;
+    int         length;
+    int         i;
+
+    length = s.length();
+    if (length == 0)
+        return false;
+
+    nam = s.rawBuffer();
+    if (!XMLReader::isFirstNameChar(nam[0]))
+        return false;
+
+    for (i=1; i<length; i++)
+    {
+        if (!XMLReader::isNameChar(nam[i]))
+            return false;
+    }
+    return true;
+};
+
+
+//  referenced().   Override this function here in class DocumentImpl because
+//                  we don't want the action taken in NodeImpl, which is
+//                  to add a reference to the node's owning document.
+//
+void DocumentImpl::referenced()
+{
+    // Intentionally empty.
+};
+
+
+
+NodeImpl *DocumentImpl::removeChild(NodeImpl *oldChild)
+{
+    NodeImpl::removeChild(oldChild);
+
+    // If remove succeeded, un-cache the kid appropriately
+    if(oldChild->isElementImpl())
+        docElement=null;
+    else if(oldChild->isDocumentTypeImpl())
+        docType=null;
+
+    return oldChild;
+};
+
+
+
+void DocumentImpl::setNodeValue(const DOMString &x)
+{
+    throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+};
+
+
+
+//
+//    unreferenced()  will be called whenever the refernce count on
+//          this document goes from 1 to 0.  In all cases, when this
+//          happens to a document node (which is the case here), it
+//          is time to actually delete the document.
+//
+//          See also NodeImpl::referenced() and unreferenced(), which
+//          update document node ref counts based on references coming
+//          or going to nodes owned by the document.
+//
+void DocumentImpl::unreferenced()
+{
+    deleteIf(this);
+};
+
+
+//Introduced in DOM Level 2
+
+ElementImpl *DocumentImpl::createElementNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0)
+	return createElement(qualifiedName);
+    if(!isXMLName(qualifiedName))
+        throw new DOM_DOMException(DOM_DOMException::INVALID_CHARACTER_ERR,null);
+    //DOMString pooledTagName = this->namePool->getPooledString(qualifiedName);
+    return new ElementImpl(this, namespaceURI, qualifiedName);
+}
+
+
+AttrImpl *DocumentImpl::createAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0)
+	return createAttribute(qualifiedName);
+    if(!isXMLName(qualifiedName))
+        throw new DOM_DOMException(DOM_DOMException::INVALID_CHARACTER_ERR,null);
+    return new AttrImpl(this, namespaceURI, qualifiedName); 
+}
+
+
+DeepNodeListImpl *DocumentImpl::getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0)
+	return getElementsByTagName(localName);
+    return new DeepNodeListImpl(this, namespaceURI, localName);
+}
+
+
+ElementImpl *DocumentImpl::getElementById(const DOMString &elementId)
+{
+    return null;
+}
diff --git a/src/dom/DocumentImpl.hpp b/src/dom/DocumentImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..2b79632ef31740ea1e58ef8a97782d1efbf0d76b
--- /dev/null
+++ b/src/dom/DocumentImpl.hpp
@@ -0,0 +1,164 @@
+#ifndef DocumentImpl_HEADER_GUARD_
+#define DocumentImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:44  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:44:24  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+#include "DOM_Node.hpp"
+#include "util/RefVectorOf.hpp"
+
+class DocumentTypeImpl;
+class ElementImpl;
+class AttrImpl;
+class CDATASectionImpl;
+class CommentImpl;
+class DeepNodeListImpl;
+class DocumentFragmentImpl;
+class DocumentTypeImpl;
+class DStringPool;
+class EntityImpl;
+class EntityReferenceImpl;
+class NotationImpl;
+class ProcessingInstructionImpl;
+class TextImpl;
+class NodeIteratorImpl;
+class TreeWalkerImpl;
+class DOM_NodeFilter;
+class NodeFilterImpl;
+class DOM_DOMImplementation;
+
+
+typedef RefVectorOf<NodeIteratorImpl> NodeIterators;
+typedef RefVectorOf<TreeWalkerImpl> TreeWalkers;
+
+
+
+class DocumentImpl: public NodeImpl {
+private:
+    DocumentTypeImpl            *docType;
+    ElementImpl                 *docElement;
+    DStringPool                 *namePool;
+    NodeIterators                 *iterators;
+    TreeWalkers                   *treeWalkers;
+    friend class NodeIteratorImpl;
+    friend class TreeWalkerImpl;
+
+
+public:
+    DocumentImpl();
+    DocumentImpl(const DOMString &namespaceURI,	    //DOM Level 2
+	const DOMString &qualifiedName, DocumentTypeImpl *doctype);
+    virtual ~DocumentImpl();
+    virtual bool isDocumentImpl();   // RTTI replacement function
+
+    virtual NodeImpl            *cloneNode(bool deep);
+    virtual AttrImpl            *createAttribute(const DOMString &name);
+    virtual CDATASectionImpl    *createCDATASection(const DOMString &data);
+    virtual CommentImpl         *createComment(const DOMString &data);
+    virtual DocumentFragmentImpl *createDocumentFragment();
+    virtual DocumentTypeImpl    *createDocumentType(const DOMString &name);
+    virtual ElementImpl         *createElement(const DOMString & tagName);
+    virtual ElementImpl         *createElement(const XMLCh *tagName);
+    virtual EntityImpl          *createEntity(const DOMString & name);
+    virtual EntityReferenceImpl *createEntityReference(const DOMString & name);
+    virtual NotationImpl        *createNotation(const DOMString & name);
+    virtual ProcessingInstructionImpl *createProcessingInstruction(const DOMString & target, const DOMString & data);
+    virtual TextImpl            *createTextNode(const DOMString & data);
+    virtual DocumentTypeImpl    *getDoctype();
+    virtual ElementImpl         *getDocumentElement();
+    virtual DeepNodeListImpl    *getElementsByTagName(const DOMString & tagname);
+    virtual NodeImpl            *importNode(NodeImpl *source, bool deep);
+    virtual NodeImpl            *insertBefore(NodeImpl *newChild, NodeImpl *refChild);
+    static  bool                isXMLName(const DOMString & s);
+    virtual void                referenced();
+    virtual NodeImpl            *removeChild(NodeImpl *oldChild);
+    virtual void                setNodeValue(const DOMString & x);
+    virtual void                unreferenced();
+    static  NodeIteratorImpl*   createNodeIterator(DOM_Node root, short whatToShow, DOM_NodeFilter filter, NodeFilterImpl* fi);
+    static  TreeWalkerImpl*     createTreeWalker(DOM_Node root, short whatToShow, DOM_NodeFilter filter, NodeFilterImpl* fi);
+
+    //Introduced in DOM Level 2
+    virtual ElementImpl         *createElementNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName);
+    virtual AttrImpl            *createAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName);
+    virtual DeepNodeListImpl    *getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+    virtual ElementImpl         *getElementById(const DOMString &elementId);
+};
+
+#endif
diff --git a/src/dom/DocumentTypeImpl.cpp b/src/dom/DocumentTypeImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5c47620502aad1e8010286c76d88d018858083c3
--- /dev/null
+++ b/src/dom/DocumentTypeImpl.cpp
@@ -0,0 +1,217 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:44  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:24  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DocumentTypeImpl.hpp"
+#include "NodeImpl.hpp"
+#include "DOM_Node.hpp"
+#include "NamedNodeMapImpl.hpp"
+#include "DOM_DOMException.hpp"
+
+
+DocumentTypeImpl::DocumentTypeImpl(DocumentImpl *ownerDoc, const DOMString &dtName) 
+: NodeImpl(ownerDoc,dtName,DOM_Node::DOCUMENT_TYPE_NODE,false,null),
+    publicID(null), systemID(null), internalSubset(null)	//DOM Level 2
+{
+    entities = new NamedNodeMapImpl(ownerDoc,null);
+    notations= new NamedNodeMapImpl(ownerDoc,null);
+    
+    // NON-DOM
+    elements = new NamedNodeMapImpl(ownerDoc,null);
+};
+
+
+//Introduced in DOM Level 2
+DocumentTypeImpl::DocumentTypeImpl(const DOMString &qualifiedName,
+    const DOMString &publicID, const DOMString &systemID,
+    const DOMString &internalSubset)
+: NodeImpl(null, qualifiedName, DOM_Node::DOCUMENT_TYPE_NODE, false, null),
+    publicID(publicID), systemID(systemID), internalSubset(internalSubset)
+{
+    entities = new NamedNodeMapImpl(null,null);
+    notations= new NamedNodeMapImpl(null,null);
+    
+    // NON-DOM
+    elements = new NamedNodeMapImpl(null,null);
+};
+
+
+DocumentTypeImpl::DocumentTypeImpl(const DocumentTypeImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+    entities = other.entities->cloneMap();
+    notations= other.notations->cloneMap();
+    
+    // NON-DOM
+    elements = other.elements->cloneMap();
+
+    //DOM Level 2
+    publicID = other.publicID;
+    systemID = other.systemID;
+    internalSubset = other.internalSubset;
+};
+
+
+DocumentTypeImpl::~DocumentTypeImpl()
+{
+    if (entities != null)
+    {
+        entities->removeAll();
+        NamedNodeMapImpl::removeRef(entities);
+    }
+
+
+    if (notations != null)
+    {
+        notations->removeAll();
+        NamedNodeMapImpl::removeRef(notations);
+    }
+
+
+
+    if (elements != null)
+    {
+        elements->removeAll();
+        NamedNodeMapImpl::removeRef(elements);
+    }
+
+};
+
+
+NodeImpl *DocumentTypeImpl::cloneNode(bool deep)
+{
+    return new DocumentTypeImpl(*this, deep);
+};
+
+
+NamedNodeMapImpl *DocumentTypeImpl::getElements()
+{
+    return elements;
+};
+
+
+NamedNodeMapImpl *DocumentTypeImpl::getEntities()
+{
+    return entities;
+};
+
+
+DOMString DocumentTypeImpl::getName()
+{
+    return name;
+};
+
+
+NamedNodeMapImpl *DocumentTypeImpl::getNotations()
+{
+    return notations;
+};
+
+
+bool DocumentTypeImpl::isDocumentTypeImpl()
+{
+    return true;
+};
+
+
+void DocumentTypeImpl::setNodeValue(const DOMString &val)
+{
+    throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+};
+
+
+void DocumentTypeImpl::setReadOnly(bool readOnl, bool deep)
+{
+    NodeImpl::setReadOnly(readOnl,deep);
+    entities->setReadOnly(readOnl,true);
+    notations->setReadOnly(readOnl,true);
+};
+
+
+//Introduced in DOM Level 2
+
+DOMString DocumentTypeImpl::getPublicID()
+{
+    return publicID;
+}
+
+
+DOMString DocumentTypeImpl::getSystemID()
+{
+    return systemID;
+}
+
+
+DOMString DocumentTypeImpl::getInternalSubset()
+{
+    return internalSubset;
+}
+
+
+void DocumentTypeImpl::setOwnerDocument(DocumentImpl *docImpl)
+{
+    ownerDocument = docImpl;
+}
diff --git a/src/dom/DocumentTypeImpl.hpp b/src/dom/DocumentTypeImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..0f4a20bf740fabe3e4177c4d34b2872ffdeeb2c3
--- /dev/null
+++ b/src/dom/DocumentTypeImpl.hpp
@@ -0,0 +1,119 @@
+#ifndef DocumentTypeImpl_HEADER_GUARD_
+#define DocumentTypeImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:44  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:25  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+
+class NamedNodeMapImpl;
+
+class DocumentTypeImpl: public NodeImpl {
+private:
+    NamedNodeMapImpl *entities;
+    NamedNodeMapImpl *notations;
+    NamedNodeMapImpl *elements;
+    
+public:
+    DocumentTypeImpl(DocumentImpl *, const DOMString &);
+    DocumentTypeImpl(const DOMString &qualifiedName,	//DOM Level 2
+	const DOMString &publicID, const DOMString &systemID,
+	const DOMString &internalSubset);
+    DocumentTypeImpl(const DocumentTypeImpl &other, bool deep=false);
+    virtual ~DocumentTypeImpl();
+    virtual bool isDocumentTypeImpl();
+    
+    virtual NodeImpl *         cloneNode(bool deep);
+    virtual NamedNodeMapImpl * getElements();
+    virtual NamedNodeMapImpl * getEntities();
+    virtual DOMString          getName();
+    virtual NamedNodeMapImpl * getNotations();
+    virtual void               setNodeValue(const DOMString &arg); 
+    virtual void               setReadOnly(bool readOnly, bool deep);
+
+    //Introduced in DOM Level 2
+    DOMString publicID;
+    DOMString systemID;
+    DOMString internalSubset;
+    virtual DOMString     getPublicID();
+    virtual DOMString     getSystemID();
+    virtual DOMString     getInternalSubset();
+    virtual void setOwnerDocument(DocumentImpl *docImpl); //internal use only
+};
+
+#endif
diff --git a/src/dom/DomMemDebug.cpp b/src/dom/DomMemDebug.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..dfde2dbf8470ea33d35ec4c84e271a4a1875f772
--- /dev/null
+++ b/src/dom/DomMemDebug.cpp
@@ -0,0 +1,165 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:47  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:25  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include "DomMemDebug.hpp"
+#include <dom/DOMString.hpp>
+#include "NodeImpl.hpp"
+#include "NamedNodeMapImpl.hpp"
+#include <stdio.h>
+
+
+DomMemDebug::DomMemDebug()
+{
+    liveStringHandles   = DOMString::gLiveStringHandleCount;
+    totalStringHandles  = DOMString::gTotalStringHandleCount;
+    liveStringBuffers   = DOMString::gLiveStringDataCount;
+    totalStringBuffers  = DOMString::gTotalStringDataCount;
+    liveNodeImpls       = NodeImpl::gLiveNodeImpls;
+    totalNodeImpls      = NodeImpl::gTotalNodeImpls;
+    liveNamedNodeMaps   = NamedNodeMapImpl::gLiveNamedNodeMaps;
+    totalNamedNodeMaps  = NamedNodeMapImpl::gTotalNamedNodeMaps;
+};
+
+
+DomMemDebug::~DomMemDebug()
+{
+};
+
+
+bool DomMemDebug::operator == (const DomMemDebug &other)
+{
+    bool    r =
+        liveStringHandles   ==  other.liveStringHandles  &&
+        liveStringBuffers   ==  other.liveStringBuffers  &&
+        liveNodeImpls       ==  other.liveNodeImpls      &&
+        liveNamedNodeMaps   ==  other.liveNamedNodeMaps;
+    return r;
+};
+
+
+bool DomMemDebug::operator != (const DomMemDebug &other)
+{
+    return ! operator == (other);
+};
+
+
+void DomMemDebug::operator = (const DomMemDebug &other)
+{
+    liveStringHandles  = other.liveStringHandles; 
+    totalStringHandles = other.totalStringHandles;
+    liveStringBuffers  = other.liveStringBuffers; 
+    totalStringBuffers = other.totalStringBuffers;
+    liveNodeImpls      = other.liveNodeImpls;     
+    totalNodeImpls     = other.totalNodeImpls;    
+    liveNamedNodeMaps  = other.liveNamedNodeMaps; 
+    totalNamedNodeMaps = other.totalNamedNodeMaps;
+};
+
+void DomMemDebug::print()
+{
+    printf("DOM reference counted memory alloction statistics: \n"
+        "    live  string handles:   %d\n"
+        "    total string handles:   %d\n"
+        "    live  string buffers:   %d\n"
+        "    total string buffers:   %d\n"
+        "    live  nodeImpls:        %d\n"
+        "    total nodeImpls:        %d\n"
+        "    live  NamedNodeMaps:    %d\n"
+        "    total NamedNodeMaps:    %d\n",
+            liveStringHandles , 
+            totalStringHandles, 
+            liveStringBuffers  ,
+            totalStringBuffers ,
+            liveNodeImpls      ,
+            totalNodeImpls     ,
+            liveNamedNodeMaps  ,
+            totalNamedNodeMaps);
+};
+
+
+void DomMemDebug::printDifference(const DomMemDebug &other)
+{
+    int d;
+     
+    d = liveStringHandles - other.liveStringHandles;
+    if (d != 0)
+        printf("   %d StringHandles.", d);
+
+    d = liveStringBuffers - other.liveStringBuffers;
+    if (d != 0)
+        printf("   %d StringBuffers.", d);
+
+    d = liveNodeImpls - other.liveNodeImpls;
+    if (d != 0)
+        printf("   %d NodeImpls.", d);
+
+    d = liveNamedNodeMaps - other.liveNamedNodeMaps;
+    if (d != 0)
+        printf("   %d NamedNodeMaps.", d);
+
+    printf("\n");
+};
diff --git a/src/dom/DomMemDebug.hpp b/src/dom/DomMemDebug.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..4ffd5b530acb6f9bfc19ab31a28aab8e91df00e4
--- /dev/null
+++ b/src/dom/DomMemDebug.hpp
@@ -0,0 +1,109 @@
+#ifndef DomMemDebug_HEADER_GUARD_
+#define DomMemDebug_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:47  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:25  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include <util/XML4CDefs.hpp>
+
+//
+// This class aids in debugging memory management problems with the
+//  reference counted DOM classes - DOMStrings, Nodes (including subclasses),
+//  and NamedNodeMaps.
+//
+// Usage Example:
+//      DomMemDebug  initialState;   // Captures allocation totals
+//          ...                     //    Test code performs DOM
+//          ...                     //    operations here.
+//
+//      DomMemDebug  exitState;     //   Captures post-test state.
+//      ExitState.printDifference(initialState);  // Display leaks.
+//
+class CDOM_EXPORT DomMemDebug
+{
+public:
+    int         liveStringHandles;
+    int         totalStringHandles;
+    int         liveStringBuffers;
+    int         totalStringBuffers;
+    int         liveNodeImpls;
+    int         totalNodeImpls;
+    int         liveNamedNodeMaps;
+    int         totalNamedNodeMaps;
+
+public:
+    DomMemDebug();
+    ~DomMemDebug();
+
+    void        print();
+    void        printDifference(const DomMemDebug &other);
+    bool        operator == (const DomMemDebug &other);
+    bool        operator != (const DomMemDebug &other);
+    void        operator =  (const DomMemDebug &other);
+};
+
+
+#endif
diff --git a/src/dom/ElementDefinitionImpl.cpp b/src/dom/ElementDefinitionImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..11bffbb03cb71a72de38084dc3db3da71e40da2f
--- /dev/null
+++ b/src/dom/ElementDefinitionImpl.cpp
@@ -0,0 +1,105 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:07  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:25  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "ElementDefinitionImpl.hpp"
+#include "NamedNodeMapImpl.hpp"
+#include "NodeImpl.hpp"
+
+
+ElementDefinitionImpl::ElementDefinitionImpl(DocumentImpl *ownerDoc, const DOMString &nam):
+      NodeImpl(ownerDoc, nam, (short)-1, true, null) 
+{
+     attributes = 0;    
+};
+
+
+ElementDefinitionImpl::ElementDefinitionImpl(const ElementDefinitionImpl& other, bool deep)
+: NodeImpl(other, deep)
+{
+    // NamedNodeMap must be explicitly replicated to avoid sharing
+    attributes = 0;
+    if (other.attributes)
+        attributes = other.attributes->cloneMap();
+};
+
+
+ElementDefinitionImpl::~ElementDefinitionImpl() 
+{
+};
+
+
+NodeImpl *ElementDefinitionImpl::cloneNode(bool deep)
+{
+    return new ElementDefinitionImpl(*this, deep);
+};
+
+
+NamedNodeMapImpl *ElementDefinitionImpl::getAttributes() {
+    return attributes;
+};
+
+
+
diff --git a/src/dom/ElementDefinitionImpl.hpp b/src/dom/ElementDefinitionImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e62b2486c740d06c036a5fb889d3dc1addaaa3bb
--- /dev/null
+++ b/src/dom/ElementDefinitionImpl.hpp
@@ -0,0 +1,95 @@
+#ifndef ElementDefinitionImpl_HEADER_GUARD_
+#define ElementDefinitionImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:07  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:26  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+#include "NodeImpl.hpp"
+
+class ElementDefinitionImpl: public NodeImpl {
+private:
+    NamedNodeMapImpl *attributes;
+    
+public:
+    ElementDefinitionImpl(DocumentImpl *ownerDocument, const DOMString &name);
+    ElementDefinitionImpl(const ElementDefinitionImpl& other, bool deep=false);
+    
+    virtual                 ~ElementDefinitionImpl();
+    virtual NodeImpl        *cloneNode(bool deep);
+    virtual NamedNodeMapImpl *getAttributes();
+};
+
+#endif
diff --git a/src/dom/ElementImpl.cpp b/src/dom/ElementImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ea62c1736f49e00b13573b1fc6bda6db5df1354d
--- /dev/null
+++ b/src/dom/ElementImpl.cpp
@@ -0,0 +1,420 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:08  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:26  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DeepNodeListImpl.hpp"
+#include "DocumentImpl.hpp"
+#include "DocumentTypeImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DStringPool.hpp"
+#include "ElementImpl.hpp"
+#include "ElementDefinitionImpl.hpp"
+#include "NamedNodeMapImpl.hpp"
+#include "NodeVector.hpp"
+#include "TextImpl.hpp"
+
+
+ElementImpl::ElementImpl(DocumentImpl *ownerDoc, const DOMString &nam) :
+NodeImpl(ownerDoc, nam, DOM_Node::ELEMENT_NODE, false, null)
+{
+    
+    // If there is an ElementDefintion, set its Attributes up as
+    // shadows behind our own.
+    NamedNodeMapImpl *defaultAttrs = null;
+    DocumentTypeImpl *doctype = (DocumentTypeImpl *) ownerDocument->getDoctype();
+    if (doctype != null)
+    {
+        ElementDefinitionImpl *eldef=(ElementDefinitionImpl *)
+            doctype->getElements()->getNamedItem(this->name);
+        if(eldef!=null)
+            defaultAttrs=(NamedNodeMapImpl *)eldef->getAttributes();
+    }
+    attributes = new NamedNodeMapImpl(ownerDoc,defaultAttrs);
+};
+
+//DOM Level 2
+ElementImpl::ElementImpl(DocumentImpl *ownerDoc,
+    const DOMString &namespaceURI, const DOMString &qualifiedName) :
+NodeImpl(ownerDoc, namespaceURI, qualifiedName, DOM_Node::ELEMENT_NODE, false, null)
+{
+    
+    // If there is an ElementDefintion, set its Attributes up as
+    // shadows behind our own.
+    NamedNodeMapImpl *defaultAttrs = null;
+    DocumentTypeImpl *doctype = (DocumentTypeImpl *) ownerDocument->getDoctype();
+    if (doctype != null)
+    {
+        ElementDefinitionImpl *eldef=(ElementDefinitionImpl *)
+            doctype->getElements()->getNamedItem(this->name);
+        if(eldef!=null)
+            defaultAttrs=(NamedNodeMapImpl *)eldef->getAttributes();
+    }
+    attributes = new NamedNodeMapImpl(ownerDoc,defaultAttrs);
+}
+
+    
+ElementImpl::ElementImpl(const ElementImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+    attributes = other.attributes->cloneMap();
+};
+
+
+ElementImpl::~ElementImpl()
+{
+    if (attributes)
+    {
+        attributes->removeAll();
+        NamedNodeMapImpl::removeRef(attributes);
+    }
+};
+
+
+NodeImpl *ElementImpl::cloneNode(bool deep)
+{
+    return new ElementImpl(*this, deep);
+};
+
+
+DOMString ElementImpl::getAttribute(const DOMString &nam)
+{
+    static DOMString *emptyString = 0;
+    AttrImpl * attr=(AttrImpl *)(attributes->getNamedItem(nam));
+    return (attr==null) ? DStringPool::getStaticString("", &emptyString) : attr->getValue();
+};
+
+
+
+AttrImpl *ElementImpl::getAttributeNode(const DOMString &nam)
+{
+    return (AttrImpl *)(attributes->getNamedItem(nam));
+};
+
+
+NamedNodeMapImpl *ElementImpl::getAttributes()
+{
+    return attributes;
+};
+
+
+
+DeepNodeListImpl *ElementImpl::getElementsByTagName(const DOMString &tagname)
+{
+    return new DeepNodeListImpl(this,tagname);
+};
+
+
+DOMString ElementImpl::getTagName()
+{
+    return name;
+}  
+
+
+bool ElementImpl::isElementImpl()
+{
+    return true;
+};
+
+
+void ElementImpl::normalize()
+{
+    NodeImpl *kid, *next;
+    for (kid = getFirstChild(); kid != null; kid = next)
+    {
+        next = kid->getNextSibling();
+        
+        // If kid and next are both Text nodes (but _not_ CDATASection,
+        // which is a subclass of Text), they can be merged.
+        if (next != null && 
+            kid->isTextImpl()   && !(kid->isCDATASectionImpl())  && 
+            next->isTextImpl()  && !(next->isCDATASectionImpl()) )
+        {
+            ((TextImpl *) kid)->appendData(((TextImpl *) next)->getData());
+            removeChild(next);
+            if (next->nodeRefCount == 0)
+                deleteIf(next);
+            next = kid; // Don't advance; there might be another.
+        }
+        
+        // Otherwise it might be an Element, which is handled recursively  
+        else
+            if (kid->isElementImpl())
+                ((ElementImpl *) kid)->normalize();
+    };
+    
+    // changed() will have occurred when the removeChild() was done,
+    // so does not have to be reissued.
+};
+
+
+void ElementImpl::removeAttribute(const DOMString &nam)
+{
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    AttrImpl *att = (AttrImpl *) attributes->getNamedItem(nam);
+    // Remove it (and let the NamedNodeMap recreate the default, if any)
+    if (att != null)
+    {
+        attributes->removeNamedItem(nam);
+	att->setOwnerElement(null);	//DOM Level 2
+        if (att->nodeRefCount == 0)
+            NodeImpl::deleteIf(att);
+    }
+};
+
+
+
+AttrImpl *ElementImpl::removeAttributeNode(AttrImpl *oldAttr)
+{
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    AttrImpl *found = (AttrImpl *) attributes->getNamedItem(oldAttr->getName());
+    
+    // If it is in fact the right object, remove it (and let the
+    // NamedNodeMap recreate the default, if any)
+    
+    if (found == oldAttr)
+    {
+        attributes->removeNamedItem(oldAttr->getName());
+	found->setOwnerElement(null);	//DOM Level 2
+        return found;
+    }
+    else
+        throw new DOM_DOMException(DOM_DOMException::NOT_FOUND_ERR, null);
+	return null;	// just to keep the compiler happy
+};
+
+
+
+void ElementImpl::setAttribute(const DOMString &nam, const DOMString &val)
+{
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    AttrImpl *newAttr = (AttrImpl *) ownerDocument->createAttribute(nam);
+    newAttr->setNodeValue(val);
+    newAttr->setOwnerElement(this);	//DOM Level 2
+    AttrImpl *oldAttr = (AttrImpl *)attributes->setNamedItem(newAttr);
+
+    if (oldAttr) {
+	oldAttr->setOwnerElement(null);	//DOM Level 2
+	if (oldAttr->nodeRefCount == 0)
+	    NodeImpl::deleteIf(oldAttr);
+    }
+};
+
+
+
+AttrImpl * ElementImpl::setAttributeNode(AttrImpl *newAttr)
+{
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    if (!(newAttr->isAttrImpl()))
+        throw new DOM_DOMException(DOM_DOMException::WRONG_DOCUMENT_ERR, null);
+    AttrImpl *oldAttr = (AttrImpl *) attributes->getNamedItem(newAttr->getName());
+    if (oldAttr)
+	oldAttr->setOwnerElement(null);	    //DOM Level 2
+    
+    // This will throw INUSE if necessary
+    attributes->setNamedItem(newAttr);
+    
+    // Attr node reference counting note:
+    // If oldAttr's refcount is zero at this point, here's what happens...
+    // 
+    //      oldAttr is returned from this function to DOM_Attr::setAttributeNode,
+    //      which wraps a DOM_Attr around the returned pointer and sends it
+    //      up to application code, incrementing the reference count in the process.
+    //      When the app DOM_Attr's destructor runs, the reference count is
+    //      decremented back to zero and oldAttr will be deleted at that time.
+
+    return oldAttr;
+};
+
+
+void ElementImpl::setNodeValue(const DOMString &x)
+{
+    throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+};
+
+
+
+void ElementImpl::setReadOnly(bool readOnl, bool deep)
+{
+    NodeImpl::setReadOnly(readOnl,deep);
+    attributes->setReadOnly(readOnl,true);
+};
+
+
+//Introduced in DOM Level 2
+DOMString ElementImpl::getAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0)
+	return getAttribute(localName);
+    static DOMString *emptyString = 0;
+    AttrImpl * attr=(AttrImpl *)(attributes->getNamedItemNS(namespaceURI, localName));
+    return (attr==null) ? DStringPool::getStaticString("", &emptyString) : attr->getValue();
+}
+
+
+void ElementImpl::setAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName, const DOMString &value)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0) {
+	setAttribute(qualifiedName, value);
+	return;
+    }
+    if (readOnly)
+        throw new DOM_DOMException(
+	    DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    AttrImpl *newAttr = (AttrImpl *) ownerDocument->createAttributeNS(namespaceURI, qualifiedName);
+    newAttr->setNodeValue(value);
+    newAttr->setOwnerElement(this);
+    AttrImpl *oldAttr = (AttrImpl *)attributes->setNamedItem(newAttr);
+
+    if (oldAttr) {
+	oldAttr->setOwnerElement(null);
+	if (oldAttr->nodeRefCount == 0)
+	    NodeImpl::deleteIf(oldAttr);
+    }
+}
+
+
+void ElementImpl::removeAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0) {
+	removeAttribute(localName);
+	return;
+    }
+    if (readOnly)
+        throw new DOM_DOMException(
+	    DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    AttrImpl *att = (AttrImpl *) attributes->getNamedItemNS(namespaceURI, localName);
+    // Remove it (and let the NamedNodeMap recreate the default, if any)
+    if (att != null) {
+        attributes->removeNamedItemNS(namespaceURI, localName);
+	att->setOwnerElement(null);
+        if (att->nodeRefCount == 0)
+            NodeImpl::deleteIf(att);
+    }
+}
+
+
+AttrImpl *ElementImpl::getAttributeNodeNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0)
+	return getAttributeNode(localName);
+    return (AttrImpl *)(attributes->getNamedItemNS(namespaceURI, localName));
+}
+
+
+AttrImpl *ElementImpl::setAttributeNodeNS(AttrImpl *newAttr)
+{
+    if (newAttr && newAttr ->getNamespaceURI() == null)
+	return setAttributeNode(newAttr);
+    if (readOnly)
+        throw new DOM_DOMException(
+	    DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    if (newAttr -> getOwnerDocument() != this -> getOwnerDocument())
+        throw new DOM_DOMException(DOM_DOMException::WRONG_DOCUMENT_ERR, null);
+    AttrImpl *oldAttr = (AttrImpl *) attributes->getNamedItemNS(
+	newAttr->getNamespaceURI(), newAttr->getLocalName());
+    if (oldAttr)
+	oldAttr->setOwnerElement(null);
+    
+    // This will throw INUSE if necessary
+    attributes->setNamedItem(newAttr);
+    
+    // Attr node reference counting note:
+    // If oldAttr's refcount is zero at this point, here's what happens...
+    // 
+    //      oldAttr is returned from this function to DOM_Attr::setAttributeNode,
+    //      which wraps a DOM_Attr around the returned pointer and sends it
+    //      up to application code, incrementing the reference count in the process.
+    //      When the app DOM_Attr's destructor runs, the reference count is
+    //      decremented back to zero and oldAttr will be deleted at that time.
+
+    return oldAttr;
+}
+
+
+DeepNodeListImpl *ElementImpl::getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    return new DeepNodeListImpl(this,namespaceURI, localName);
+}
+
diff --git a/src/dom/ElementImpl.hpp b/src/dom/ElementImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..61f69857bc93ab9369062f3fbc7213d8d42ebedb
--- /dev/null
+++ b/src/dom/ElementImpl.hpp
@@ -0,0 +1,126 @@
+#ifndef ElementImpl_HEADER_GUARD_
+#define ElementImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:08  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:26  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+#include <util/XML4CDefs.hpp>
+#include "AttrImpl.hpp"
+#include "NodeImpl.hpp"
+
+class DeepNodeListImpl;
+
+class ElementImpl: public NodeImpl {
+protected:
+    NamedNodeMapImpl *attributes;
+    
+public:
+    ElementImpl(DocumentImpl *ownerDoc, const DOMString &name);
+    ElementImpl(DocumentImpl *ownerDoc,   //DOM Level 2
+	const DOMString &namespaceURI, const DOMString &qualifiedName);
+    ElementImpl(const ElementImpl &other, bool deep=false);
+    virtual ~ElementImpl();
+    
+    virtual bool isElementImpl();
+    virtual NodeImpl * cloneNode(bool deep);
+    virtual DOMString getAttribute(const DOMString &name);
+    virtual AttrImpl *getAttributeNode(const DOMString &name);
+    virtual NamedNodeMapImpl * getAttributes();
+    virtual DeepNodeListImpl * getElementsByTagName(const DOMString &tagname);
+    virtual DOMString getTagName();
+    virtual void normalize();
+    virtual void removeAttribute(const DOMString &name);
+    virtual AttrImpl * removeAttributeNode(AttrImpl * oldAttr);
+    virtual void setAttribute(const DOMString &name, const DOMString &value);
+    virtual AttrImpl *setAttributeNode(AttrImpl *newAttr);
+    virtual void setNodeValue(const DOMString &arg);
+    virtual void setReadOnly(bool readOnly, bool deep);
+
+    //Introduced in DOM Level 2
+    virtual DOMString getAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+    virtual void setAttributeNS(const DOMString &namespaceURI,
+	const DOMString &qualifiedName, const DOMString &value);
+    virtual void removeAttributeNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+    virtual AttrImpl *getAttributeNodeNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+    virtual AttrImpl *setAttributeNodeNS(AttrImpl *newAttr);
+    virtual DeepNodeListImpl *getElementsByTagNameNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+};
+
+#endif
diff --git a/src/dom/EntityImpl.cpp b/src/dom/EntityImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4ab0548e098a25db83b4fd948ae80acea53872ef
--- /dev/null
+++ b/src/dom/EntityImpl.cpp
@@ -0,0 +1,137 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:08  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:26  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DOM_DOMException.hpp"
+#include "DOM_Node.hpp"
+#include "EntityImpl.hpp"
+
+
+EntityImpl::EntityImpl(DocumentImpl *ownerDoc, const DOMString &eName) :
+NodeImpl(ownerDoc, eName, DOM_Node::ENTITY_NODE, false, null)
+{
+};
+
+
+EntityImpl::EntityImpl(const EntityImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+    publicId = other.publicId.clone();
+    systemId = other.systemId.clone();
+    notationName = other.notationName.clone();
+};
+
+
+EntityImpl::~EntityImpl() {
+};
+
+
+NodeImpl *EntityImpl::cloneNode(bool deep)
+{
+    return new EntityImpl(*this, deep);
+};
+
+
+
+DOMString EntityImpl::getNotationName()
+{
+    return notationName;
+}; 
+
+
+DOMString EntityImpl::getPublicId() {
+    return publicId;
+}; 
+
+
+DOMString EntityImpl::getSystemId()
+{
+    return systemId;
+};  
+
+
+void EntityImpl::setNodeValue(const DOMString &arg)
+{
+    throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+};
+
+
+void EntityImpl::setNotationName(const DOMString &arg)
+{
+    notationName = arg;
+};
+
+
+void EntityImpl::setPublicId(const DOMString &arg)
+{
+    publicId = arg;
+};
+
+
+void EntityImpl::setSystemId(const DOMString &arg)
+{
+    systemId = arg;
+};
+
diff --git a/src/dom/EntityImpl.hpp b/src/dom/EntityImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..5b8ef1aa47b1999247a09b74ebcabfb363e12d7e
--- /dev/null
+++ b/src/dom/EntityImpl.hpp
@@ -0,0 +1,104 @@
+#ifndef EntityImpl_HEADER_GUARD_
+#define EntityImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:09  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:27  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+
+class EntityImpl: public NodeImpl {
+private:
+    DOMString publicId;
+    DOMString systemId;
+    DOMString notationName;
+
+public:
+    EntityImpl(DocumentImpl *, const DOMString &eName);
+    EntityImpl(const EntityImpl &other, bool deep=false);
+    virtual ~EntityImpl();
+    
+    virtual NodeImpl    *cloneNode(bool deep);
+    virtual DOMString   getPublicId();
+    virtual DOMString   getSystemId();
+    virtual DOMString   getNotationName();
+    virtual void        setNodeValue(const DOMString &arg);
+    virtual void        setNotationName(const DOMString &arg);
+    virtual void        setPublicId(const DOMString &arg);
+    virtual void        setSystemId(const DOMString &arg);
+};
+
+#endif
+
diff --git a/src/dom/EntityReferenceImpl.cpp b/src/dom/EntityReferenceImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d6a46910f584a96bb2b52451ccfc004e00b30172
--- /dev/null
+++ b/src/dom/EntityReferenceImpl.cpp
@@ -0,0 +1,366 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:09  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:27  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+*/
+
+/**
+* EntityReference models the XML &entityname; syntax, when used for
+* entities defined by the DOM. Entities hardcoded into XML, such as
+* character entities, should instead have been translated into text
+* by the code which generated the DOM tree.
+* <P>
+* An XML processor has the alternative of fully expanding Entities
+* into the normal document tree. If it does so, no EntityReference nodes
+* will appear.
+* <P>
+* Similarly, non-validating XML processors are not required to read
+* or process entity declarations made in the external subset or
+* declared in external parameter entities. Hence, some applications
+* may not make the replacement value available for Parsed Entities 
+* of these types.
+* <P>
+* EntityReference behaves as a read-only node, and the children of 
+* the EntityReference (which reflect those of the Entity, and should
+* also be read-only) give its replacement value, if any. They are 
+* supposed to automagically stay in synch if the DocumentType is 
+* updated with new values for the Entity.
+* <P>
+* The defined behavior makes efficient storage difficult for the DOM
+* implementor. We can't just look aside to the Entity's definition
+* in the DocumentType since those nodes have the wrong parent (unless
+* we can come up with a clever "imaginary parent" mechanism). We
+* must at least appear to clone those children... which raises the
+* issue of keeping the reference synchronized with its parent.
+* This leads me back to the "cached image of centrally defined data"
+* solution, much as I dislike it.
+* <P>
+* For now I have decided, since REC-DOM-Level-1-19980818 doesn't
+* cover this in much detail, that synchronization doesn't have to be
+* considered while the user is deep in the tree. That is, if you're
+* looking within one of the EntityReferennce's children and the Entity
+* changes, you won't be informed; instead, you will continue to access
+* the same object -- which may or may not still be part of the tree.
+* This is the same behavior that obtains elsewhere in the DOM if the
+* subtree you're looking at is deleted from its parent, so it's
+* acceptable here. (If it really bothers folks, we could set things
+* up so deleted subtrees are walked and marked invalid, but that's
+* not part of the DOM's defined behavior.)
+* <P>
+* As a result, only the EntityReference itself has to be aware of
+* changes in the Entity. And it can take advantage of the same
+* structure-change-monitoring code I implemented to support
+* DeepNodeList.
+* 
+* @author Rania Y. Khalaf
+* @author Joseph Kesselman
+* @since  PR-DOM-Level-1-19980818.
+*/
+
+#include "DocumentImpl.hpp"
+#include "DocumentTypeImpl.hpp"
+#include "EntityImpl.hpp"
+#include "EntityReferenceImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DOM_Node.hpp"
+#include "NamedNodeMapImpl.hpp"
+#include "NodeImpl.hpp"
+
+
+
+EntityReferenceImpl::EntityReferenceImpl(DocumentImpl *ownerDoc, const DOMString &entityName) :
+NodeImpl(ownerDoc, entityName, DOM_Node::ENTITY_REFERENCE_NODE, false, null)
+{
+    
+    // EntityReference behaves as a read-only node, since its contents
+    // reflect the Entity it refers to -- but see setNodeName().
+    readOnly = false;
+    entityChanges=-1;
+}
+
+
+
+EntityReferenceImpl::EntityReferenceImpl(const EntityReferenceImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+    entityChanges = other.entityChanges;
+}
+
+
+
+EntityReferenceImpl::~EntityReferenceImpl() 
+{
+}
+
+
+NodeImpl *EntityReferenceImpl::cloneNode(bool deep)
+{
+    // Note #971.  Unclear what a shallow clone should mean/do.
+    synchronize();
+    return new EntityReferenceImpl(*this, deep);
+}
+
+
+/**
+* Perform synchronize() before accessing children.
+* 
+* @return org.w3c.dom.NodeList
+*/
+NodeListImpl *EntityReferenceImpl::getChildNodes()
+{
+    synchronize();
+    return NodeImpl::getChildNodes();
+}
+
+
+/**
+* Perform synchronize() before accessing children.
+* 
+* @return org.w3c.dom.NodeList
+*/
+NodeImpl *EntityReferenceImpl::getFirstChild()
+{
+    synchronize();
+    return NodeImpl::getFirstChild();
+}
+
+
+/**
+* Perform synchronize() before accessing children.
+* 
+* @return org.w3c.dom.NodeList
+*/
+NodeImpl *EntityReferenceImpl::getLastChild() 
+{
+    synchronize();
+    return NodeImpl::getLastChild();
+}
+
+
+/**
+* Query the number of children in the entity definition.
+* (A bit more work than asking locally, but may be able to avoid
+* or defer building the clone subtree.)
+*
+* @return org.w3c.dom.NodeList
+*/
+int EntityReferenceImpl::getLength()
+{
+    int length = NodeImpl::getLength();
+
+#if (0)                 // Till we add entity nodes to the doc root element.
+
+    DocumentTypeImpl *doctype;
+    NamedNodeMapImpl *entities;
+    EntityImpl *entDef;
+    if (null != (doctype = ownerDocument->getDoctype()) && 
+        null != (entities = doctype->getEntities()) &&
+        null != (entDef = (EntityImpl *)entities->getNamedItem(name))
+        )
+        length=entDef->getChildNodes()->getLength();
+#endif
+    
+    return length;
+}
+
+
+/**
+* Query the presence of children in the entity definition.
+* (A bit more work than asking locally, but may be able to avoid
+* or defer building the clone subtree.)
+*
+* @return boolean
+*/
+bool EntityReferenceImpl::hasChildNodes()
+{
+    bool haskids=false;
+    
+    DocumentTypeImpl *doctype;
+    NamedNodeMapImpl *entities;
+    EntityImpl *entDef;
+    if (null != (doctype = ownerDocument->getDoctype()) && 
+        null != (entities = doctype->getEntities()) &&
+        null != (entDef = (EntityImpl *)entities->getNamedItem(name))
+        )
+        haskids=entDef->hasChildNodes();
+    
+    return haskids;
+}
+
+
+
+bool EntityReferenceImpl::isEntityReference()
+{
+    return true;
+}
+
+
+/**
+* Perform synchronize() before accessing children.
+* ????? Should just ask the Entity instead!
+* (Though if we discover 0, we can flush)
+*
+* @return org.w3c.dom.NodeList
+*/
+NodeImpl *EntityReferenceImpl::item(int index) {
+    synchronize();
+    return NodeImpl::item(index);
+}
+
+
+/**
+* EntityReferences never have a nodeValue.
+* @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
+*/
+void EntityReferenceImpl::setNodeValue(const DOMString &x)
+{
+    throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+}
+
+
+/**
+* EntityRef is already, and must be, a read-only node. Attempts to change
+* that will throw a NO_MODIFICATION_ALLOWED_ERR DOMException.
+* <P>
+* If you want to alter its contents, edit the Entity definition.
+* 
+* @param readOnly boolean
+*/
+void EntityReferenceImpl::setReadOnly(bool readOnl,bool deep)
+{
+    if(readOnl==false)
+        throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,null);
+    NodeImpl::setReadOnly(readOnl,deep);
+}
+
+
+/**
+* EntityReference's children are a reflection of those defined in the
+* named Entity. This method updates them if the Entity is changed.
+* <P>
+* It is unclear what the least-cost resynch mechanism is.
+* If we expect the kids to be shallow, and/or expect changes
+* to the Entity contents to be rare, wiping them all out
+* and recloning is simplest.
+* <P>
+* If we expect them to be deep,
+* it might be better to first decide which kids (if any)
+* persist, and keep the ones (if any) that are unchanged
+* rather than doing all the work of cloning them again.
+* But that latter gets into having to convolve the two child lists,
+* insert new information in the right order (and possibly reorder
+* the existing kids), and a few other complexities that I really
+* don't want to deal with in this implementation.
+* <P>
+* Note that if we decide that we need to update the EntityReference's
+* contents, we have to turn off the readOnly flag temporarily to do so.
+* When we get around to adding multitasking support, this whole method
+* should probably be an atomic operation.
+* 
+* @see DocumentTypeImpl
+* @see EntityImpl
+*/
+void EntityReferenceImpl::synchronize()
+{
+    DocumentTypeImpl *doctype;
+    NamedNodeMapImpl *entities;
+    EntityImpl *entDef;
+    if (null != (doctype = ownerDocument->getDoctype()) && 
+        null != (entities = doctype->getEntities())
+        )
+    {
+        entDef = (EntityImpl *)entities->getNamedItem(name);
+        
+        // No Entity by this name. If we had a change count, reset it.
+        if(null==entDef)
+            entityChanges=-1;
+        
+        // If no kids availalble, wipe any pre-existing children.
+        // (See discussion above.)
+        // Note that we have to use the superclass to avoid recursion
+        // through Synchronize.
+        readOnly=false;
+        if(null==entDef || !entDef->hasChildNodes())
+            for(NodeImpl *kid=NodeImpl::getFirstChild();
+            kid!=null;
+            kid=NodeImpl::getFirstChild())
+                removeChild(kid);
+            
+            // If entity's definition changed, clone its kids
+            // (See discussion above.)
+            if(null!=entDef && entDef->changes!=entityChanges)
+            {
+                for(NodeImpl *defkid=entDef->getFirstChild();
+                defkid!=null;
+                defkid=defkid->getNextSibling())
+                {
+                    NodeImpl *newkid=(NodeImpl *) defkid->cloneNode(true);
+                    newkid->setReadOnly(true,true);
+                    insertBefore(newkid,null);
+                    readOnly=true;
+                }
+                entityChanges=entDef->changes;
+            }
+            readOnly=true;
+    }
+}
diff --git a/src/dom/EntityReferenceImpl.hpp b/src/dom/EntityReferenceImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..164a8fb831dee06a873f9570baa83fffafa345c9
--- /dev/null
+++ b/src/dom/EntityReferenceImpl.hpp
@@ -0,0 +1,105 @@
+#ifndef EntityReferenceImpl_HEADER_GUARD_
+#define EntityReferenceImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:10  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:28  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+
+class EntityReferenceImpl: public NodeImpl
+{
+private:
+    int entityChanges;
+    
+public:
+    EntityReferenceImpl(DocumentImpl *ownerDoc, const DOMString &entityName);
+    EntityReferenceImpl(const EntityReferenceImpl &other, bool deep=false);
+    virtual ~EntityReferenceImpl();
+    virtual NodeImpl * cloneNode(bool deep);
+    virtual NodeListImpl *getChildNodes();
+    virtual NodeImpl *getFirstChild();
+    virtual NodeImpl *getLastChild();
+    virtual int getLength();
+    virtual bool hasChildNodes();
+    virtual bool isEntityReference();
+    virtual NodeImpl *item(int index);
+    virtual void setNodeValue(const DOMString &);
+    virtual void setReadOnly(bool readOnly,bool deep);
+    virtual void synchronize();
+};
+
+#endif
+
diff --git a/src/dom/Makefile.in b/src/dom/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..c1d646048069d9124c53102622931371bb5b2395
--- /dev/null
+++ b/src/dom/Makefile.in
@@ -0,0 +1,224 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:09:11  twl
+# Initial revision
+#
+# Revision 1.4  1999/11/08 20:44:28  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#:
+#
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+LDFLAGS = @ldflags@
+LIBS = @libs@
+OSVER = @osver@
+USELIBWWW = @uselibwww@
+MESSAGELOADER = @messageloader@
+TRANSCODER = @transcoder@
+
+MODULE = dom
+
+include ../Makefile.incl
+
+DOM_CPP_PUBHEADERS = \
+	DOM.hpp \
+	DOMString.hpp \
+	DOM_Attr.hpp \
+	DOM_CDATASection.hpp \
+	DOM_CharacterData.hpp \
+	DOM_Comment.hpp \
+	DOM_DOMException.hpp \
+	DOM_DOMImplementation.hpp \
+	DOM_Document.hpp \
+	DOM_DocumentFragment.hpp \
+	DOM_DocumentType.hpp \
+	DOM_Element.hpp \
+	DOM_Entity.hpp \
+	DOM_EntityReference.hpp \
+	DOM_NamedNodeMap.hpp \
+	DOM_Node.hpp \
+	DOM_NodeFilter.hpp \
+	DOM_NodeIterator.hpp \
+	DOM_NodeList.hpp \
+	DOM_Notation.hpp \
+	DOM_ProcessingInstruction.hpp \
+	DOM_Text.hpp \
+	DOM_TreeWalker.hpp
+
+DOM_CPP_PRIVHEADERS =  \
+	AttrImpl.hpp \
+	CDATASectionImpl.hpp \
+	CharacterDataImpl.hpp \
+	CommentImpl.hpp \
+	DStringPool.hpp \
+	DeepNodeListImpl.hpp \
+	DocumentFragmentImpl.hpp \
+	DocumentImpl.hpp \
+	DocumentTypeImpl.hpp \
+	DomMemDebug.hpp \
+	ElementDefinitionImpl.hpp \
+	ElementImpl.hpp \
+	EntityImpl.hpp \
+	EntityReferenceImpl.hpp \
+	MemDebug.hpp \
+	NameNodeFilter.hpp \
+	NamedNodeMapImpl.hpp \
+	NodeImpl.hpp \
+	NodeIteratorImpl.hpp \
+	NodeFilterImpl.hpp \
+	NodeListImpl.hpp \
+	NodeVector.hpp \
+	NotationImpl.hpp \
+	ProcessingInstructionImpl.hpp \
+	RefCountedImpl.hpp \
+	TextImpl.hpp \
+	TreeWalkerImpl.hpp
+
+DOM_C_FILES = 
+
+DOM_CPP_OBJECTS = \
+	AttrImpl.o \
+	CDATASectionImpl.o \
+	CharacterDataImpl.o \
+	CommentImpl.o \
+	DOMString.o \
+	DOM_Attr.o \
+	DOM_CDATASection.o \
+	DOM_CharacterData.o \
+	DOM_Comment.o \
+	DOM_DOMException.o \
+	DOM_DOMImplementation.o \
+	DOM_Document.o \
+	DOM_DocumentFragment.o \
+	DOM_DocumentType.o \
+	DOM_Element.o \
+	DOM_Entity.o \
+	DOM_EntityReference.o \
+	DOM_NamedNodeMap.o \
+	DOM_Node.o \
+	DOM_NodeList.o \
+	DOM_NodeFilter.o \
+	DOM_NodeIterator.o \
+	DOM_TreeWalker.o \
+	DOM_Notation.o \
+	DOM_ProcessingInstruction.o \
+	DOM_Text.o \
+	DStringPool.o \
+	DeepNodeListImpl.o \
+	DocumentFragmentImpl.o \
+	DocumentImpl.o \
+	DocumentTypeImpl.o \
+	DomMemDebug.o \
+	ElementDefinitionImpl.o \
+	ElementImpl.o \
+	EntityImpl.o \
+	EntityReferenceImpl.o \
+	NamedNodeMapImpl.o \
+	NodeImpl.o \
+	NodeIteratorImpl.o \
+	NodeFilterImpl.o \
+	NodeListImpl.o \
+	NodeVector.o \
+	NotationImpl.o \
+	ProcessingInstructionImpl.o \
+	RefCountedImpl.o \
+	TextImpl.o \
+	TreeWalkerImpl.o
+
+
+all:	includes $(DOM_CPP_OBJECTS) publish
+
+includes:	pubheaders $(DOM_C_FILES)
+
+pubheaders:
+	-mkdir -p $(XML_INC_DIR)/$(MODULE)
+	$(CP) $(DOM_CPP_PUBHEADERS) $(DOM_C_FILES) $(XML_INC_DIR)/$(MODULE)
+
+publish:
+	-mkdir -p ${ALL_OBJECTS_DIR}
+	$(CP) $(DOM_CPP_OBJECTS) $(ALL_OBJECTS_DIR)
+
+# this may generate unnecessary dependencies, but it makes life easier
+depend: includes
+	$(MAKE_DEPEND) $(XML_INCL)  *.cpp > $(DEPFILE)
+
+clean:
+	@echo "Making clean in $(MODULE) ..."
+	$(RM) $(DOM_CPP_OBJECTS)
+
+distclean:	clean
+	$(RM) Makefile $(DEPFILE)
+	@echo "Removing all $(MODULE) header files ..."
+	@for file in $(DOM_CPP_PUBHEADERS); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@for file in $(DOM_C_FILES); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@echo "Removing all $(MODULE) object files ..."
+	@for file in $(DOM_CPP_OBJECTS); do \
+	rm -f $(ALL_OBJECTS_DIR)/$$file; \
+	done
+
+install:
+	-mkdir -p $(PREFIX)/$(MODULE)
+	$(CP) $(DOM_CPP_PUBHEADERS) $(DOM_C_FILES) $(PREFIX)/$(MODULE)
diff --git a/src/dom/MemDebug.hpp b/src/dom/MemDebug.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..762c6b435ff9222e25c5055ed0428dd75661cc08
--- /dev/null
+++ b/src/dom/MemDebug.hpp
@@ -0,0 +1,94 @@
+#ifndef MemDebug_HEADER_GUARD_
+#define MemDebug_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:11  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:28  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+class DomMemDebug
+{
+public:
+    int         liveStringHandles;
+    int         totalStringHandles;
+    int         liveStringBuffers;
+    int         totalStringBuffers;
+    int         liveNodeImpls;
+    int         totalNodeImpls;
+    int         liveNamedNodeMaps;
+    int         totalNamedNodeMaps;
+
+public:
+    DOMMemDebug();
+    ~DOMMemDebug();
+
+    void        print();
+    void        printDifference(const DOMMemDebug &other);
+    bool        operator == (const DOMMemDebug &other);
+    bool        operator != (const DOMMemDebug &other);
+    bool        operator =  (const DOMMemDebug &other);
+};
+
+#endif // MemDebug_HEADER_GUARD_
diff --git a/src/dom/NameNodeFilter.hpp b/src/dom/NameNodeFilter.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..d1b546cbd5d6f39abda579b2fd3de5e3ede8c2cd
--- /dev/null
+++ b/src/dom/NameNodeFilter.hpp
@@ -0,0 +1,111 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:12  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:28  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// DOM_NameNodeFilter.h: interface for the DOM_NameNodeFilter class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef DOM_NameNodeFilter_HEADER_GUARD_
+#define DOM_NameNodeFilter_HEADER_GUARD_
+
+
+#include "DOM_NodeFilter.hpp"
+#include "NodeFilterImpl.hpp"
+#include "DOMString.hpp"
+#include "DOM_Node.hpp"
+
+
+class CDOM_EXPORT NameNodeFilter : public NodeFilterImpl
+{
+	public:
+		NameNodeFilter();
+		virtual ~NameNodeFilter();
+
+    /** The name to compare with the node name. If null, all node names
+     *  are successfully matched.
+     */
+    void setName(DOMString name);
+
+    /** Return the name to compare with node name. */
+    DOMString getName();
+
+    /** If match is true, the node name is accepted when it matches.
+     *  If match is false, the node name is accepted when does not match.
+     */
+    void setMatch(bool match) ;
+
+    /** Return match value */
+    bool getMatch();
+
+    virtual DOM_NodeFilter::FilterAction acceptNode(DOM_Node n);
+
+	private:
+    DOMString fName;
+    bool fMatch;
+
+};
+
+#endif
diff --git a/src/dom/NamedNodeMapImpl.cpp b/src/dom/NamedNodeMapImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d6d5e7b3091d26273c723df6076e3d57db74f66b
--- /dev/null
+++ b/src/dom/NamedNodeMapImpl.cpp
@@ -0,0 +1,519 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:11  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:29  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "NamedNodeMapImpl.hpp"
+#include "NodeVector.hpp"
+#include "AttrImpl.hpp"
+#include "DOM_DOMException.hpp"
+
+
+int        NamedNodeMapImpl::gLiveNamedNodeMaps  = 0;
+int        NamedNodeMapImpl::gTotalNamedNodeMaps = 0;
+
+NamedNodeMapImpl::NamedNodeMapImpl(DocumentImpl *ownerD,NamedNodeMapImpl *defs)
+{
+    this->ownerDoc=ownerD;
+    this->defaults=defs;
+    this->nodes = null;
+    this->changes = 0;
+    lastDefaultsChanges = -1;
+    this->readOnly = false;
+    this->refCount = 1;
+    gLiveNamedNodeMaps++;
+    gTotalNamedNodeMaps++;
+};
+
+
+
+NamedNodeMapImpl::~NamedNodeMapImpl()
+{ 
+    if (nodes)
+    {
+        // It is the responsibility of whoever was using the named node
+        // map to do any cleanup on the nodes contained in the map
+        //  before deleting it.
+        delete nodes;
+        nodes = 0;
+    }
+    gLiveNamedNodeMaps--;
+};
+
+
+void NamedNodeMapImpl::addRef(NamedNodeMapImpl *This)
+{
+    if (This)
+        ++This->refCount;
+};
+
+
+NamedNodeMapImpl *NamedNodeMapImpl::cloneMap()
+{
+    bool deep = true;
+    NamedNodeMapImpl *newmap = new NamedNodeMapImpl(ownerDoc, defaults);
+    if (nodes != null)
+    {
+        newmap->nodes = new NodeVector(nodes->size());
+        for (int i = 0; i < nodes->size(); ++i)
+        {
+            NodeImpl *n = nodes->elementAt(i)->cloneNode(deep);
+            n->owned = true;
+            newmap->nodes->addElement(n);
+        }
+    }
+    newmap->defaults = defaults;
+    if (defaults)
+        defaults->refCount++;
+    
+    return newmap;
+};
+
+
+//
+//  removeAll - This function removes all elements from a named node map.
+//              It is called from the destructors for Elements and DocumentTypes,
+//              to remove the contents when the owning Element or DocType goes
+//              away.  The empty NamedNodeMap may persist if the user code
+//              has a reference to it.
+//
+//              AH Revist - the empty map should be made read-only, since
+//              adding it was logically part of the [Element, DocumentType]
+//              that has been deleted, and adding anything new to it would
+//              be meaningless, and almost certainly an error.
+//
+void NamedNodeMapImpl::removeAll()
+{
+    if (nodes)
+    {
+
+        for (int i=nodes->size()-1; i>=0; i--)
+        {
+            NodeImpl *n = nodes->elementAt(i);
+            n->owned = false;
+            if (n->nodeRefCount == 0)
+                NodeImpl::deleteIf(n);
+        }
+        delete nodes;        
+        nodes = null;  
+    }
+}
+
+
+
+int NamedNodeMapImpl::findNamePoint(const DOMString &name)
+{
+    reconcileDefaults();
+    
+    // Binary search
+    int i=0;
+    if(nodes!=null)
+    {
+        int first=0,last=nodes->size()-1;
+        
+        while(first<=last)
+        {
+            i=(first+last)/2;
+            int test = name.strcmp(nodes->elementAt(i)->getNodeName());
+            if(test==0)
+                return i; // Name found
+            else if(test<0)
+                last=i-1;
+            else
+                first=i+1;
+        }
+        if(first>i) i=first;
+    }
+    /********************
+    // Linear search
+    int i = 0;
+    if (nodes != null)
+    for (i = 0; i < nodes.size(); ++i)
+    {
+    int test = name.compareTo(((NodeImpl *) (nodes.elementAt(i))).getNodeName());
+    if (test == 0)
+    return i;
+    else
+    if (test < 0)
+    {
+    break; // Found insertpoint
+    }
+    }
+    
+    *******************/
+    return -1 - i; // not-found has to be encoded.
+};
+
+
+
+int NamedNodeMapImpl::getLength()
+{
+    reconcileDefaults();
+    return (nodes != null) ? nodes->size() : 0;
+};
+
+
+
+NodeImpl * NamedNodeMapImpl::getNamedItem(const DOMString &name)
+{
+    int i=findNamePoint(name);
+    return (i<0) ? null : (NodeImpl *)(nodes->elementAt(i));
+    
+    /************   
+    reconcileDefaults();
+    
+      // DO BINARY SEARCH?????
+      if (nodes != null)
+      for (int i = 0; i < nodes.size(); ++i)
+      {
+      int test = name.compareTo(((Node) (nodes.elementAt(i))).getNodeName());
+      if (test == 0)
+      return (Node) (nodes.elementAt(i));
+      if (test < 0)
+      break; // Past the sort point.
+      }
+      return null;
+    **************/ 
+};
+
+
+
+NodeImpl * NamedNodeMapImpl::item(int index)
+{
+    reconcileDefaults();
+    return (nodes != null && index < nodes->size()) ?
+        (NodeImpl *) (nodes->elementAt(index)) : null;
+};
+
+
+
+void NamedNodeMapImpl::reconcileDefaults()
+{
+    if (defaults != null && lastDefaultsChanges != defaults->changes)
+    {
+        int n = 0, d = 0, nsize = nodes->size(), dsize = defaults->nodes->size();
+        AttrImpl * nnode = (nsize == 0) ? null : (AttrImpl *) nodes->elementAt(0);
+        AttrImpl * dnode = (dsize == 0) ? null : (AttrImpl *) defaults->nodes->elementAt(0);
+        while (n < nsize && d < dsize)
+        {
+            nnode = (AttrImpl *) nodes->elementAt(n);
+            dnode = (AttrImpl *) defaults->nodes->elementAt(d);
+            int test = nnode->getNodeName().strcmp( dnode->getNodeName());
+            // nnode->getNodeName()->compareTo(dnode->getNodeName());
+            
+            // Same name and a default -- make sure same value
+            if (test == 0 && !nnode->getSpecified())
+            {
+                nodes->setElementAt(dnode, n);
+                // Advance over both, since names in sync
+                ++n;
+                ++d;
+            }
+            
+            // Different name, new default in table; add it
+            else if (test > 0)
+            {
+                nodes->insertElementAt(dnode, n);
+                // Now in sync, so advance over both
+                ++n;
+                ++d;
+            }
+            
+            // Different name, old default here; remove it.
+            else if (!nnode->getSpecified())
+            {
+                nodes->removeElementAt(n);
+                // n didn't advance but represents a different element
+            }
+            
+            // Different name, specified; accept it
+            else
+                ++n;
+        }
+        
+        // If we ran out of local before default, pick up defaults
+        while (d < dsize)
+        {
+            nodes->addElement(defaults->nodes->elementAt(d));
+        }
+        lastDefaultsChanges = defaults->changes;
+    }
+};
+
+
+//
+// removeNamedItem() - Remove the named item, and return it.
+//                      The caller must arrange for deletion of the 
+//                      returned item if its refcount has gone to zero -
+//                      we can't do it here because the caller would
+//                      never see the returned node.
+//
+NodeImpl * NamedNodeMapImpl::removeNamedItem(const DOMString &name)
+{
+    int i=findNamePoint(name);
+    if(i<0)
+        throw new DOM_DOMException(DOM_DOMException::NOT_FOUND_ERR, null);
+    else
+    {
+        NodeImpl * n = (NodeImpl *) (nodes->elementAt(i));
+        // If there's a default, add it instead
+        NodeImpl * d;
+	if (defaults != null && (d = defaults->getNamedItem(name)) != null) {
+	    if (n->isAttrImpl() && d->isAttrImpl()) {	//DOM Level 2
+		d = d->cloneNode(true); //copy d and ownerElement of n
+		((AttrImpl *) d)->setOwnerElement(((AttrImpl *) n)->getOwnerElement());
+	    }
+            nodes->setElementAt(d, i);
+	} else
+            nodes->removeElementAt(i);
+        
+        ++changes;
+        n->owned = false;
+        return n;
+    }
+    
+    /************
+    // DO BINARY SEARCH????? 
+    // At least take advantage of sort-order for early stop.
+    if (nodes != null)
+    {
+    for (int i = 0; i < nodes.size(); ++i)
+    if (name.equals(((Node) (nodes.elementAt(i))).getNodeName()))
+    {
+    Node n = (Node) (nodes.elementAt(i));
+    // If there's a default, add it instead
+    Node d;
+    if (defaults != null && 
+    (d = defaults.getNamedItem(name)) != null)
+    nodes.setElementAt(d, i);
+    else
+    nodes.removeElementAt(i);
+    
+      ++changes;
+      return n;
+      }
+      }
+      throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR, null);
+    **************/ 
+	return null;	// just to keep the compiler happy
+};
+
+
+
+void NamedNodeMapImpl::removeRef(NamedNodeMapImpl *This)
+{
+    if (This && --This->refCount == 0)
+        delete This;
+};
+
+//
+// setNamedItem()  Put the item into the NamedNodeList by name.
+//                  If an item with the same name already was
+//                  in the list, replace it.  Return the old
+//                  item, if there was one.
+//                  Caller is responsible for arranging for
+//                  deletion of the old item if its ref count is
+//                  zero.
+//
+NodeImpl * NamedNodeMapImpl::setNamedItem(NodeImpl * arg)
+{
+    if(arg->getOwnerDocument()!=ownerDoc)
+        throw new DOM_DOMException(DOM_DOMException::WRONG_DOCUMENT_ERR,null);
+    
+    if (arg->owned)
+        throw new DOM_DOMException(DOM_DOMException::INUSE_ATTRIBUTE_ERR,null);
+    
+    arg->owned = true;
+    int i=findNamePoint(arg->getNodeName());
+    NodeImpl * previous=null;
+    if(i>=0)
+    {
+        previous = nodes->elementAt(i);
+        nodes->setElementAt(arg,i);
+    }
+    else
+    {
+        i=-1-i; // Insert point (may be end of list)
+        if(null==nodes)
+            nodes=new NodeVector();
+        nodes->insertElementAt(arg,i);
+    }
+    ++changes;
+    if (previous != null)
+        previous->owned = false;
+
+    return previous;
+    
+    /*************************      
+    // DO BINARY SEARCH?????
+    // Insertion-sort is used to maintain list in lexical order.  That
+    // doesn't matter a great deal in normal operation (minor
+    // performance boost in getNamedItem), but improves comparison
+    // for reconcileDefault() (and equals(), if we add that.)
+    if(nodes==null)
+    nodes=new Vector();
+    for(int i=0; i<nodes.size();++i)
+    {
+    int test=arg.getNodeName()
+    .compareTo( ((Node)(nodes.elementAt(i))) .getNodeName());
+    if(test==0)
+    {                     // Names match
+    Node previous=(Node)nodes.elementAt(i);
+    nodes.setElementAt(arg,i);
+    ++changes;
+    return previous;
+    }
+    else if(test<0)
+    {                     // Mismatch but new goes before old
+    nodes.insertElementAt(arg,i);
+    ++changes;
+    return null;
+    }
+    }
+    nodes.addElement(arg);      // Bigger than all, append to end
+    ++changes;
+    return null;
+    ************/   
+};
+
+
+void NamedNodeMapImpl::setReadOnly(bool readOnl, bool deep)
+{
+    this->readOnly=readOnl;
+    if(deep && nodes!=null)
+    {
+        //Enumeration e=nodes->elements();
+        //while(e->hasMoreElements())
+        //      ((NodeImpl)e->nextElement())->setReadOnly(readOnl,deep);
+        int sz = nodes->size();
+        for (int i=0; i<sz; ++i) {
+            nodes->elementAt(i)->setReadOnly(readOnl, deep);
+        }
+    }
+};
+
+
+//Introduced in DOM Level 2
+
+int NamedNodeMapImpl::findNamePoint(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    reconcileDefaults();
+    if (nodes == null)
+	return -1;
+   // Linear search
+    int i, len = nodes -> size();
+    for (i = 0; i < len; ++i) {
+	NodeImpl *node = nodes -> elementAt(i);
+	if (! node -> getNamespaceURI().equals(namespaceURI))	//URI not match
+	    continue;
+	if (node -> getLocalName().equals(localName))	//both match
+	    return i;
+    }
+    return -1;	//not found
+}
+
+
+NodeImpl *NamedNodeMapImpl::getNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &localName)
+{
+    if (namespaceURI == null || namespaceURI.length() == 0)
+	return getNamedItem(localName);
+    int i = findNamePoint(namespaceURI, localName);
+    return i < 0 ? null : nodes -> elementAt(i);
+}
+
+
+// removeNamedItemNS() - Remove the named item, and return it.
+//                      The caller must arrange for deletion of the 
+//                      returned item if its refcount has gone to zero -
+//                      we can't do it here because the caller would
+//                      never see the returned node.
+NodeImpl *NamedNodeMapImpl::removeNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &name)
+{
+    if (readOnly)
+	throw new DOM_DOMException(
+	    DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    if (namespaceURI == null || namespaceURI.length() == 0)
+	return removeNamedItem(name);
+    int i = findNamePoint(namespaceURI, name);
+    if (i < 0)
+	throw new DOM_DOMException(DOM_DOMException::NOT_FOUND_ERR, null);
+    NodeImpl * n = nodes -> elementAt(i);   //node to be removed or replaced
+    //find if n has a default value defined in DTD, if so replace n in nodes
+    //by its corresponding default value node, otherwise remove n from nodes
+    NodeImpl * d;
+    if (defaults != null && (d = defaults->getNamedItemNS(namespaceURI, name)) != null) {
+	if (n->isAttrImpl() && d->isAttrImpl()) {
+	    d = d->cloneNode(true); //copy d and ownerElement of n
+	    ((AttrImpl *) d)->setOwnerElement(((AttrImpl *) n)->getOwnerElement());
+	}
+        nodes -> setElementAt(d, i);	//replace n in nodes by d
+    } else
+        nodes -> removeElementAt(i);	//remove n from nodes
+    ++changes;
+    n -> owned = false;
+    return n;
+}
diff --git a/src/dom/NamedNodeMapImpl.hpp b/src/dom/NamedNodeMapImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..2475a3c726c44cb2eb2ce64d80d46c57338ebde9
--- /dev/null
+++ b/src/dom/NamedNodeMapImpl.hpp
@@ -0,0 +1,131 @@
+#ifndef NamedNodeMapImpl_HEADER_GUARD_
+#define NamedNodeMapImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:12  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:29  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+
+class NodeVector;
+class DocumentImpl;
+class NodeImpl;
+
+class NamedNodeMapImpl {
+private:
+    NodeVector       *nodes;
+    DocumentImpl     *ownerDoc;   
+    
+    NamedNodeMapImpl *defaults;
+    int               changes;    
+    int               lastDefaultsChanges;
+    bool              readOnly;
+    int               refCount;
+    static int        gLiveNamedNodeMaps;
+    static int        gTotalNamedNodeMaps;
+    
+    
+    friend class      DOM_NamedNodeMap;
+    friend class      DomMemDebug;
+    friend class      ElementImpl;
+    
+public:
+    NamedNodeMapImpl(DocumentImpl *ownerDoc, NamedNodeMapImpl *defaults);
+    
+    virtual void            reconcileDefaults();
+    virtual                 ~NamedNodeMapImpl();
+    virtual NamedNodeMapImpl *cloneMap();
+    static  void            addRef(NamedNodeMapImpl *);
+    virtual int             findNamePoint(const DOMString &name);
+    virtual int             getLength();
+    virtual NodeImpl        *getNamedItem(const DOMString &name);
+    virtual NodeImpl        *item(int index);
+    virtual void            removeAll();
+    virtual NodeImpl        *removeNamedItem(const DOMString &name);
+    static  void            removeRef(NamedNodeMapImpl *);
+    virtual NodeImpl        *setNamedItem(NodeImpl *arg);
+    virtual void            setReadOnly(bool readOnly, bool deep);
+
+    //Introduced in DOM Level 2
+    virtual int             findNamePoint(const DOMString &namespaceURI,
+	const DOMString &localName);
+    virtual NodeImpl        *getNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &localName);
+    virtual NodeImpl        *removeNamedItemNS(const DOMString &namespaceURI,
+	const DOMString &name);
+};
+
+#endif
+
diff --git a/src/dom/NodeFilterImpl.cpp b/src/dom/NodeFilterImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..859915c91af824152e2d440be0b4c7f0f3c5e94c
--- /dev/null
+++ b/src/dom/NodeFilterImpl.cpp
@@ -0,0 +1,95 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:12  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:29  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// NodeFilterImpl.cpp: implementation of the NodeFilterImpl class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "NodeFilterImpl.hpp"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+NodeFilterImpl::NodeFilterImpl ()
+{
+}
+
+
+NodeFilterImpl::~NodeFilterImpl ()
+{
+}
+
+
+NodeFilterImpl& NodeFilterImpl::operator= (const NodeFilterImpl& other) {
+    return *this;
+}
+
+
+void NodeFilterImpl::unreferenced ()
+{
+    delete this;
+}
\ No newline at end of file
diff --git a/src/dom/NodeFilterImpl.hpp b/src/dom/NodeFilterImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..8ef6d7d9e3a76488012f0d64e3613ff478496c22
--- /dev/null
+++ b/src/dom/NodeFilterImpl.hpp
@@ -0,0 +1,90 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:13  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:29  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef NodeIteratorImpl_HEADER_GUARD_
+#define NodeIteratorImpl_HEADER_GUARD_
+
+
+// NodeIteratorImpl.hpp: interface for the NodeIteratorImpl class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "DOM_Node.hpp"
+#include "DOM_NodeFilter.hpp"
+#include "RefCountedImpl.hpp"
+
+
+class CDOM_EXPORT NodeFilterImpl : public RefCountedImpl {
+	public:
+		virtual ~NodeFilterImpl ();
+		NodeFilterImpl ();
+    NodeFilterImpl& operator= (const NodeFilterImpl& other);
+		virtual DOM_NodeFilter::FilterAction acceptNode (DOM_Node node) = 0;
+
+    virtual void unreferenced();
+};
+
+#endif 
diff --git a/src/dom/NodeImpl.cpp b/src/dom/NodeImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e1ad40d9a9c176e1e24e1fad1afd98f0cbe45776
--- /dev/null
+++ b/src/dom/NodeImpl.cpp
@@ -0,0 +1,653 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:13  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:29  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include "NodeImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DOM_Node.hpp"
+#include "DOMString.hpp"
+#include "DocumentImpl.hpp"
+#include "stdio.h"
+#include <util/XMLString.hpp>
+#include <util/XMLUni.hpp>
+
+NodeImpl::NodeImpl(DocumentImpl *ownerDoc,
+                   const DOMString &nam,  short nTyp,
+                   bool isLeafNod, const DOMString &initValue)
+{
+    // Do we want to add isLeafNode to this? How about initial value?
+    this->ownerDocument=ownerDoc;
+    this->namespaceURI=null;	//DOM Level 2
+    this->prefix=null;		//DOM Level 2
+    this->localName=nam;	//DOM Level 2
+    this->name=nam;
+    this->nType=nTyp;
+    this->isLeafNode=isLeafNod;
+    this->value=initValue;
+    
+    this->changes = 0;
+    this->userData = null;
+    this->readOnly = false;
+    this->owned    = false;
+    this->firstChild = null;
+    this->lastChild  = null;
+    this->previousSibling  = null;
+    this->nextSibling  = null;
+    this->parentNode  = null;
+    
+    this->nodeRefCount = 0;
+    NodeImpl::gLiveNodeImpls++; 
+    NodeImpl::gTotalNodeImpls++;
+};  
+
+
+//Introduced in DOM Level 2
+NodeImpl::NodeImpl(DocumentImpl *ownerDoc,
+	const DOMString &namespaceURI, const DOMString &qualifiedName, short nTyp,
+        bool isLeafNod, const DOMString &initValue)
+{
+    // Do we want to add isLeafNode to this? How about initial value?
+    this->ownerDocument=ownerDoc;
+    this->namespaceURI=namespaceURI;
+    int index = XMLString::indexOf(qualifiedName.rawBuffer(), chColon);
+    if (index >= 0) {
+	this->prefix = qualifiedName.substringData(0, index);
+	int len = qualifiedName.length() - index - 1;
+	this->localName = qualifiedName.substringData(index+1, len);
+    } else {
+	this->prefix = null;
+	this->localName = qualifiedName;
+    }
+    this->name=qualifiedName;
+    this->nType=nTyp;
+    this->isLeafNode=isLeafNod;
+    this->value=initValue;
+    
+    this->changes = 0;
+    this->userData = null;
+    this->readOnly = false;
+    this->owned    = false;
+    this->firstChild = null;
+    this->lastChild  = null;
+    this->previousSibling  = null;
+    this->nextSibling  = null;
+    this->parentNode  = null;
+    
+    this->nodeRefCount = 0;
+    NodeImpl::gLiveNodeImpls++; 
+    NodeImpl::gTotalNodeImpls++;
+};  
+
+
+NodeImpl::NodeImpl(const NodeImpl &other, bool deep) {
+    this->nType = other.nType;
+    this->namespaceURI = other.namespaceURI.clone();	//DOM Level 2
+    this->prefix = other.prefix.clone();		//DOM Level 2
+    this->localName = other.localName.clone();		//DOM Level 2
+    this->name  = other.name.clone();
+    this->value = other.value.clone();
+    this->isLeafNode = other.isLeafNode;
+    this->readOnly = false;
+    this->owned = false;
+    this->ownerDocument = other.ownerDocument;
+    this->userData = other.userData;
+    this->changes = 0;
+    
+    this->nodeRefCount = 0;
+    NodeImpl::gLiveNodeImpls++; 
+    NodeImpl::gTotalNodeImpls++;
+
+    
+    // Need to break the association w/ original kids
+    this->previousSibling = null;
+    this->nextSibling = null;
+    this->parentNode = null;
+    this->firstChild = null;
+    this->lastChild = null;
+    
+    // Then, if deep, clone the kids too.
+    if (deep)
+    {
+        for (NodeImpl *mykid = other.firstChild; 
+        mykid != null; 
+        mykid = mykid->nextSibling)
+            this->appendChild(mykid->cloneNode(true));
+    }
+    
+};
+
+
+int  NodeImpl::gLiveNodeImpls = 0;         // Counters for debug & tuning.
+int  NodeImpl::gTotalNodeImpls= 0;
+    
+
+
+NodeImpl::~NodeImpl() {
+     NodeImpl::gLiveNodeImpls--;
+};
+
+
+// Dynamic Cast substitute functions
+bool NodeImpl::isAttrImpl()              {return false;};
+bool NodeImpl::isCDATASectionImpl()      {return false;};
+bool NodeImpl::isDocumentFragmentImpl()  {return false;};
+bool NodeImpl::isDocumentImpl()          {return false;};
+bool NodeImpl::isDocumentTypeImpl()      {return false;};
+bool NodeImpl::isElementImpl()           {return false;};
+bool NodeImpl::isEntityReference()       {return false;};
+bool NodeImpl::isTextImpl()              {return false;};
+
+
+NodeImpl * NodeImpl::appendChild(NodeImpl *newChild)      
+{
+    return insertBefore(newChild, null);
+};
+
+
+
+void NodeImpl::changed()
+{
+    for (NodeImpl *n=this; n != null; n=n->parentNode)
+        ++n->changes;
+};  
+
+
+NodeImpl * NodeImpl::cloneNode(bool deep) {
+    NodeImpl *newnode;
+    newnode = new NodeImpl(*this, deep);
+    return newnode;
+};
+
+
+//  NodeImpl::deleteIf is called when a node's reference count goes
+//  to 0.  It is separate function from removeRef because removeRef
+//  is likely to be in-lined.
+//
+//  See comments at RefCountedImpl::removeRef().
+//
+void NodeImpl::deleteIf(NodeImpl *thisNode)
+{
+    if (thisNode == 0)
+        return;
+    
+    if (thisNode->parentNode != 0 || thisNode->owned)
+        return;
+    
+    // Delete this node.  There should be no siblings, as the DOM
+    //  supports no node operations that would detach a node from
+    //  its parent while retaining siblings.
+    //  The target node may have children, in which case they must
+    //  be removed from this node before deleting this node.
+    thisNode->readOnly = false;   // removeChild requires node not be readonly.
+    NodeImpl *theNextChild;
+    for (NodeImpl *child = thisNode->firstChild; child != 0; child=theNextChild)
+    {
+        theNextChild = child->nextSibling;
+        thisNode->removeChild(child);
+        if (child->nodeRefCount == 0)
+            deleteIf(child);
+    }
+    delete thisNode;
+};
+
+
+
+NamedNodeMapImpl * NodeImpl::getAttributes() {
+    return null; // overridden in ElementImpl
+};
+
+
+NodeListImpl *NodeImpl::getChildNodes() {
+    return this;
+};
+
+
+
+NodeImpl * NodeImpl::getFirstChild() {
+    return firstChild;
+}; 
+
+
+NodeImpl * NodeImpl::getLastChild()
+{
+    return lastChild;
+}; 
+
+
+int NodeImpl::getLength() {
+    int count = 0;
+    NodeImpl *node = firstChild;
+    while(node != null)
+    {
+        ++count;
+        node = node->nextSibling;
+    }
+    return count;
+};
+
+
+NodeImpl * NodeImpl::getNextSibling() {
+    return nextSibling;
+}; 
+
+
+
+DOMString NodeImpl::getNodeName() {
+    return name;
+};
+
+
+short NodeImpl::getNodeType()
+{
+    return nType;
+};
+
+
+
+DOMString NodeImpl::getNodeValue()
+{
+    return value;
+};
+
+
+DocumentImpl *NodeImpl::getOwnerDocument()
+{
+    return ownerDocument;
+};  
+
+
+NodeImpl * NodeImpl::getParentNode()
+{
+    return parentNode;
+};  
+
+
+NodeImpl*  NodeImpl::getPreviousSibling()
+{
+    return previousSibling;
+}; 
+
+
+void *NodeImpl::getUserData()
+{
+    return userData;
+};  
+
+
+bool NodeImpl::hasChildNodes()
+{ 
+    return firstChild!=null;
+}; 
+
+
+
+NodeImpl *NodeImpl::insertBefore(NodeImpl *newChild, NodeImpl *refChild) {
+    if (readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    
+    if(  !(newChild->getOwnerDocument() == ownerDocument   ||
+        // SPECIAL-CASE: Document has no owner, but may be the owner.
+        ( this->isDocumentImpl() &&
+        newChild->getOwnerDocument() == (DocumentImpl *)this ) 
+        ) )
+        throw new DOM_DOMException(DOM_DOMException::WRONG_DOCUMENT_ERR, null);
+    
+    // Convert to internal type, to avoid repeated casting  
+    //   (left over from the original Java.  Meaningless in this version.)
+    NodeImpl * newInternal= newChild;
+    
+    // Prevent cycles in the tree
+    bool treeSafe=true;
+    for(NodeImpl *a=this->parentNode;treeSafe && a!=null;a=a->parentNode)
+        treeSafe=(newInternal!=a);
+    if(!treeSafe)
+        throw new DOM_DOMException(DOM_DOMException::HIERARCHY_REQUEST_ERR,null);
+    
+    // refChild must in fact be a child of this node (or null)
+    if(refChild!=null && refChild->parentNode != this)
+        throw new DOM_DOMException(DOM_DOMException::NOT_FOUND_ERR,null);
+    
+    if (newInternal->isDocumentFragmentImpl())
+    {
+        // SLOW BUT SAFE: We could insert the whole subtree without
+        // juggling so many next/previous pointers. (Wipe out the
+        // parent's child-list, patch the parent pointers, set the
+        // ends of the list.) But we know some subclasses have special-
+        // case behavior they add to insertBefore(), so we don't risk it.
+        // This approch also takes fewer bytecodes.
+        
+        // NOTE: If one of the children is not a legal child of this
+        // node, throw HIERARCHY_REQUEST_ERR before _any_ of the children
+        // have been transferred. (Alternative behaviors would be to
+        // reparent up to the first failure point or reparent all those
+        // which are acceptable to the target node, neither of which is
+        // as robust. PR-DOM-0818 isn't entirely clear on which it
+        // recommends?????
+        
+        // No need to check kids for right-document; if they weren't,
+        // they wouldn't be kids of that DocFrag.
+        for(NodeImpl *kid=newInternal->getFirstChild(); // Prescan
+        kid!=null;
+        kid=kid->getNextSibling())
+        {
+            if(!isKidOK(this,kid))
+                throw new DOM_DOMException(DOM_DOMException::HIERARCHY_REQUEST_ERR,null);
+        }                       
+        while(newInternal->hasChildNodes())     // Move
+            insertBefore(newInternal->getFirstChild(),refChild);
+    }
+    
+    else if(!isKidOK(this, newInternal))
+        throw new DOM_DOMException(DOM_DOMException::HIERARCHY_REQUEST_ERR,null);
+    
+    else
+    {
+        NodeImpl *oldparent=newInternal->parentNode;
+        if(oldparent!=null)
+            oldparent->removeChild(newInternal);
+        
+        NodeImpl *prev;
+        // Find the node we're inserting after, if any (null if
+        // inserting to head of list)
+        prev= (refChild==null)
+            ? lastChild
+            : refChild->previousSibling;
+        
+        // Attach up
+        newInternal->parentNode=this;
+        
+        // Attach after
+        newInternal->previousSibling=prev;
+        if(prev==null)
+            firstChild=newInternal;
+        else
+            prev->nextSibling=newInternal;
+        
+        // Attach before
+        newInternal->nextSibling = refChild;
+        if(refChild==null)
+            lastChild=newInternal;
+        else
+            refChild->previousSibling=newInternal;
+    }
+    changed();
+    
+    return newInternal;
+};
+
+
+/** Uses the kidOK lookup table to check whether the proposed
+tree structure is legal.
+
+  ????? It feels like there must be a more efficient solution,
+  but for the life of me I can't think what it would be.
+  */
+  bool NodeImpl::isKidOK(NodeImpl *parent, NodeImpl *child)
+  {
+      static int kidOK[13];
+      
+      if (kidOK[DOM_Node::DOCUMENT_NODE] == 0)
+      {
+          kidOK[DOM_Node::DOCUMENT_NODE] = 
+              1 << DOM_Node::ELEMENT_NODE |
+              1 << DOM_Node::PROCESSING_INSTRUCTION_NODE | 
+              1 << DOM_Node::COMMENT_NODE | 
+              1 << DOM_Node::DOCUMENT_TYPE_NODE;
+          
+          kidOK[DOM_Node::DOCUMENT_FRAGMENT_NODE] = 
+              kidOK[DOM_Node::ENTITY_NODE] = 
+              kidOK[DOM_Node::ENTITY_REFERENCE_NODE] = 
+              kidOK[DOM_Node::ELEMENT_NODE] = 
+              1 << DOM_Node::ELEMENT_NODE |
+              1 << DOM_Node::PROCESSING_INSTRUCTION_NODE | 
+              1 << DOM_Node::COMMENT_NODE |
+              1 << DOM_Node::TEXT_NODE |
+              1 << DOM_Node::CDATA_SECTION_NODE |
+              1 << DOM_Node::ENTITY_REFERENCE_NODE;
+          
+          kidOK[DOM_Node::DOCUMENT_TYPE_NODE] = 
+              1 << DOM_Node::NOTATION_NODE |
+              1 << DOM_Node::ENTITY_NODE;
+          
+          kidOK[DOM_Node::ATTRIBUTE_NODE] = 
+              1 << DOM_Node::TEXT_NODE |
+              1 << DOM_Node::ENTITY_REFERENCE_NODE;
+          
+          kidOK[DOM_Node::PROCESSING_INSTRUCTION_NODE] = 
+              kidOK[DOM_Node::COMMENT_NODE] = 
+              kidOK[DOM_Node::TEXT_NODE] = 
+              kidOK[DOM_Node::CDATA_SECTION_NODE] = 
+              kidOK[DOM_Node::NOTATION_NODE] = 
+              0;
+      };
+      int p=parent->getNodeType();
+      int ch = child->getNodeType();
+      return (kidOK[p] & 1<<ch) != 0;
+  };
+  
+  
+  
+  NodeImpl *NodeImpl::item(int index) {
+      NodeImpl *node = firstChild;
+      for(int i=0; i<index && node!=null; ++i)
+          node = node->nextSibling;
+      return node;
+  };
+  
+  
+  void NodeImpl::referenced()
+  {
+      RefCountedImpl::addRef(this->ownerDocument);
+  };
+
+
+  
+  NodeImpl *NodeImpl::removeChild(NodeImpl *oldChild) 
+  {
+      if (readOnly)
+          throw new DOM_DOMException(
+          DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+      
+      if (oldChild != null && oldChild->parentNode != this)
+          throw new DOM_DOMException(DOM_DOMException::NOT_FOUND_ERR, null);
+      
+      // Patch tree past oldChild
+      NodeImpl *prev = oldChild->previousSibling;
+      NodeImpl *next = oldChild->nextSibling;
+      if (prev != null)
+          prev->nextSibling = next;
+      else
+          firstChild = next;
+      if (next != null)
+          next->previousSibling = prev;
+      else
+          lastChild = prev;
+      
+      // Remove oldChild's references to tree
+      oldChild->parentNode = null;
+      oldChild->nextSibling = null;
+      oldChild->previousSibling = null;
+      changed();
+      return oldChild;
+  };
+  
+  
+  //
+  //    unreferenced  will be called whenever the refernce count on
+  //            this node goes from 1 to 0.  This node will only be
+  //            directly deleted here  (by deleteIf) if it is outside 
+  //            of the document tree.  
+  //
+  void NodeImpl::unreferenced()
+  {
+      DocumentImpl *doc = this->ownerDocument;
+      deleteIf(this);       // This gets nodes outside of the document -
+                            //   deleteIf() deletes only if the parent
+                            //   node is null.  
+      
+      // If this was the last external reference within the document,
+      //    the entire document will be deleted as well.
+      RefCountedImpl::removeRef(doc);
+  };
+  
+  
+  
+  NodeImpl *NodeImpl::replaceChild(NodeImpl *newChild, NodeImpl *oldChild)
+  {
+  /********* insertBefore should already do this test. ****************
+  if (newChild.getOwnerDocument() != ownerDocument
+  // SPECIAL-CASE: Document has no Owner.
+  &&
+  this instanceof Document && 
+  newChild.getOwnerDocument() != (Document) this)
+  {
+  throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR, null);
+  }
+      *********************************************************************/
+      insertBefore(newChild, oldChild);
+      // changed() already done.
+      return removeChild(oldChild);
+  };
+  
+  
+  
+  
+  void NodeImpl::setNodeValue(const DOMString &val)
+  {
+      if (readOnly)
+          throw new DOM_DOMException(
+          DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+      
+      // Default behavior, overridden in some subclasses
+      this->value = val;
+  };
+  
+  
+  
+  
+  void NodeImpl::setReadOnly(bool readOnl, bool deep)
+  {
+      this->readOnly = readOnl;
+      
+      if (deep)
+          // Recursively set kids
+          for (NodeImpl *mykid = firstChild; 
+          mykid != null; 
+          mykid = mykid->nextSibling)
+              if(! (mykid->isEntityReference()))
+                  mykid->setReadOnly(readOnl,true);
+  };
+  
+  
+  
+  void NodeImpl::setUserData(void * val)
+  {
+      userData = val;
+  };  
+  
+  
+  
+  DOMString NodeImpl::toString()
+  {
+      return DOMString("[")+getNodeName()+": "+getNodeValue()+"]";
+      // return getNodeName();
+  };    
+  
+//Introduced in DOM Level 2
+
+bool NodeImpl::supports(const DOMString &feature, const DOMString &version)
+{
+    return false;   //must be overriden by each subclass
+}
+
+DOMString NodeImpl::getNamespaceURI()
+{
+    return namespaceURI;
+}
+
+DOMString NodeImpl::getPrefix()
+{
+    return prefix;
+}
+
+DOMString NodeImpl::getLocalName()
+{
+    return localName;
+}
+
+void NodeImpl::setPrefix(const DOMString &prefix)
+{
+    if (readOnly)
+	throw new DOM_DOMException(
+	    DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+    if (isAttrImpl() || isElementImpl()) {
+	name = this -> prefix = prefix;
+	name = name + chColon + localName;    //nodeName is changed too
+	//what to do if namespaceURI is null?
+    }
+
+}
diff --git a/src/dom/NodeImpl.hpp b/src/dom/NodeImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..6e7bc9ca2aa8687eda3e27f5b76691be92f03303
--- /dev/null
+++ b/src/dom/NodeImpl.hpp
@@ -0,0 +1,187 @@
+#ifndef NodeImpl_HEADER_GUARD_
+#define NodeImpl_HEADER_GUARD_
+
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:14  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:30  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeListImpl.hpp"
+#include "DOMString.hpp"
+
+
+class NamedNodeMapImpl;
+class NodeListImpl;
+class DocumentImpl;
+
+//  define 'null' is used extensively in the DOM implementation code, 
+//  as a consequence of its Java origins.
+//  MSVC 5.0 compiler has problems with overloaded function resolution
+//	when using the const int definition.
+//
+#if defined(XML_CSET)
+const int null = 0;
+#else
+#define null 0
+#endif
+
+
+class  NodeImpl: public NodeListImpl {
+public:
+    short                   nType;                  // Node type (see Node. constants)
+    DOMString               name;                   // Name of this node or node type
+    DOMString               value;                  // String value (not used in all nodes)
+    bool                    isLeafNode;             // If true, no children permitted
+    bool                    readOnly;
+    bool                    owned;                  // True if there is a reference to this
+                                                    //  node in a named node list.  Applies to
+                                                    //  attributes, notations, entities.
+    DocumentImpl            *ownerDocument;         // Document this node belongs to
+    NodeImpl                *previousSibling;
+    NodeImpl                *nextSibling;
+    NodeImpl                *parentNode;
+    NodeImpl                *firstChild;
+    NodeImpl                *lastChild;
+    int changes;
+    void *userData;
+
+    static int              gLiveNodeImpls;         // Counters for debug & tuning.
+    static int              gTotalNodeImpls;
+
+    //Introduced in DOM Level 2
+    DOMString		    namespaceURI;	    //namespace URI of this node
+    DOMString		    prefix;		    //namespace prefix of this node
+    DOMString		    localName;		    //local part of qualified name
+    
+public:
+    NodeImpl(DocumentImpl *ownerDocument,
+        const DOMString &name,  short nType,
+        bool isLeafNode, const DOMString &initValue);
+    NodeImpl(DocumentImpl *ownerDocument,   //Introduced in DOM Level 2
+	const DOMString &namespaceURI, const DOMString &qualifiedName, short nType,
+        bool isLeafNode, const DOMString &initValue);
+    NodeImpl(const NodeImpl &other, bool deep=false);
+    virtual ~NodeImpl();
+    NodeImpl        *clone();
+    
+    // Dynamic Cast replacement functions.
+    virtual bool isAttrImpl();
+    virtual bool isCDATASectionImpl();
+    virtual bool isDocumentFragmentImpl();
+    virtual bool isDocumentImpl();
+    virtual bool isDocumentTypeImpl();
+    virtual bool isElementImpl();
+    virtual bool isEntityReference();
+    virtual bool isTextImpl();
+
+    virtual NodeImpl *appendChild(NodeImpl *newChild);
+    virtual void changed();
+    virtual NodeImpl * cloneNode(bool deep);
+    static void deleteIf(NodeImpl *thisNode);
+    virtual NamedNodeMapImpl * getAttributes();
+    virtual NodeListImpl *getChildNodes();
+    virtual NodeImpl * getFirstChild();
+    virtual NodeImpl * getLastChild();
+    virtual int getLength();
+    virtual NodeImpl * getNextSibling();
+    virtual DOMString getNodeName();
+    virtual short getNodeType();
+    virtual DOMString getNodeValue();
+    virtual DocumentImpl * getOwnerDocument();
+    virtual NodeImpl * getParentNode();
+    virtual NodeImpl*  getPreviousSibling();
+    virtual void *getUserData();
+    virtual bool        hasChildNodes();
+    virtual NodeImpl    *insertBefore(NodeImpl *newChild, NodeImpl *refChild);
+    static  bool        isKidOK(NodeImpl *parent, NodeImpl *child);
+    virtual NodeImpl    *item(int index);
+    virtual void        referenced();
+    virtual NodeImpl    * removeChild(NodeImpl *oldChild);
+    virtual NodeImpl    *replaceChild(NodeImpl *newChild, NodeImpl *oldChild);
+    virtual void        setNodeValue(const DOMString &value);
+    virtual void        setReadOnly(bool readOnly, bool deep);
+    virtual void        setUserData(void *value);
+    virtual DOMString   toString();
+    virtual void        unreferenced();
+
+    //Introduced in DOM Level 2
+    virtual bool supports(const DOMString &feature, const DOMString &version);
+    virtual DOMString         getNamespaceURI();
+    virtual DOMString         getPrefix();
+    virtual DOMString         getLocalName();
+    virtual void              setPrefix(const DOMString &prefix);
+};
+
+
+#endif
diff --git a/src/dom/NodeIteratorImpl.cpp b/src/dom/NodeIteratorImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9eb64f69a5e26c7aeb597d3ccd8e5769403a8ae1
--- /dev/null
+++ b/src/dom/NodeIteratorImpl.cpp
@@ -0,0 +1,419 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:15  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:30  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// NodeIteratorImpl.cpp: implementation of the NodeIteratorImpl class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "NodeIteratorImpl.hpp"
+#include "DOM_Document.hpp"
+#include "DOM_DOMException.hpp"
+#include "DocumentImpl.hpp"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+NodeIteratorImpl::NodeIteratorImpl ()
+{
+	fDetached = false;
+}
+
+NodeIteratorImpl::~NodeIteratorImpl ()
+{
+	fDetached = false;
+}
+
+
+void NodeIteratorImpl::detach ()
+{
+	fDetached = true;
+}
+
+
+NodeIteratorImpl::NodeIteratorImpl (DOM_Node root, int whatToShow, DOM_NodeFilter nodeFilter, NodeFilterImpl* fi)
+{
+	fDetached = false;
+    fRoot = root;
+    fCurrentNode = 0L;
+    fWhatToShow = whatToShow;
+    fNodeFilter = nodeFilter;
+
+    if (fi != 0L) {
+        DOM_NodeFilter nf(fi);
+        fNodeFilter = nf;
+    }
+
+	fForward = true;
+}
+
+
+NodeIteratorImpl& NodeIteratorImpl::operator= (const NodeIteratorImpl& other) {
+    fRoot = other.fRoot;
+    fCurrentNode = other.fRoot;
+    fWhatToShow = other.fWhatToShow;
+    fNodeFilter = other.fNodeFilter;
+    fForward = other.fForward;
+	fDetached = other.fDetached;
+
+    return *this;
+}
+
+
+
+// Implementation Note: Note that the iterator looks at whatToShow
+// and filter values at each call, and therefore one _could_ add
+// setters for these values and alter them while iterating!
+
+/** Return the whatToShow value */
+
+int NodeIteratorImpl::getWhatToShow () {
+    return fWhatToShow;
+}
+
+
+/** Return the filter */
+
+DOM_NodeFilter NodeIteratorImpl::getFilter () {
+    return fNodeFilter;
+}
+
+
+void NodeIteratorImpl::setWhatToShow (int what) {
+  fWhatToShow = what;
+}
+
+
+void NodeIteratorImpl::setFilter (DOM_NodeFilter filter) {
+  fNodeFilter = filter;
+}
+
+
+/** Return the next DOM_Node in the Iterator. The node is the next node in
+ *  depth-first order which also passes the filter, and whatToShow.
+ *  A null return means either that
+ */
+
+DOM_Node NodeIteratorImpl::nextNode () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+	DOM_Node result;
+
+    // if root is null there is no next node.
+    if (fRoot.isNull())
+			return result;
+
+    DOM_Node aNextNode = fCurrentNode;
+    bool accepted = false; // the next node has not been accepted.
+
+    while (!accepted) {
+
+        // if last direction is not forward, repeat node.
+        if (!fForward && !aNextNode.isNull()) {
+            //System.out.println("nextNode():!fForward:"+fCurrentNode.getNodeName());
+            aNextNode = fCurrentNode;
+        } else {
+        // else get the next node via depth-first
+            aNextNode = nextNode(aNextNode, true);
+        }
+
+        fForward = true; //REVIST: should direction be set forward before null check?
+
+        // nothing in the list. return null.
+        if (aNextNode.isNull())
+					return result;
+
+        // does node pass the filters and whatToShow?
+        accepted = acceptNode(aNextNode);
+        if (accepted) {
+            // if so, then the node is the current node.
+            fCurrentNode = aNextNode;
+            return fCurrentNode;
+				}
+
+    }
+
+    // no nodes, or no accepted nodes.
+    return result;
+}
+
+
+/** Return the previous Node in the Iterator. The node is the next node in
+ *  _backwards_ depth-first order which also passes the filter, and whatToShow.
+ */
+
+DOM_Node NodeIteratorImpl::previousNode () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+		
+	DOM_Node result;
+
+    // if the root is null, or the current node is null, return null.
+    if (fRoot.isNull() || fCurrentNode.isNull())
+			return result;
+
+    DOM_Node aPreviousNode = fCurrentNode;
+    bool accepted = false;
+
+    while (!accepted) {
+
+        if (fForward && ! aPreviousNode.isNull()) {
+            //repeat last node.
+            aPreviousNode = fCurrentNode;
+        } else {
+            // get previous node in backwards depth first order.
+            aPreviousNode = previousNode(aPreviousNode);
+        }
+
+        // we are going backwards
+        fForward = false;
+
+        // if the new previous node is null, we're at head or past the root,
+        // so return null.
+        if (aPreviousNode.isNull())
+					return result;
+
+        // check if node passes filters and whatToShow.
+        accepted = acceptNode(aPreviousNode);
+        if (accepted) {
+            // if accepted, update the current node, and return it.
+            fCurrentNode = aPreviousNode;
+            return fCurrentNode;
+        }
+    }
+    // there are no nodes?
+    return result;
+}
+
+
+/** The node is accepted if it passes the whatToShow and the filter. */
+bool NodeIteratorImpl::acceptNode (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    if (fNodeFilter == 0) {
+        return ((fWhatToShow & ((1 << node.getNodeType()) - 1)) != 0);
+    } else {
+        return ((fWhatToShow & ((1 << node.getNodeType()) - 1)) != 0 )
+            && fNodeFilter.acceptNode(node) == DOM_NodeFilter::ACCEPT;
+    }
+}
+
+
+/** Return node, if matches or any parent if matches. */
+DOM_Node NodeIteratorImpl::matchNodeOrParent (DOM_Node node) {
+		DOM_Node result;
+
+    for (DOM_Node n = node; n != fRoot; n = n.getParentNode()) {
+        if (node == n) return n;
+    }
+
+    return result;
+}
+
+
+/** The method nextNode(DOM_Node, bool) returns the next node
+ *  from the actual DOM tree.
+ *
+ *  The bool visitChildren determines whether to visit the children.
+ *  The result is the nextNode.
+ */
+
+DOM_Node NodeIteratorImpl::nextNode (DOM_Node node, bool visitChildren) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    if (node.isNull()) return fRoot;
+
+    DOM_Node result;
+    // only check children if we visit children.
+    if (visitChildren) {
+        //if hasChildren, return 1st child.
+        if (node.hasChildNodes()) {
+            result = node.getFirstChild();
+            return result;
+        }
+    }
+
+    // if hasSibling, return sibling
+    result = node.getNextSibling();
+    if (! result.isNull()) return result;
+
+
+    // return parent's 1st sibling.
+    DOM_Node parent = node.getParentNode();
+    while (!parent.isNull() && parent != fRoot) {
+        result = parent.getNextSibling();
+        if (!result.isNull()) {
+            return result;
+        } else {
+            parent = parent.getParentNode();
+        }
+
+    } // while (parent != null && parent != fRoot) {
+
+    // end of list, return null
+		DOM_Node aNull;
+    return aNull;
+}
+
+
+/** The method previousNode(DOM_Node) returns the previous node
+ *  from the actual DOM tree.
+ */
+
+DOM_Node NodeIteratorImpl::previousNode (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    DOM_Node result;
+
+    // if we're at the root, return null.
+    if (node == fRoot)
+			return result;
+
+    // get sibling
+    result = node.getPreviousSibling();
+    if (result.isNull()) {
+        //if 1st sibling, return parent
+        result = node.getParentNode();
+        return result;
+    }
+
+    // if sibling has children, keep getting last child of child.
+    if (result.hasChildNodes()) {
+        while (result.hasChildNodes()) {
+            result = result.getLastChild();
+        }
+    }
+
+    return result;
+}
+
+
+/** Fix-up the iterator on a remove. Called by DOM or otherwise,
+ *  before an actual DOM remove.
+ */
+
+void NodeIteratorImpl::removeNode (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    // Implementation note: Fix-up means setting the current node properly
+    // after a remove.
+
+    if (node.isNull())
+				return;
+
+    DOM_Node deleted = matchNodeOrParent(node);
+
+    if (deleted.isNull()) return;
+
+    if (fForward) {
+        fCurrentNode = previousNode(deleted);
+    } else
+    // if (!fForward)
+    {
+        DOM_Node next = nextNode(deleted, false);
+        if (! next.isNull()) {
+            // normal case: there _are_ nodes following this in the iterator.
+            fCurrentNode = next;
+        } else {
+            // the last node in the iterator is to be removed,
+            // so we set the current node to be the previous one.
+            fCurrentNode = previousNode(deleted);
+            fForward = true;
+        }
+
+    }
+
+}
+
+
+void NodeIteratorImpl::unreferenced()
+{
+    DOM_Document doc = fRoot.getOwnerDocument();
+    DocumentImpl* impl;
+
+    if (! doc.isNull()) {
+        impl = (DocumentImpl *) doc.fImpl;
+    }
+    else
+        impl = (DocumentImpl *) fRoot.fImpl;
+
+    if (impl->iterators != 0L) {
+        int i;
+        int sz = impl->iterators->size();
+        for (i = 0; i < sz; i++)
+            if (impl->iterators->elementAt(i) == this) {
+                impl->iterators->removeElementAt(i);
+                break;
+            }
+    }
+
+    delete this;
+}
\ No newline at end of file
diff --git a/src/dom/NodeIteratorImpl.hpp b/src/dom/NodeIteratorImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..465efff81dcee030ea3e36875853e1699abeee00
--- /dev/null
+++ b/src/dom/NodeIteratorImpl.hpp
@@ -0,0 +1,146 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:16  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:30  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef NodeIteratorImpl_HEADER_GUARD_
+#define NodeIteratorImpl_HEADER_GUARD_
+
+
+// NodeIteratorImpl.hpp: interface for the NodeIteratorImpl class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "DOM_Node.hpp"
+#include "DOM_NodeIterator.hpp"
+#include "RefCountedImpl.hpp"
+
+
+class CDOM_EXPORT NodeIteratorImpl : public RefCountedImpl {
+	protected:
+		NodeIteratorImpl ();
+
+	public:
+		virtual ~NodeIteratorImpl ();
+		NodeIteratorImpl (DOM_Node root, int whatToShow, DOM_NodeFilter nodeFilter, NodeFilterImpl* fi);
+		NodeIteratorImpl& operator= (const NodeIteratorImpl& other);
+		virtual int getWhatToShow ();
+		virtual DOM_NodeFilter getFilter ();
+
+		void setWhatToShow (int what);
+		void setFilter (DOM_NodeFilter filter);
+
+		virtual DOM_Node nextNode ();
+		virtual DOM_Node previousNode ();
+		virtual bool acceptNode (DOM_Node node);
+		virtual DOM_Node matchNodeOrParent (DOM_Node node);
+		virtual DOM_Node nextNode (DOM_Node node, bool visitChildren);
+		virtual DOM_Node previousNode (DOM_Node node);
+		virtual void removeNode (DOM_Node node);
+
+		virtual void unreferenced();
+
+		virtual void detach ();
+
+
+	private:
+		//
+		// Data
+		//
+		/** The root. */
+		DOM_Node fRoot;
+
+		/** The whatToShow mask. */
+		int fWhatToShow;
+
+		/** The NodeFilter reference. */
+		DOM_NodeFilter fNodeFilter;
+
+		bool fDetached;
+
+		//
+		// Iterator state - current node and direction.
+		//
+		// Note: The current node and direction are sufficient to implement
+		// the desired behaviour of the current pointer being _between_
+		// two nodes. The fCurrentNode is actually the last node returned,
+		// and the
+		// direction is whether the pointer is in front or behind this node.
+		// (usually akin to whether the node was returned via nextNode())
+		// (eg fForward = true) or previousNode() (eg fForward = false).
+
+		/** The last Node returned. */
+		DOM_Node fCurrentNode;
+
+		/** The direction of the iterator on the fCurrentNode.
+		 *  <pre>
+		 *  nextNode()  ==      fForward = true;
+		 *  previousNode() ==   fForward = false;
+		 *  </pre>
+		 */
+		bool fForward;
+
+};
+
+#endif
diff --git a/src/dom/NodeListImpl.cpp b/src/dom/NodeListImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6a5485f5e8b412ad9c2da0d4261bcd0ad7701e71
--- /dev/null
+++ b/src/dom/NodeListImpl.cpp
@@ -0,0 +1,73 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:16  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:31  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include "NodeListImpl.hpp"
+
+NodeListImpl::NodeListImpl() {};
+
+NodeListImpl::~NodeListImpl() {};
+
diff --git a/src/dom/NodeListImpl.hpp b/src/dom/NodeListImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..59b7a573d89317c6573a1d3efe01534843a4dec0
--- /dev/null
+++ b/src/dom/NodeListImpl.hpp
@@ -0,0 +1,96 @@
+#ifndef NodeListImpl_HEADER_GUARD_
+#define NodeListImpl_HEADER_GUARD_
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:17  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:31  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "RefCountedImpl.hpp"
+
+class  NodeImpl;
+
+
+class  NodeListImpl : public RefCountedImpl
+{
+protected:
+    NodeListImpl();
+public:
+    virtual             ~NodeListImpl();
+    virtual NodeImpl *  item(int index) = 0;
+    virtual int         getLength() = 0;
+};
+
+#endif
+
+
diff --git a/src/dom/NodeVector.cpp b/src/dom/NodeVector.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fd08a67936d18b53da0742021b19f324aa0f77ec
--- /dev/null
+++ b/src/dom/NodeVector.cpp
@@ -0,0 +1,178 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:17  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:31  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//	file:   NodeVector.cpp
+//			Implementation of class NodeVector.
+//			(Use of STL vector, or equivalent, would have been nice,
+//			but is not available.  'NodeImpl *' is the only type
+//			kept in Vectors in this DOM implementation, so this is
+//			a hardwired implementation for that type.
+//
+
+#include "NodeVector.hpp"
+#include <assert.h>
+
+NodeVector::NodeVector()
+{
+	init(10);
+};
+
+NodeVector::NodeVector(int size) {
+	init(size);
+};
+
+
+void NodeVector::init(int size) {
+	assert(size > 0);
+	data = new NodeImpl *[size];
+	assert(data != 0);
+	allocatedSize = size;
+	nextFreeSlot = 0;
+};
+
+
+NodeVector::~NodeVector() {
+	delete [] data;
+};
+
+
+void NodeVector::addElement(NodeImpl *elem) {
+	checkSpace();
+	data[nextFreeSlot] = elem;
+	++nextFreeSlot;
+};
+
+
+void NodeVector::checkSpace() {
+	if (nextFreeSlot == allocatedSize) {
+        int grow= allocatedSize/2;
+        if (grow < 50) grow = 50;
+		int newAllocatedSize = allocatedSize + grow;
+		NodeImpl **newData = new NodeImpl *[newAllocatedSize];
+		assert(newData != 0);
+		for (int i=0; i<allocatedSize; i++) {
+			newData[i] = data[i];
+		};
+		delete [] data;
+		allocatedSize = newAllocatedSize;
+		data = newData;
+	};
+};
+
+	
+NodeImpl *NodeVector::elementAt(int index) {
+	return data[index];
+};
+
+NodeImpl *NodeVector::lastElement() {
+	if (nextFreeSlot == 0)
+		return 0;
+	return data[nextFreeSlot-1];
+};
+
+
+void NodeVector::insertElementAt(NodeImpl *elem, int index) {
+	int i;
+
+	assert(index <= nextFreeSlot);
+	assert(index >= 0);
+
+	checkSpace();
+	for (i=nextFreeSlot; i>index; --i) {
+		data[i] = data[i-1];
+	}
+	data[index] = elem;
+	++nextFreeSlot;
+
+};
+
+
+void NodeVector::removeElementAt(int index) {
+	assert (index >= 0);
+	assert(index < nextFreeSlot);
+	for (int i=index; i<nextFreeSlot-1; ++i) {
+		data[i] = data[i+1];
+	}
+	--nextFreeSlot;
+};
+
+void NodeVector::reset() {
+	nextFreeSlot = 0;
+};
+
+void NodeVector::setElementAt(NodeImpl *elem, int index) {
+	assert(index >= 0);
+	assert(index < nextFreeSlot);
+	data[index] = elem;
+};
+
+
+int	NodeVector::size() {
+	return nextFreeSlot;
+};
+		 
+
diff --git a/src/dom/NodeVector.hpp b/src/dom/NodeVector.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..25a1defc5032c57abddbbdaedec3f43605f09a79
--- /dev/null
+++ b/src/dom/NodeVector.hpp
@@ -0,0 +1,106 @@
+#ifndef NodeVector_HEADER_GUARD_
+#define NodeVector_HEADER_GUARD_
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:17  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:31  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+#include <util/XML4CDefs.hpp>
+class NodeImpl;
+
+
+class  NodeVector {
+private:
+    NodeImpl        **data;
+    int             allocatedSize;
+    int             nextFreeSlot;
+    void            init(int size);
+    void            checkSpace();
+    
+public:
+    NodeVector();
+    NodeVector(int size);
+    ~NodeVector();
+    
+    int             size();
+    NodeImpl        *elementAt(int index);
+    NodeImpl        *lastElement();
+    void            addElement(NodeImpl *);
+    void            insertElementAt(NodeImpl *, int index);
+    void            setElementAt(NodeImpl *val, int index);
+    void            removeElementAt(int index);
+    void            reset();
+};
+
+#endif
diff --git a/src/dom/NotationImpl.cpp b/src/dom/NotationImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..451252e3a013764730e0ccadc8a60d3ad9c3f1c4
--- /dev/null
+++ b/src/dom/NotationImpl.cpp
@@ -0,0 +1,153 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:17  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:31  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "NotationImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DOM_Node.hpp"
+
+
+/**
+* Notations are how the Document Type Description (DTD) records hints
+* about the format of an XML "unparsed entity" -- in other words,
+* non-XML data bound to this document type, which some applications
+* may wish to consult when manipulating the document. A Notation
+* represents a name-value pair, with its nodeName being set to the
+* declared name of the notation.
+* <P>
+* Notations are also used to formally declare the "targets" of
+* Processing Instructions.
+* <P>
+* Note that the Notation's data is non-DOM information; the DOM only
+* records what and where it is.
+* <P>
+* See the XML 1.0 spec, sections 4.7 and 2.6, for more info.
+* <P>
+* Level 1 of the DOM does not support editing Notation contents.
+*
+* @author Rania Y. Khalaf 
+* @author Joseph Kesselman
+* @since  PR-DOM-Level-1-19980818.
+*/
+
+NotationImpl::NotationImpl(DocumentImpl *ownerDoc, const DOMString &notationName) :
+NodeImpl(ownerDoc, notationName, DOM_Node::NOTATION_NODE, true, null)
+{
+};
+
+NotationImpl::NotationImpl(const NotationImpl &other, bool deep)
+: NodeImpl(other, deep)
+{
+};
+
+
+NotationImpl::~NotationImpl()
+{
+};
+
+
+NodeImpl *NotationImpl::cloneNode(bool deep)
+{
+    return new NotationImpl(*this, deep);
+};
+
+
+DOMString NotationImpl::getPublicId()
+{
+    return publicId.clone();
+};
+
+
+DOMString NotationImpl::getSystemId()
+{
+    return systemId.clone();
+};
+
+
+void NotationImpl::setNodeValue(const DOMString &arg)
+{
+    throw new DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+};
+
+
+void NotationImpl::setPublicId(const DOMString &arg)
+{
+    if(readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,null);
+    
+    publicId = arg.clone();
+};
+
+
+void NotationImpl::setSystemId(const DOMString &arg)
+{
+    if(readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,null);
+    
+    systemId = arg.clone();
+};
+
diff --git a/src/dom/NotationImpl.hpp b/src/dom/NotationImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..b9a03e21743202e6f87ef57cb84d1c2c6c676a35
--- /dev/null
+++ b/src/dom/NotationImpl.hpp
@@ -0,0 +1,127 @@
+#ifndef NotationImpl_HEADER_GUARD_
+#define NotationImpl_HEADER_GUARD_
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:18  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:32  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+
+class DocumentImpl;
+
+class NotationImpl: public NodeImpl {
+private:
+    DOMString publicId;
+    DOMString systemId;
+    
+public:
+    NotationImpl(DocumentImpl *, const DOMString &);
+    NotationImpl(const NotationImpl &other, bool deep=false);
+    
+    virtual ~NotationImpl();
+    
+    
+    virtual NodeImpl *cloneNode(bool deep);
+    
+    /**
+    * The Public Identifier for this Notation. If no public identifier
+    * was specified, this will be null.  
+    */
+    virtual DOMString getPublicId();
+    
+    /**
+    * The System Identifier for this Notation. If no system identifier
+    * was specified, this will be null.  
+    */
+    virtual DOMString getSystemId();
+    
+    
+    /** Notations never have a nodeValue.
+    @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
+    */
+    virtual void setNodeValue(const DOMString &arg);
+    
+    
+    /** NON-DOM: The Public Identifier for this Notation. If no public
+    identifier was specified, this will be null.  */
+    virtual void setPublicId(const DOMString &arg);
+    
+    
+    /** NON-DOM: The System Identifier for this Notation. If no system
+    identifier was specified, this will be null.  */
+    virtual void setSystemId(const DOMString &arg);
+    
+};
+
+#endif  
diff --git a/src/dom/ProcessingInstructionImpl.cpp b/src/dom/ProcessingInstructionImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6e0f6b025aadd57be41fa78a20bb3dec17ab8607
--- /dev/null
+++ b/src/dom/ProcessingInstructionImpl.cpp
@@ -0,0 +1,133 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:18  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:32  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "ProcessingInstructionImpl.hpp"
+#include "DocumentImpl.hpp"
+#include "NodeImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DOM_Node.hpp"
+
+ProcessingInstructionImpl::ProcessingInstructionImpl(DocumentImpl *ownerDoc,
+                                                     const DOMString &target, const DOMString &data) :
+NodeImpl(ownerDoc,target,DOM_Node::PROCESSING_INSTRUCTION_NODE,true,data)
+{
+};
+
+
+ProcessingInstructionImpl::ProcessingInstructionImpl(
+                                                     const ProcessingInstructionImpl &other, bool deep)
+                                                     : NodeImpl(other, deep)
+{
+};
+
+
+ProcessingInstructionImpl::~ProcessingInstructionImpl()
+{
+};
+
+
+NodeImpl *ProcessingInstructionImpl::cloneNode(bool deep)
+{
+    return new ProcessingInstructionImpl(*this, deep);
+};
+
+
+DOMString ProcessingInstructionImpl::getData()
+{
+    return value.clone();
+};
+
+
+/** A PI's "target" states what processor channel the PI's data
+should be directed to. It is defined differently in HTML and XML.
+
+  In XML, a PI's "target" is the first (whitespace-delimited) token
+  following the "<?" token that begins the PI.
+  
+    In HTML, target is always null.
+    
+      Note that getNodeName is aliased to getTarget.
+*/
+DOMString ProcessingInstructionImpl::getTarget()
+{
+    return name.clone();
+};
+
+
+/** 
+* Change the data content of this PI. 
+* Note that setNodeValue is aliased to setData 
+* @see getData().
+* @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is read-only.
+*/
+void ProcessingInstructionImpl::setData(const DOMString &arg)
+{
+    if(readOnly)
+        throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,null);
+    
+    value = arg;
+};
diff --git a/src/dom/ProcessingInstructionImpl.hpp b/src/dom/ProcessingInstructionImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..0c8e9803b33a491b9dfbfe01a3e9bba7009fff64
--- /dev/null
+++ b/src/dom/ProcessingInstructionImpl.hpp
@@ -0,0 +1,97 @@
+#ifndef ProcessingInstructionImpl_HEADER_GUARD_
+#define ProcessingInstructionImpl_HEADER_GUARD_
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:18  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:32  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+#include <util/XML4CDefs.hpp>
+#include "NodeImpl.hpp"
+class    DocumentImpl;
+
+
+class ProcessingInstructionImpl: public NodeImpl {
+public:
+    ProcessingInstructionImpl(DocumentImpl *ownerDoc, const DOMString & target,
+        const DOMString &data);
+    ProcessingInstructionImpl(const ProcessingInstructionImpl &other, bool deep=false);
+    virtual ~ProcessingInstructionImpl();
+    virtual NodeImpl *cloneNode(bool deep);
+    virtual DOMString getData();
+    virtual DOMString getTarget();
+    virtual void setData(const DOMString &arg);
+};
+
+#endif
+
diff --git a/src/dom/RefCountedImpl.cpp b/src/dom/RefCountedImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0164088655acec0f9e377c59a3f63c86ce02e52e
--- /dev/null
+++ b/src/dom/RefCountedImpl.cpp
@@ -0,0 +1,121 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:19  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:32  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "RefCountedImpl.hpp"
+
+
+RefCountedImpl::RefCountedImpl()
+{
+    nodeRefCount = 0;
+};
+
+
+
+RefCountedImpl::~RefCountedImpl()
+{
+};
+
+
+
+
+
+void RefCountedImpl::addRef(RefCountedImpl *thisNode)
+{
+    if (thisNode)
+    {
+        if (++thisNode->nodeRefCount == 1)
+        {
+            thisNode->referenced();
+        }
+    }
+};
+
+
+void RefCountedImpl::referenced()
+{
+};
+
+
+
+void RefCountedImpl::removeRef(RefCountedImpl *thisNode)
+{
+    if (thisNode)
+    {
+        if (--thisNode->nodeRefCount == 0)
+        {
+            thisNode->unreferenced();
+        }
+    }
+};
+
+
+void RefCountedImpl::unreferenced()
+{
+};
+
+
+
+
diff --git a/src/dom/RefCountedImpl.hpp b/src/dom/RefCountedImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..42f47c7a26ea320903ba5e1dde5bdec519c1544c
--- /dev/null
+++ b/src/dom/RefCountedImpl.hpp
@@ -0,0 +1,108 @@
+#ifndef RefCountedImpl_HEADER_GUARD_
+#define RefCountedImpl_HEADER_GUARD_
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:19  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:33  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+
+#include <util/XML4CDefs.hpp>
+
+
+class CDOM_EXPORT RefCountedImpl
+{
+public:
+    int			    nodeRefCount;
+
+                    RefCountedImpl();
+    virtual         ~RefCountedImpl();
+
+    static void     addRef(RefCountedImpl *thisNode);
+    static void     removeRef(RefCountedImpl *thisNode);
+
+    virtual void    referenced();   // This function will be called by
+                                    //  the reference counting implementation
+                                    //  whenever the reference count transitions
+                                    //  from 0 to 1.
+
+    virtual void    unreferenced(); // unreferenced() is called whenever the
+                                    //  the ref count goes from 1 to 0.  (Nodes are
+                                    //  not deleted when the ref count goes to zero
+                                    //  if they are in the doc tree and the tree
+                                    //  is still referenced, so a nodes referenced /
+                                    //  unreferenced state may switch many times
+                                    //  over its life time.)
+};
+
+#endif
diff --git a/src/dom/TextImpl.cpp b/src/dom/TextImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a3e67de643534440f189f21b61f39066bfdd2419
--- /dev/null
+++ b/src/dom/TextImpl.cpp
@@ -0,0 +1,123 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:19  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:33  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "DocumentImpl.hpp"
+#include "DOM_DOMException.hpp"
+#include "DOM_Node.hpp"
+#include "TextImpl.hpp"
+#include "CharacterDataImpl.hpp"
+#include "DStringPool.hpp"
+
+static DOMString *gText;   // will be lazily initialized to point to "#text"
+
+
+TextImpl::TextImpl(DocumentImpl *ownerDoc, const DOMString &data) :
+CharacterDataImpl(ownerDoc, DStringPool::getStaticString("#text", &gText), 
+                  DOM_Node::TEXT_NODE, data)
+{
+};
+
+TextImpl::TextImpl(const TextImpl &other, bool deep)
+: CharacterDataImpl(other, deep)
+{
+};
+
+TextImpl::~TextImpl()
+{
+};
+
+
+bool TextImpl::isTextImpl() 
+{
+        return true;
+};
+
+
+NodeImpl *TextImpl::cloneNode(bool deep)
+{
+        return ownerDocument->createTextNode(value);
+};
+
+
+TextImpl *TextImpl::splitText(int offset)
+{
+        if (readOnly)
+                throw new DOM_DOMException(
+        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
+        if (offset < 0 || offset > value.length() - 1)
+        throw new DOM_DOMException(DOM_DOMException::INDEX_SIZE_ERR, null);
+                
+        TextImpl *newText = 
+                (TextImpl *) ownerDocument->createTextNode(
+                        value.substringData(offset, value.length() - offset));
+        NodeImpl *parent = getParentNode();
+        if (parent != null)
+                parent->insertBefore(newText, getNextSibling());
+
+        value = value.substringData(0, offset);
+
+        return newText;
+};
diff --git a/src/dom/TextImpl.hpp b/src/dom/TextImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..f968b88919c7e9668aaf4972ec3147598df8225a
--- /dev/null
+++ b/src/dom/TextImpl.hpp
@@ -0,0 +1,95 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:19  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:33  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+//
+//  This file is part of the internal implementation of the C++ XML DOM.
+//  It should NOT be included or used directly by application programs.
+//
+//  Applications should include the file <dom/DOM.hpp> for the entire
+//  DOM API, or DOM_*.hpp for individual DOM classes, where the class
+//  name is substituded for the *.
+//
+
+
+
+#ifndef TextImpl_HEADER_GUARD_
+#define TextImpl_HEADER_GUARD_
+
+#include <util/XML4CDefs.hpp>
+#include "CharacterDataImpl.hpp"
+
+class TextImpl: public CharacterDataImpl {
+public:
+    TextImpl(DocumentImpl *ownerDoc, const DOMString &data);
+    TextImpl(const TextImpl &other, bool deep=false);
+    virtual ~TextImpl();
+    virtual NodeImpl *cloneNode(bool deep);
+    virtual bool isTextImpl();
+    virtual TextImpl *splitText(int offset);
+};
+
+#endif
+
diff --git a/src/dom/TreeWalkerImpl.cpp b/src/dom/TreeWalkerImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5c36c5aa47974f5498fbee881e26f5d60ffd3903
--- /dev/null
+++ b/src/dom/TreeWalkerImpl.cpp
@@ -0,0 +1,593 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:20  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:33  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#include "TreeWalkerImpl.hpp"
+#include "DOM_Document.hpp"
+#include "DOM_DOMException.hpp"
+#include "DocumentImpl.hpp"
+
+
+/** constructor */
+TreeWalkerImpl::TreeWalkerImpl (DOM_Node root, int whatToShow, DOM_NodeFilter nodeFilter, NodeFilterImpl* twi) {
+    fCurrentNode = root;
+    fRoot = root;
+    fWhatToShow = whatToShow;
+    fNodeFilter = nodeFilter;
+    nodeRefCount = 0;
+	fDetached = false;
+
+    if (twi != 0L) {
+        DOM_NodeFilter nf(twi);
+        fNodeFilter = nf;
+    }
+}
+
+
+TreeWalkerImpl::TreeWalkerImpl (const TreeWalkerImpl& twi) {
+    fCurrentNode = twi.fCurrentNode;
+    fRoot = twi.fRoot;
+    fWhatToShow = twi.fWhatToShow;
+    fNodeFilter = twi.fNodeFilter;
+    nodeRefCount = 0;
+	fDetached = false;
+}
+
+
+TreeWalkerImpl& TreeWalkerImpl::operator= (const TreeWalkerImpl& twi) {
+    if (this != &twi)
+    {
+        fCurrentNode = twi.fCurrentNode;
+        fRoot = twi.fRoot;
+        fWhatToShow = twi.fWhatToShow;
+        fNodeFilter = twi.fNodeFilter;
+		fDetached = twi.fDetached;
+    }
+
+    return *this;
+}
+
+
+void TreeWalkerImpl::detach ()
+{
+	fDetached = true;
+}
+
+
+void TreeWalkerImpl::unreferenced()
+{
+    DOM_Document doc = fRoot.getOwnerDocument();
+    DocumentImpl* impl;
+
+    if (! doc.isNull()) {
+        impl = (DocumentImpl *) doc.fImpl;
+    }
+    else
+        impl = (DocumentImpl *) fRoot.fImpl;
+
+    if (impl->treeWalkers != 0L) {
+        int i;
+        int sz = impl->treeWalkers->size();
+        for (i = 0; i < sz; i++)
+            if (impl->treeWalkers->elementAt(i) == this) {
+                impl->treeWalkers->removeElementAt(i);
+                break;
+            }
+    }
+
+    delete this;
+}
+
+
+/** Return the whatToShow value */
+int TreeWalkerImpl::getWhatToShow () {
+    return fWhatToShow;
+}
+
+
+/** Return the NodeFilter */
+DOM_NodeFilter TreeWalkerImpl::getFilter () {
+    return fNodeFilter;
+}
+
+
+/** Return the current Node. */
+DOM_Node TreeWalkerImpl::getCurrentNode () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    return fCurrentNode;
+}
+
+
+/** Return the current Node. */
+void TreeWalkerImpl::setCurrentNode (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    fCurrentNode = node;
+}
+
+
+/** Return the parent Node from the current node,
+ *  after applying filter, whatToshow.
+ *  If result is not null, set the current Node.
+ */
+DOM_Node TreeWalkerImpl::parentNode () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+	DOM_Node result;
+
+    if (fCurrentNode.isNull()) return result;
+
+    DOM_Node node = getParentNode(fCurrentNode);
+    if (node != 0L) {
+        fCurrentNode = node;
+    }
+    return node;
+
+}
+
+
+/** Return the first child Node from the current node,
+ *  after applying filter, whatToshow.
+ *  If result is not null, set the current Node.
+ */
+DOM_Node TreeWalkerImpl::firstChild () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+	DOM_Node result;
+
+    if (fCurrentNode.isNull()) return result;
+
+    DOM_Node node = getFirstChild(fCurrentNode);
+    if (! node.isNull()) {
+        fCurrentNode = node;
+    }
+    return node;
+}
+
+
+/** Return the last child Node from the current node,
+ *  after applying filter, whatToshow.
+ *  If result is not null, set the current Node.
+ */
+DOM_Node TreeWalkerImpl::lastChild () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+		
+	DOM_Node result;
+
+    if (fCurrentNode.isNull()) return result;
+
+    DOM_Node node = getLastChild(fCurrentNode);
+    if (! node.isNull()) {
+        fCurrentNode = node;
+    }
+    return node;
+}
+
+
+/** Return the previous sibling Node from the current node,
+ *  after applying filter, whatToshow.
+ *  If result is not null, set the current Node.
+ */
+
+DOM_Node TreeWalkerImpl::previousSibling () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+	
+	DOM_Node result;
+
+    if (fCurrentNode.isNull()) return result;
+
+    DOM_Node node = getPreviousSibling(fCurrentNode);
+    if (! node.isNull()) {
+        fCurrentNode = node;
+    }
+    return node;
+}
+
+
+/** Return the next sibling Node from the current node,
+ *  after applying filter, whatToshow.
+ *  If result is not null, set the current Node.
+ */
+
+DOM_Node TreeWalkerImpl::nextSibling () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+		
+	DOM_Node result;
+
+    if (fCurrentNode.isNull()) return result;
+
+    DOM_Node node = getNextSibling(fCurrentNode);
+    if (! node.isNull()) {
+        fCurrentNode = node;
+    }
+    return node;
+}
+
+
+/** Return the previous Node from the current node,
+ *  after applying filter, whatToshow.
+ *  If result is not null, set the current Node.
+ */
+
+DOM_Node TreeWalkerImpl::previousNode () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    DOM_Node result;
+
+    if (fCurrentNode.isNull()) return result;
+
+    // get sibling
+    result = getPreviousSibling(fCurrentNode);
+    if (result.isNull()) {
+        result = getParentNode(fCurrentNode);
+        if (! result.isNull()) {
+            fCurrentNode = result;
+            return fCurrentNode;
+        }
+        return result;
+    }
+
+    // get the lastChild of result.
+    DOM_Node lastChild  = getLastChild(result);
+
+    // if there is a lastChild which passes filters return it.
+    if (! lastChild.isNull()) {
+        fCurrentNode = lastChild;
+        return fCurrentNode;
+    }
+
+    // otherwise return the previous sibling.
+    if (! result.isNull()) {
+        fCurrentNode = result;
+        return fCurrentNode;
+    }
+
+    // otherwise return null.
+    return result;
+}
+
+
+/** Return the next Node from the current node,
+ *  after applying filter, whatToshow.
+ *  If result is not null, set the current Node.
+ */
+
+DOM_Node TreeWalkerImpl::nextNode () {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+	
+	DOM_Node result;
+
+    if (fCurrentNode.isNull()) return result;
+
+    result = getFirstChild(fCurrentNode);
+
+    if (! result.isNull()) {
+        fCurrentNode = result;
+        return result;
+    }
+
+    result = getNextSibling(fCurrentNode);
+
+    if (! result.isNull()) {
+        fCurrentNode = result;
+        return result;
+    }
+
+    // return parent's 1st sibling.
+    DOM_Node parent = getParentNode(fCurrentNode);
+    while (! parent.isNull()) {
+        result = getNextSibling(parent);
+        if (! result.isNull()) {
+            fCurrentNode = result;
+            return result;
+        } else {
+            parent = getParentNode(parent);
+        }
+    }
+
+    // end , return null
+    return result;
+}
+
+
+/** Internal function.
+ *  Return the parent Node, from the input node
+ *  after applying filter, whatToshow.
+ *  The current node is not consulted or set.
+ */
+
+DOM_Node TreeWalkerImpl::getParentNode (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+	
+	DOM_Node result;
+
+    if (node.isNull() || node == fRoot) return result;
+
+    DOM_Node newNode = node.getParentNode();
+    if (newNode.isNull())  return result;
+
+    int accept = acceptNode(newNode);
+
+    if (accept == DOM_NodeFilter::ACCEPT)
+        return newNode;
+    else
+    {
+        return getParentNode(newNode);
+    }
+
+
+}
+
+
+/** Internal function.
+ *  Return the nextSibling Node, from the input node
+ *  after applying filter, whatToshow.
+ *  The current node is not consulted or set.
+ */
+
+DOM_Node TreeWalkerImpl::getNextSibling (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+	
+	DOM_Node result;
+
+    if (node.isNull() || node == fRoot) return result;
+
+    DOM_Node newNode = node.getNextSibling();
+    if (newNode.isNull()) {
+
+        newNode = node.getParentNode();
+
+        if (newNode.isNull() || node == fRoot)  return result;
+
+        int parentAccept = acceptNode(newNode);
+
+        if (parentAccept == DOM_NodeFilter::SKIP) {
+            return getNextSibling(newNode);
+        }
+
+        return result;
+    }
+
+    int accept = acceptNode(newNode);
+
+    if (accept == DOM_NodeFilter::ACCEPT)
+        return newNode;
+    else
+    if (accept == DOM_NodeFilter::SKIP) {
+        DOM_Node fChild =  getFirstChild(newNode);
+        if (fChild.isNull()) {
+            return getNextSibling(newNode);
+        }
+        return fChild;
+    }
+    else
+    {
+        return getNextSibling(newNode);
+    }
+
+}
+
+
+/** Internal function.
+ *  Return the previous sibling Node, from the input node
+ *  after applying filter, whatToshow.
+ *  The current node is not consulted or set.
+ */
+
+DOM_Node TreeWalkerImpl::getPreviousSibling (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+		
+	DOM_Node result;
+
+    if (node.isNull() || node == fRoot) return result;
+
+    DOM_Node newNode = node.getPreviousSibling();
+    if (newNode.isNull()) {
+
+        newNode = node.getParentNode();
+        if (newNode.isNull() || node == fRoot)  return result;
+
+        int parentAccept = acceptNode(newNode);
+
+        if (parentAccept == DOM_NodeFilter::SKIP) {
+            return getPreviousSibling(newNode);
+        }
+
+        return result;
+    }
+
+    int accept = acceptNode(newNode);
+
+    if (accept == DOM_NodeFilter::ACCEPT)
+        return newNode;
+    else
+    if (accept == DOM_NodeFilter::SKIP) {
+        DOM_Node fChild =  getLastChild(newNode);
+        if (fChild.isNull()) {
+            return getPreviousSibling(newNode);
+        }
+        return fChild;
+    }
+    else
+    {
+        return getPreviousSibling(newNode);
+    }
+
+}
+
+
+/** Internal function.
+ *  Return the first child Node, from the input node
+ *  after applying filter, whatToshow.
+ *  The current node is not consulted or set.
+ */
+
+DOM_Node TreeWalkerImpl::getFirstChild (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+		
+	DOM_Node result;
+
+    if (node.isNull()) return result;
+
+    DOM_Node newNode = node.getFirstChild();
+    if (newNode.isNull())  return result;
+
+    int accept = acceptNode(newNode);
+
+    if (accept == DOM_NodeFilter::ACCEPT)
+        return newNode;
+    else
+    if (accept == DOM_NodeFilter::SKIP
+        && newNode.hasChildNodes())
+    {
+        return getFirstChild(newNode);
+    }
+    else
+    {
+        return getNextSibling(newNode);
+    }
+}
+
+
+/** Internal function.
+ *  Return the last child Node, from the input node
+ *  after applying filter, whatToshow.
+ *  The current node is not consulted or set.
+ */
+
+DOM_Node TreeWalkerImpl::getLastChild (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+	DOM_Node result;
+
+    if (node.isNull()) return result;
+
+    DOM_Node newNode = node.getLastChild();
+    if (newNode.isNull())  return result;
+
+    int accept = acceptNode(newNode);
+
+    if (accept == DOM_NodeFilter::ACCEPT)
+        return newNode;
+    else
+    if (accept == DOM_NodeFilter::SKIP
+        && newNode.hasChildNodes())
+    {
+        return getLastChild(newNode);
+    }
+    else
+    {
+        return getPreviousSibling(newNode);
+    }
+
+
+}
+
+
+/** The node is accepted if it passes the whatToShow and the filter. */
+
+short TreeWalkerImpl::acceptNode (DOM_Node node) {
+	if (fDetached)
+		throw new DOM_DOMException(DOM_DOMException::INVALID_STATE_ERR, null);
+
+    if (fNodeFilter == 0L) {
+        if ( ( fWhatToShow & (1 << (node.getNodeType() - 1))) != 0)
+        {
+            return DOM_NodeFilter::ACCEPT;
+        }
+        else
+        {
+            return DOM_NodeFilter::SKIP;
+        }
+    } else {
+        // REVISIT: This logic is unclear from the spec!
+        if ((fWhatToShow & (1 << (node.getNodeType() - 1))) != 0 ) {
+            return fNodeFilter.acceptNode(node);
+        } else {
+            // what to show has failed!
+            if (fNodeFilter.acceptNode(node) == DOM_NodeFilter::REJECT) {
+                return DOM_NodeFilter::REJECT;
+            } else {
+                return DOM_NodeFilter::SKIP;
+            }
+        }
+    }
+}
+
diff --git a/src/dom/TreeWalkerImpl.hpp b/src/dom/TreeWalkerImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..1e73d7e03d6149b01298607e86fef9b8eaa183cc
--- /dev/null
+++ b/src/dom/TreeWalkerImpl.hpp
@@ -0,0 +1,205 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:09:20  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:34  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef TreeWalkerImpl_HEADER_GUARD_
+#define TreeWalkerImpl_HEADER_GUARD_
+
+
+#include "DOM_TreeWalker.hpp"
+#include "RefCountedImpl.hpp"
+
+
+class CDOM_EXPORT TreeWalkerImpl : public RefCountedImpl {
+
+	public:
+    // Implementation Note: No state is kept except the data above
+    // (fWhatToShow, fNodeFilter, fCurrentNode, fRoot) such that
+    // setters could be created for these data values and the
+    // implementation will still work.
+
+    /** Public constructor */
+    TreeWalkerImpl (DOM_Node root, int whatToShow, DOM_NodeFilter nodeFilter, NodeFilterImpl* nfi);
+    TreeWalkerImpl (const TreeWalkerImpl& twi);
+    TreeWalkerImpl& operator= (const TreeWalkerImpl& twi);
+
+    /** Return the whatToShow value */
+    virtual int getWhatToShow ();
+
+    /** Return the NodeFilter */
+    virtual DOM_NodeFilter getFilter ();
+
+	virtual void detach ();
+
+    /** Return the current DOM_Node. */
+    virtual DOM_Node getCurrentNode ();
+
+    /** Return the current Node. */
+    virtual void setCurrentNode (DOM_Node node);
+
+    /** Return the parent Node from the current node,
+     *  after applying filter, whatToshow.
+     *  If result is not null, set the current Node.
+     */
+    virtual DOM_Node parentNode ();
+
+    /** Return the first child Node from the current node,
+     *  after applying filter, whatToshow.
+     *  If result is not null, set the current Node.
+     */
+
+    virtual DOM_Node firstChild ();
+
+    /** Return the last child Node from the current node,
+     *  after applying filter, whatToshow.
+     *  If result is not null, set the current Node.
+     */
+
+    virtual DOM_Node lastChild ();
+
+    /** Return the previous sibling Node from the current node,
+     *  after applying filter, whatToshow.
+     *  If result is not null, set the current Node.
+     */
+
+    virtual DOM_Node previousSibling ();
+
+    /** Return the next sibling Node from the current node,
+     *  after applying filter, whatToshow.
+     *  If result is not null, set the current Node.
+     */
+    virtual DOM_Node nextSibling ();
+    /** Return the previous Node from the current node,
+     *  after applying filter, whatToshow.
+     *  If result is not null, set the current Node.
+     */
+    virtual DOM_Node previousNode ();
+
+    /** Return the next Node from the current node,
+     *  after applying filter, whatToshow.
+     *  If result is not null, set the current Node.
+     */
+    virtual DOM_Node nextNode ();
+
+    virtual void unreferenced ();
+
+	protected:
+
+    /** Internal function.
+     *  Return the parent Node, from the input node
+     *  after applying filter, whatToshow.
+     *  The current node is not consulted or set.
+     */
+    DOM_Node getParentNode (DOM_Node node);
+
+    /** Internal function.
+     *  Return the nextSibling Node, from the input node
+     *  after applying filter, whatToshow.
+     *  The current node is not consulted or set.
+     */
+    DOM_Node getNextSibling (DOM_Node node);
+
+    /** Internal function.
+     *  Return the previous sibling Node, from the input node
+     *  after applying filter, whatToshow.
+     *  The current node is not consulted or set.
+     */
+    DOM_Node getPreviousSibling (DOM_Node node);
+
+    /** Internal function.
+     *  Return the first child Node, from the input node
+     *  after applying filter, whatToshow.
+     *  The current node is not consulted or set.
+     */
+    DOM_Node getFirstChild (DOM_Node node);
+
+    /** Internal function.
+     *  Return the last child Node, from the input node
+     *  after applying filter, whatToshow.
+     *  The current node is not consulted or set.
+     */
+    DOM_Node getLastChild (DOM_Node node);
+
+    /** The node is accepted if it passes the whatToShow and the filter. */
+    short acceptNode (DOM_Node node);
+
+		
+	private:
+    /** The whatToShow mask. */
+    int fWhatToShow;
+
+    /** The NodeFilter reference. */
+    DOM_NodeFilter fNodeFilter;
+
+    /** The current Node. */
+    DOM_Node fCurrentNode;
+
+    /** The root Node. */
+    DOM_Node fRoot;
+
+	bool fDetached;
+};
+
+#endif
diff --git a/src/framework/Makefile.in b/src/framework/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..76527da713089752a9cd21d8860a64e607b5b735
--- /dev/null
+++ b/src/framework/Makefile.in
@@ -0,0 +1,154 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:08:26  twl
+# Initial revision
+#
+# Revision 1.5  1999/11/08 20:44:34  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#:
+#
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+LDFLAGS = @ldflags@
+LIBS = @libs@
+OSVER = @osver@
+USELIBWWW = @uselibwww@
+MESSAGELOADER = @messageloader@
+TRANSCODER = @transcoder@
+
+include ../Makefile.incl
+
+MODULE = framework
+
+FRAMEWORK_CPP_PUBHEADERS = \
+	XMLAttDef.hpp \
+	XMLAttDefList.hpp \
+	XMLAttr.hpp \
+	XMLBuffer.hpp \
+	XMLBufferMgr.hpp \
+	XMLContentModel.hpp \
+	XMLDocumentHandler.hpp \
+	XMLElementDecl.hpp \
+	XMLEntityDecl.hpp \
+	XMLEntityHandler.hpp \
+	XMLErrorCodes.hpp \
+	XMLErrorReporter.hpp \
+	XMLNotationDecl.hpp \
+	XMLPScanToken.hpp \
+	XMLRecognizer.hpp \
+	XMLRefInfo.hpp \
+	XMLValidator.hpp \
+	XMLValidityCodes.hpp
+
+FRAMEWORK_CPP_PRIVHEADERS = 
+
+FRAMEWORK_C_FILES = 
+
+FRAMEWORK_CPP_OBJECTS = \
+	XMLAttDef.o \
+	XMLAttr.o \
+	XMLBuffer.o \
+	XMLBufferMgr.o \
+	XMLContentModel.o \
+	XMLElementDecl.o \
+	XMLEntityDecl.o \
+	XMLNotationDecl.o \
+	XMLRecognizer.o \
+	XMLValidator.o
+
+all:	includes $(FRAMEWORK_CPP_OBJECTS) publish
+
+includes:	pubheaders $(FRAMEWORK_C_FILES)
+
+pubheaders:
+	-mkdir -p $(XML_INC_DIR)/$(MODULE)
+	$(CP) $(FRAMEWORK_CPP_PUBHEADERS) $(FRAMEWORK_C_FILES) $(XML_INC_DIR)/$(MODULE)
+
+publish:
+	-mkdir -p ${ALL_OBJECTS_DIR}
+	$(CP) $(FRAMEWORK_CPP_OBJECTS) $(ALL_OBJECTS_DIR)
+
+# this may generate unnecessary dependencies, but it makes life easier
+depend: includes
+	$(MAKE_DEPEND) $(XML_INCL)  *.cpp > $(DEPFILE)
+
+clean:
+	@echo "Making clean in $(MODULE) ..."
+	$(RM) $(FRAMEWORK_CPP_OBJECTS)
+
+distclean:	clean
+	$(RM) Makefile $(DEPFILE)
+	@echo "Removing all $(MODULE) header files ..."
+	@for file in $(FRAMEWORK_CPP_PUBHEADERS); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@for file in $(FRAMEWORK_C_FILES); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@echo "Removing all $(MODULE) object files ..."
+	@for file in $(FRAMEWORK_CPP_OBJECTS); do \
+	rm -f $(ALL_OBJECTS_DIR)/$$file; \
+	done
+
+install:
+	-mkdir -p $(PREFIX)/$(MODULE)
+	$(CP) $(FRAMEWORK_CPP_PUBHEADERS) $(FRAMEWORK_C_FILES) $(PREFIX)/$(MODULE)
diff --git a/src/framework/XMLAttDef.cpp b/src/framework/XMLAttDef.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7706ce2cceffdfe22139d03abd9a06a4394536c5
--- /dev/null
+++ b/src/framework/XMLAttDef.cpp
@@ -0,0 +1,193 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:26  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:34  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/ArrayIndexOutOfBoundsException.hpp>
+#include <util/XMLUni.hpp>
+#include <framework/XMLAttDef.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  Local const data
+//
+//  gAttTypeStrings
+//      A list of strings which are used to map attribute type numbers to
+//      attribute type names.
+//
+//  gDefAttTypesStrings
+//      A list of strings which are used to map default attribute type
+//      numbers to default attribute type names.
+// ---------------------------------------------------------------------------
+const XMLCh* const gAttTypeStrings[XMLAttDef::AttTypes_Count] =
+{
+    XMLUni::fgCDATAString
+    , XMLUni::fgIDString
+    , XMLUni::fgIDRefString
+    , XMLUni::fgIDRefsString
+    , XMLUni::fgEntityString
+    , XMLUni::fgEntitiesString
+    , XMLUni::fgNmTokenString
+    , XMLUni::fgNmTokensString
+    , XMLUni::fgNotationString
+    , XMLUni::fgEnumerationString
+};
+
+const XMLCh* const gDefAttTypeStrings[XMLAttDef::DefAttTypes_Count] =
+{
+    XMLUni::fgDefaultString
+    , XMLUni::fgRequiredString
+    , XMLUni::fgImpliedString
+    , XMLUni::fgFixedString
+};
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDef: Public, static data members
+// ---------------------------------------------------------------------------
+const unsigned int XMLAttDef::fgInvalidAttrId = 0xFFFFFFFE;
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDef: Public, static methods
+// ---------------------------------------------------------------------------
+const XMLCh* XMLAttDef::getAttTypeString(const XMLAttDef::AttTypes attrType)
+{
+    // Check for an invalid attribute type and return a null
+    if ((attrType < AttTypes_Min) || (attrType > AttTypes_Max))
+        ThrowXML(ArrayIndexOutOfBoundsException, XML4CExcepts::AttDef_BadAttType);
+    return gAttTypeStrings[attrType];
+}
+
+const XMLCh* XMLAttDef::getDefAttTypeString(const XMLAttDef::DefAttTypes attrType)
+{
+    // Check for an invalid attribute type and return a null
+    if ((attrType < DefAttTypes_Min) || (attrType > DefAttTypes_Max))
+        ThrowXML(ArrayIndexOutOfBoundsException, XML4CExcepts::AttDef_BadDefAttType);
+    return gDefAttTypeStrings[attrType];
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDef: Destructor
+// ---------------------------------------------------------------------------
+XMLAttDef::~XMLAttDef()
+{
+    cleanUp();
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDef: Hidden constructors
+// ---------------------------------------------------------------------------
+XMLAttDef::XMLAttDef(const  XMLAttDef::AttTypes     type
+                    , const XMLAttDef::DefAttTypes  defType) :
+
+    fDefaultType(defType)
+    , fEnumeration(0)
+    , fId(XMLAttDef::fgInvalidAttrId)
+    , fProvided(false)
+    , fType(type)
+    , fValue(0)
+{
+}
+
+XMLAttDef::XMLAttDef(const  XMLCh* const            attrValue
+                    , const XMLAttDef::AttTypes     type
+                    , const XMLAttDef::DefAttTypes  defType
+                    , const XMLCh* const            enumValues) :
+
+    fDefaultType(defType)
+    , fEnumeration(0)
+    , fId(XMLAttDef::fgInvalidAttrId)
+    , fProvided(false)
+    , fType(type)
+    , fValue(0)
+{
+    try
+    {
+        fValue = XMLString::replicate(attrValue);
+        fEnumeration = XMLString::replicate(enumValues);
+    }
+
+    catch(...)
+    {
+        cleanUp();
+    }
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDef: Private helper methods
+// ---------------------------------------------------------------------------
+void XMLAttDef::cleanUp()
+{
+    delete [] fEnumeration;
+    delete [] fValue;
+}
diff --git a/src/framework/XMLAttDef.hpp b/src/framework/XMLAttDef.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..c69e733f3a0d8ab3de991a59243f94e73f5c6a50
--- /dev/null
+++ b/src/framework/XMLAttDef.hpp
@@ -0,0 +1,335 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:27  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:34  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(ATTDEF_HPP)
+#define ATTDEF_HPP
+
+#include <util/XMLString.hpp>
+
+class XMLAttr;
+
+//
+//  This class defines the basic characteristics of an attribute, no matter
+//  what type of validator is used. If a particular schema associates more
+//  information with an attribute it will create a derivative of this class.
+//  So this class provides an abstract way to get basic information on
+//  attributes from any type of validator.
+//
+//  This class supports keyed collection semantics on the fully qualified
+//  attribute name, by providing a getKey() method to extract the key string.
+//
+class XMLPARSER_EXPORT XMLAttDef
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Class specific types
+    //
+    //  AttTypes
+    //      The list of possible types that an attribute can have, according
+    //      to the XML 1.0 spec.
+    //
+    //  DefAttTypes
+    //      The modifiers that an attribute decl can have, which indicates
+    //      whether instances of that attributes are required, implied, etc..
+    // -----------------------------------------------------------------------
+	enum AttTypes
+    {
+        CData               = 0
+        , ID                = 1
+        , IDRef             = 2
+        , IDRefs            = 3
+        , Entity            = 4
+        , Entities          = 5
+        , NmToken           = 6
+        , NmTokens          = 7
+        , Notation          = 8
+        , Enumeration       = 9
+
+        , AttTypes_Count
+        , AttTypes_Min      = 0
+        , AttTypes_Max      = 9
+        , AttTypes_Unknown  = -1
+	};
+
+    enum DefAttTypes
+    {
+        Default             = 0
+        , Required          = 1
+        , Implied           = 2
+        , Fixed             = 3
+
+        , DefAttTypes_Count
+        , DefAttTypes_Min   = 0
+        , DefAttTypes_Max   = 3
+        , DefAttTypes_Unknown = -1
+	};
+
+
+    // -----------------------------------------------------------------------
+    //  Public static data members
+    // -----------------------------------------------------------------------
+    static const unsigned int fgInvalidAttrId;
+
+
+    // -----------------------------------------------------------------------
+    //  Public, static methods
+    // -----------------------------------------------------------------------
+    static const XMLCh* getAttTypeString(const AttTypes attrType);
+    static const XMLCh* getDefAttTypeString(const DefAttTypes attrType);
+
+
+    // -----------------------------------------------------------------------
+    //  Destructor
+    // -----------------------------------------------------------------------
+    virtual ~XMLAttDef();
+
+
+    // -----------------------------------------------------------------------
+    //  Support named pool element semantics
+    // -----------------------------------------------------------------------
+    const XMLCh* getKey() const;
+
+
+    // -----------------------------------------------------------------------
+    //  The virtual attribute def interface
+    // -----------------------------------------------------------------------
+    virtual const XMLCh* getFullName() const = 0;
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    DefAttTypes getDefaultType() const;
+    const XMLCh* getEnumeration() const;
+    unsigned int getId() const;
+    bool getProvided() const;
+    AttTypes getType() const;
+    const XMLCh* getValue() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setDefaultType(const XMLAttDef::DefAttTypes newValue);
+    void setId(const unsigned int newId);
+    void setProvided(const bool newValue);
+    void setType(const XMLAttDef::AttTypes newValue);
+    void setValue(const XMLCh* const newValue);
+    void setEnumeration(const XMLCh* const newValue);
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden constructors
+    // -----------------------------------------------------------------------
+    XMLAttDef
+    (
+        const   AttTypes            type = CData
+        , const DefAttTypes         defType = Implied
+    );
+    XMLAttDef
+    (
+        const   XMLCh* const        attValue
+        , const AttTypes            type
+        , const DefAttTypes         defType
+        , const XMLCh* const        enumValues = 0
+    );
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLAttDef(const XMLAttDef&);
+    void operator=(const XMLAttDef&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+    void cleanUp();
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fDefaultType
+    //      Indicates what, if any, default stuff this attribute has.
+    //
+    //  fEnumeration
+    //      If its an enumeration, this is the list of values as space
+    //      separated values.
+    //
+    //  fId
+    //      This is the unique id of this attribute, given to it when its put
+    //      into the validator's attribute decl pool. It defaults to the
+    //      special value XMLAttrDef::fgInvalidAttrId.
+    //
+    //  fProvided
+    //      This field is really for use by the scanner. It is used to track
+    //      which of the attributes of an element were provided. Any marked
+    //      as not provided (after scanning the start tag) and having a 
+    //      default type of Required, is in error.
+    //
+    //  fType
+    //      The type of attribute, which is one of the AttTypes values.
+    //
+    //  fValue
+    //      This is the value of the attribute, which is the default value
+    //      given in the attribute declaration.
+    // -----------------------------------------------------------------------
+    DefAttTypes     fDefaultType;
+    XMLCh*          fEnumeration;
+    unsigned int    fId;
+    bool            fProvided;
+    AttTypes        fType;
+    XMLCh*          fValue;
+};
+
+
+// ---------------------------------------------------------------------------
+//  Support named pool element semantics
+// ---------------------------------------------------------------------------
+inline const XMLCh* XMLAttDef::getKey() const
+{
+    //
+    //  Just call the virtual methods since only the validator specific
+    //  derived class knows what the full name is.
+    //
+    return getFullName();
+}
+
+
+// ---------------------------------------------------------------------------
+//  Getter methods
+// ---------------------------------------------------------------------------
+inline XMLAttDef::DefAttTypes XMLAttDef::getDefaultType() const
+{
+    return fDefaultType;
+}
+
+inline const XMLCh* XMLAttDef::getEnumeration() const
+{
+    return fEnumeration;
+}
+
+inline unsigned int XMLAttDef::getId() const
+{
+    return fId;
+}
+
+inline bool XMLAttDef::getProvided() const
+{
+    return fProvided;
+}
+
+inline XMLAttDef::AttTypes XMLAttDef::getType() const
+{
+    return fType;
+}
+
+inline const XMLCh* XMLAttDef::getValue() const
+{
+    return fValue;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDef: Setter methods
+// ---------------------------------------------------------------------------
+inline void XMLAttDef::setDefaultType(const XMLAttDef::DefAttTypes newValue)
+{
+    fDefaultType = newValue;
+}
+
+inline void XMLAttDef::setEnumeration(const XMLCh* const newValue)
+{
+    delete [] fEnumeration;
+    fEnumeration = XMLString::replicate(newValue);
+}
+
+inline void XMLAttDef::setId(const unsigned int newId)
+{
+    fId = newId;
+}
+
+inline void XMLAttDef::setProvided(const bool newValue)
+{
+    fProvided = newValue;
+}
+
+inline void XMLAttDef::setType(const XMLAttDef::AttTypes newValue)
+{
+    fType = newValue;
+}
+
+inline void XMLAttDef::setValue(const XMLCh* const newValue)
+{
+    delete [] fValue;
+    fValue = XMLString::replicate(newValue);
+}
+
+#endif
diff --git a/src/framework/XMLAttDefList.hpp b/src/framework/XMLAttDefList.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..b7380fb6bea81fb68f97458a85e0808395990d35
--- /dev/null
+++ b/src/framework/XMLAttDefList.hpp
@@ -0,0 +1,163 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:28  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:35  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(XMLATTDEFLIST_HPP)
+#define XMLATTDEFLIST_HPP
+
+#include <util/XMLEnumerator.hpp>
+#include <util/XMLString.hpp>
+#include <framework/XMLAttDef.hpp>
+
+
+//
+//  This class defines an abstract interface that all validators must support.
+//  When the scanner scans the attributes in a start tag, it must have a list
+//  of the defined attributes for that element. This is used to fault in
+//  defaulted and fixed attributes, know which ones are required, and know
+//  the their types in order to do the correct normalization.
+//
+//  Since each validator will have its own derivatives of XMLAttDef and will
+//  have its own specialized storage mechanisms for elements and the att
+//  defs that they own, there must be an abstracted way for the scanner to
+//  deal with this list.
+//
+//  It does not derive from the generic Enumerator template class, because
+//  there are portability issues with deriving from a template class in a
+//  DLL. It does though provide a similar enumerator interface.
+//
+class XMLPARSER_EXPORT XMLAttDefList
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    virtual ~XMLAttDefList();
+
+
+    // -----------------------------------------------------------------------
+    //  The virtual interface
+    // -----------------------------------------------------------------------
+    virtual bool hasMoreElements() const = 0;
+    virtual bool isEmpty() const = 0;
+    virtual XMLAttDef* findAttDef
+    (
+        const   unsigned long       uriID
+        , const XMLCh* const        attName
+    ) = 0;
+    virtual const XMLAttDef* findAttDef
+    (
+        const   unsigned long       uriID
+        , const XMLCh* const        attName
+    )   const = 0;
+    virtual XMLAttDef* findAttDef
+    (
+        const   XMLCh* const        attURI
+        , const XMLCh* const        attName
+    ) = 0;
+    virtual const XMLAttDef* findAttDef
+    (
+        const   XMLCh* const        attURI
+        , const XMLCh* const        attName
+    )   const = 0;
+    virtual XMLAttDef& nextElement() = 0;
+    virtual void Reset() = 0;
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden constructors and operators
+    // -----------------------------------------------------------------------
+    XMLAttDefList();
+    XMLAttDefList(const XMLAttDefList&);
+    XMLAttDefList& operator=(const XMLAttDefList&);
+};
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDefList: Constructors and Destructor
+// ---------------------------------------------------------------------------
+inline XMLAttDefList::~XMLAttDefList()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttDefList: Hidden Constructors and Operators
+// ---------------------------------------------------------------------------
+inline XMLAttDefList::XMLAttDefList()
+{
+}
+
+inline XMLAttDefList::XMLAttDefList(const XMLAttDefList&)
+{
+}
+
+inline XMLAttDefList& XMLAttDefList::operator=(const XMLAttDefList&)
+{
+    return *this;
+}
+
+#endif
diff --git a/src/framework/XMLAttr.cpp b/src/framework/XMLAttr.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..89256b2a97ad2bc241fe989d76561e3c117df825
--- /dev/null
+++ b/src/framework/XMLAttr.cpp
@@ -0,0 +1,222 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:28  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:35  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/XMLUni.hpp>
+#include <util/XMLString.hpp>
+#include <framework/XMLAttr.hpp>
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttr: Constructors and Destructor
+// ---------------------------------------------------------------------------
+XMLAttr::XMLAttr() :
+
+    fName(0)
+    , fPrefix(0)
+    , fQName(0)
+    , fType(XMLAttDef::CData)
+    , fValue(0)
+    , fSpecified(false)
+    , fURIId(0)
+{
+}
+
+XMLAttr::XMLAttr(   const   unsigned int        uriId
+                    , const XMLCh* const        attrName
+                    , const XMLCh* const        attrPrefix
+                    , const XMLCh* const        attrValue
+                    , const XMLAttDef::AttTypes type
+                    , const bool                specified) :
+
+    fName(0)
+    , fPrefix(0)
+    , fQName(0)
+    , fType(type)
+    , fValue(0)
+    , fSpecified(specified)
+    , fURIId(0)
+{
+    try
+    {
+        set(uriId, attrName, attrPrefix, attrValue);
+    }
+
+    catch(...)
+    {
+        cleanUp();
+    }
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttr: Getter methods
+// ---------------------------------------------------------------------------
+const XMLCh* XMLAttr::getQName() const
+{
+    // Fault in the QName if not already done
+    if (!fQName)
+    {
+        if (*fPrefix)
+        {
+            const unsigned int len = XMLString::stringLen(fPrefix)
+                                     + XMLString::stringLen(fName)
+                                     + 1;
+            const XMLCh colonStr[] = { chColon, chNull };
+
+            // We are faulting this guy in, so cast of const'ness
+            ((XMLAttr*)this)->fQName = new XMLCh[len + 1];
+            XMLString::copyString(fQName, fPrefix);
+            XMLString::catString(fQName, colonStr);
+            XMLString::catString(fQName, fName);
+        }
+         else
+        {
+            // We are faulting this guy in, so cast of const'ness
+            ((XMLAttr*)this)->fQName = XMLString::replicate(fName);
+        }
+    }
+    return fQName;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttr: Setter methods
+// ---------------------------------------------------------------------------
+void XMLAttr::set(  const   unsigned int        uriId
+                    , const XMLCh* const        attrName
+                    , const XMLCh* const        attrPrefix
+                    , const XMLCh* const        attrValue
+                    , const XMLAttDef::AttTypes type)
+{
+    // Clean up the old stuff
+    delete [] fName;
+    fName = 0;
+    delete [] fPrefix;
+    fPrefix = 0;
+    delete [] fValue;
+    fValue = 0;
+
+    // And clean up the QName and leave it undone until asked for
+    delete [] fQName;
+    fQName = 0;
+
+    // And now replicate the stuff into our members
+    fType = type;
+    fURIId = uriId;
+    fName = XMLString::replicate(attrName);
+    fPrefix = XMLString::replicate(attrPrefix);
+    fValue = XMLString::replicate(attrValue);
+}
+
+
+void XMLAttr::setName(  const   unsigned int    uriId
+                        , const XMLCh* const    attrName
+                        , const XMLCh* const    attrPrefix)
+{
+    // Clean up the old stuff
+    delete [] fName;
+    fName = 0;
+    delete [] fPrefix;
+    fPrefix = 0;
+
+    // And clean up the QName and leave it undone until asked for
+    delete [] fQName;
+    fQName = 0;
+
+    // And now replicate the stuff into our members
+    fURIId = uriId;
+    fName = XMLString::replicate(attrName);
+    fPrefix = XMLString::replicate(attrPrefix);
+}
+
+
+void XMLAttr::setURIId(const unsigned int uriId)
+{
+    fURIId = uriId;
+}
+
+
+void XMLAttr::setValue(const XMLCh* const newValue)
+{
+    delete [] fValue;
+    fValue = XMLString::replicate(newValue);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttr: Private, helper methods
+// ---------------------------------------------------------------------------
+void XMLAttr::cleanUp()
+{
+    delete [] fName;
+    delete [] fQName;
+    delete [] fValue;
+}
diff --git a/src/framework/XMLAttr.hpp b/src/framework/XMLAttr.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..f4835770b259b646205613861a189cd9d678c95d
--- /dev/null
+++ b/src/framework/XMLAttr.hpp
@@ -0,0 +1,252 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:28  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:35  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(XMLATTR_HPP)
+#define XMLATTR_HPP
+
+#include <util/XMLString.hpp>
+#include <framework/XMLAttDef.hpp>
+
+
+//
+//  This class defines the information about an attribute that will come out
+//  of the scanner during parsing. This information does not depend upon the
+//  type of validator because it is not tied to any scheme/DTD type info. Its
+//  just the raw XML 1.0 information that will be reported about an attribute
+//  in the startElement() callback method of the XMLDocumentHandler class.
+//  Hence it is not intended to be extended or derived from. Its designed to
+//  be used as is.
+//
+//  The 'specified' field of this class indicates whether the attribute was
+//  actually present or whether it was faulted in because it had a fixed or
+//  default value.
+//
+//  The code receiving this information can ask its validator for more info
+//  about the attribute, i.e. get its declaration from the DTD/Schema info.
+//
+class XMLPARSER_EXPORT XMLAttr
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLAttr();
+    XMLAttr
+    (
+        const   unsigned int        uriId
+        , const XMLCh* const        attrName
+        , const XMLCh* const        attrPrefix
+        , const XMLCh* const        attrValue
+        , const XMLAttDef::AttTypes type = XMLAttDef::CData
+        , const bool                specified = true
+    );
+    ~XMLAttr();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const XMLCh* getName() const;
+    const XMLCh* getPrefix() const;
+    const XMLCh* getQName() const;
+    bool getSpecified() const;
+    XMLAttDef::AttTypes getType() const;
+    const XMLCh* getValue() const;
+    unsigned int getURIId() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void set
+    (
+        const   unsigned int        uriId
+        , const XMLCh* const        attrName
+        , const XMLCh* const        attrPrefix
+        , const XMLCh* const        attrValue
+        , const XMLAttDef::AttTypes type = XMLAttDef::CData
+    );
+    void setName
+    (
+        const   unsigned int        uriId
+        , const XMLCh* const        attrName
+        , const XMLCh* const        attrPrefix
+    );
+    void setSpecified(const bool newValue);
+    void setType(const XMLAttDef::AttTypes newValue);
+    void setURIId(const unsigned int uriId);
+    void setValue(const XMLCh* const newValue);
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLAttr(const XMLAttr&);
+    XMLAttr& operator=(const XMLAttr&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private, helper methods
+    // -----------------------------------------------------------------------
+    void cleanUp();
+
+
+    // -----------------------------------------------------------------------
+    //  Private instance variables
+    //
+    //  fName
+    //      The base part of the name of the attribute.
+    //
+    //  fPrefix
+    //      The prefix that was applied to this attribute's name. It really
+    //      does not matter technically but it might be required for pratical
+    //      reasons, to recreate the original document for instance.
+    //
+    //  fQName
+    //      This is the QName form of the name, which is faulted in (from the
+    //      prefix and name) upon request.
+    //
+    //  fSpecified
+    //      True if this attribute appeared in the element; else, false if
+    //      it was defaulted from an AttDef.
+    //
+    //  fType
+    //      The attribute type enum value for this attribute. Indicates what
+    //      type of attribute it was.
+    //
+    //  fValue
+    //      The attribute value that was given in the attribute instance.
+    //
+    //  fURIId
+    //      The id of the URI that this attribute belongs to.
+    // -----------------------------------------------------------------------
+    XMLCh*              fName;
+    XMLCh*              fPrefix;
+    XMLCh*              fQName;
+    bool                fSpecified;
+    XMLAttDef::AttTypes fType;
+    XMLCh*              fValue;
+    unsigned int        fURIId;
+};
+
+// ---------------------------------------------------------------------------
+//  XMLAttr: Constructors and Destructor
+// ---------------------------------------------------------------------------
+inline XMLAttr::~XMLAttr()
+{
+    cleanUp();
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttr: Getter methods
+// ---------------------------------------------------------------------------
+inline const XMLCh* XMLAttr::getName() const
+{
+    return fName;
+}
+
+inline const XMLCh* XMLAttr::getPrefix() const
+{
+    return fPrefix;
+}
+
+inline bool XMLAttr::getSpecified() const
+{
+    return fSpecified;
+}
+
+inline XMLAttDef::AttTypes XMLAttr::getType() const
+{
+    return fType;
+}
+
+inline const XMLCh* XMLAttr::getValue() const
+{
+    return fValue;
+}
+
+inline unsigned int XMLAttr::getURIId() const
+{
+    return fURIId;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLAttr: Setter methods
+// ---------------------------------------------------------------------------
+inline void XMLAttr::setType(const XMLAttDef::AttTypes newValue)
+{
+    fType = newValue;
+}
+
+inline void XMLAttr::setSpecified(const bool newValue)
+{
+    fSpecified = newValue;
+}
+
+#endif
diff --git a/src/framework/XMLBuffer.cpp b/src/framework/XMLBuffer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1a41200d28278be30ea2af0a5454decb3a97e176
--- /dev/null
+++ b/src/framework/XMLBuffer.cpp
@@ -0,0 +1,139 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:29  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:35  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/RuntimeException.hpp>
+#include <util/XMLString.hpp>
+#include <framework/XMLBuffer.hpp>
+#include <memory.h>
+#include <string.h>
+
+
+// ---------------------------------------------------------------------------
+//  XMLBuffer: Buffer management
+// ---------------------------------------------------------------------------
+void XMLBuffer::append(const XMLCh* const chars, const unsigned int count)
+{
+    unsigned int actualCount = count;
+    if (!count)
+        actualCount = XMLString::stringLen(chars);
+    insureCapacity(actualCount);
+    memcpy(&fBuffer[fIndex], chars, actualCount * 2);
+    fIndex += actualCount;
+}
+
+void XMLBuffer::set(const XMLCh* const chars, const unsigned int count)
+{
+    unsigned int actualCount = count;
+    if (!count)
+        actualCount = XMLString::stringLen(chars);
+    fIndex = 0;
+    insureCapacity(actualCount);
+    memcpy(fBuffer, chars, actualCount * 2);
+    fIndex = actualCount;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLBuffer: Private helper methods
+// ---------------------------------------------------------------------------
+void XMLBuffer::expand()
+{
+    unsigned int newCap = (unsigned int)(fCapacity * 1.5);
+
+    // Allocate the new buffer
+    XMLCh* newBuf = new XMLCh[newCap+1];
+
+    // Copy over the old stuff
+    memcpy(newBuf, fBuffer, fCapacity * 2);
+
+    // Clean up old buffer and store new stuff
+    delete [] fBuffer;
+    fBuffer = newBuf;
+    fCapacity = newCap;
+}
+
+void XMLBuffer::insureCapacity(const unsigned int extraNeeded)
+{
+    // If we can handle it, do nothing yet
+    if (fIndex + extraNeeded < fCapacity)
+        return;
+
+    // Oops, not enough room. Calc new capacity and allocate new buffer
+    const unsigned int newCap = (unsigned int)((fIndex + fCapacity) * 1.25);
+    XMLCh* newBuf = new XMLCh[newCap+1];
+
+    // Copy over the old stuff
+    memcpy(newBuf, fBuffer, fCapacity * 2);
+
+    // Clean up old buffer and store new stuff
+    delete [] fBuffer;
+    fBuffer = newBuf;
+    fCapacity = newCap;
+}
diff --git a/src/framework/XMLBuffer.hpp b/src/framework/XMLBuffer.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..a8f6389c59f64cdcc2e279dc6d65b7cac138ee65
--- /dev/null
+++ b/src/framework/XMLBuffer.hpp
@@ -0,0 +1,213 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:29  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:36  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(XMLBUFFER_HPP)
+#define XMLBUFFER_HPP
+
+#include <util/XML4CDefs.hpp>
+
+//
+//  XMLBuffer is a lightweight, expandable Unicode text buffer. Since XML is
+//  inherently theoretically unbounded in terms of the sizes of things, we
+//  very often need to have expandable buffers.
+//
+class XMLPARSER_EXPORT XMLBuffer
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLBuffer() :
+
+        fBuffer(0)
+        , fIndex(0)
+        , fCapacity(1023)
+        , fUsed(false)
+    {
+        // Buffer is one larger than capacity, to allow for zero term
+        fBuffer = new XMLCh[fCapacity+1];
+
+        // Keep it null terminated
+        fBuffer[0] = XMLCh(0);
+    }
+
+    ~XMLBuffer()
+    {
+        delete [] fBuffer;
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Buffer Management
+    // -----------------------------------------------------------------------
+    void append(const XMLCh toAppend)
+    {
+        if (fIndex == fCapacity)
+            expand();
+
+        // Put in char and bump the index
+        fBuffer[fIndex++] = toAppend;
+    }
+
+    void append
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    count = 0
+    );
+
+    const XMLCh* getRawBuffer() const
+    {
+        fBuffer[fIndex] = 0;
+        return fBuffer;
+    }
+
+    XMLCh* getRawBuffer()
+    {
+        fBuffer[fIndex] = 0;
+        return fBuffer;
+    }
+
+    void reset()
+    {
+        fIndex = 0;
+        fBuffer[0] = 0;
+    }
+
+    void set
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    count = 0
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Getters
+    // -----------------------------------------------------------------------
+    bool getInUse()
+    {
+        return fUsed;
+    }
+
+    unsigned int getLen() const
+    {
+        return fIndex;
+    }
+
+    bool isEmpty()
+    {
+        return (fIndex == 0);
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Setters
+    // -----------------------------------------------------------------------
+    void setInUse(const bool newValue)
+    {
+        fUsed = newValue;
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Declare our friends
+    // -----------------------------------------------------------------------
+    friend class XMLBufBid;
+
+
+    // -----------------------------------------------------------------------
+    //  Private helpers
+    // -----------------------------------------------------------------------
+    void expand();
+    void insureCapacity(const unsigned int extraNeeded);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fBuffer
+    //      The pointer to the buffer data. Its grown as needed. Its always
+    //      one larger than fCapacity, to leave room for the null terminator.
+    //
+    //  fIndex
+    //      The current index into the buffer, as characters are appended
+    //      to it. If its zero, then the buffer is empty.
+    //
+    //  fCapacity
+    //      The current capacity of the buffer. Its actually always one
+    //      larger, to leave room for the null terminator.
+    //
+    //  fUsed
+    //      Indicates whether this buffer is in use or not.
+    // -----------------------------------------------------------------------
+    XMLCh*          fBuffer;
+    unsigned int    fIndex;
+    unsigned int    fCapacity;
+    bool            fUsed;
+};
+
+#endif
diff --git a/src/framework/XMLBufferMgr.cpp b/src/framework/XMLBufferMgr.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..55ee127ee31c7451e6fedfc2536b508948912da2
--- /dev/null
+++ b/src/framework/XMLBufferMgr.cpp
@@ -0,0 +1,158 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:30  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:36  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <memory.h>
+#include <string.h>
+#include <util/RuntimeException.hpp>
+#include <framework/XMLBuffer.hpp>
+#include <framework/XMLBufferMgr.hpp>
+
+
+
+// ---------------------------------------------------------------------------
+//  Constructors and Destructor
+// ---------------------------------------------------------------------------
+XMLBufferMgr::XMLBufferMgr() :
+
+    fBufCount(32)
+    , fBufList(0)
+{
+    // Allocate the buffer list and zero it out
+    fBufList = new XMLBuffer*[fBufCount];
+    for (unsigned int index = 0; index < fBufCount; index++)
+        fBufList[index] = 0;
+}
+
+XMLBufferMgr::~XMLBufferMgr()
+{
+    // Delete any buffers that got allocated
+    for (unsigned int index = 0; index < fBufCount; index++)
+        delete fBufList[index];
+
+    // And then the buffer list
+    delete [] fBufList;
+}
+
+
+// ---------------------------------------------------------------------------
+//  Buffer management
+// ---------------------------------------------------------------------------
+XMLBuffer& XMLBufferMgr::bidOnBuffer()
+{
+    //
+    //  Look for a buffer that is not in use. If we hit a null entry, then
+    //  we have to add one.
+    //
+    for (unsigned int index = 0; index < fBufCount; index++)
+    {
+        // No more buffers available, so create one and take it
+        if (!fBufList[index])
+        {
+            fBufList[index] = new XMLBuffer;
+            fBufList[index]->setInUse(true);
+            return *fBufList[index];
+        }
+
+        //
+        //  There's one here, so see if its use. If not, mark it, reset it,
+        //  and take it
+        //
+        if (!fBufList[index]->getInUse())
+        {
+            fBufList[index]->reset();
+            fBufList[index]->setInUse(true);
+            return *(fBufList[index]);
+        }
+    }
+
+    // We did not find one, so freak out
+    ThrowXML(RuntimeException, XML4CExcepts::BufMgr_NoMoreBuffers);
+
+    // NOTE: Dummy return to make some compilers happy. Never really gets called!
+    return *fBufList[0];
+}
+
+
+void XMLBufferMgr::releaseBuffer(XMLBuffer& toRelease)
+{
+    // Look for this buffer in the list
+    for (unsigned int index = 0; index < fBufCount; index++)
+    {
+        if (fBufList[index] == &toRelease)
+        {
+            // Unmark it
+            toRelease.setInUse(false);
+            return;
+        }
+    }
+
+    // It was not a legal buffer
+    ThrowXML(RuntimeException, XML4CExcepts::BufMgr_BufferNotInPool);
+}
diff --git a/src/framework/XMLBufferMgr.hpp b/src/framework/XMLBufferMgr.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..076961eae469f515b4df1e05a1933189c01c1e56
--- /dev/null
+++ b/src/framework/XMLBufferMgr.hpp
@@ -0,0 +1,214 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:30  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:36  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(XMLBUFFERMGR_HPP)
+#define XMLBUFFERMGR_HPP
+
+#include <util/XML4CDefs.hpp>
+#include <framework/XMLBuffer.hpp>
+
+class XMLBufBid;
+
+
+//
+//  There are many places where XMLBuffer objects are needed. In order to
+//  avoid either constantly creating and destroying them or maintaining a
+//  fixed set and worry about accidental reuse, a buffer manager can provide
+//  a pool of them which can be temporarily used and then put back into the
+//  pool. This provides a good compromise between performance and easier
+//  maintenance.
+//
+class XMLPARSER_EXPORT XMLBufferMgr
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLBufferMgr();
+    ~XMLBufferMgr();
+
+
+    // -----------------------------------------------------------------------
+    //  Buffer management
+    // -----------------------------------------------------------------------
+    XMLBuffer& bidOnBuffer();
+    void releaseBuffer(XMLBuffer& toRelease);
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fBufCount
+    //      The count of buffers that have been allocated so far.
+    //
+    //  fBufList;
+    //      The list of pointers to buffers that are loaned out. There will
+    //      never be a lot of them, so a flat list is good enough.
+    // -----------------------------------------------------------------------
+    unsigned int    fBufCount;
+    XMLBuffer**     fBufList;
+};
+
+
+//
+//  XMLBufBid is a scoped based janitor that allows the scanner code to ask
+//  for a buffer on a scoped basis and then insure that it gets freed back
+//  into the pool no matter how the scope is exited (exception or normal exit.)
+//
+class XMLBufBid
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLBufBid(XMLBufferMgr* const srcMgr) :
+
+        fBuffer(srcMgr->bidOnBuffer())
+        , fMgr(srcMgr)
+    {
+    }
+
+    ~XMLBufBid()
+    {
+        fMgr->releaseBuffer(fBuffer);
+    }
+
+
+
+    // -----------------------------------------------------------------------
+    //  Buffer access
+    // -----------------------------------------------------------------------
+    void append(const XMLCh toAppend)
+    {
+        fBuffer.append(toAppend);
+    }
+
+    void append(const XMLCh* const toAppend, const unsigned int count = 0)
+    {
+        fBuffer.append(toAppend, count);
+    }
+
+    const XMLBuffer& getBuffer() const
+    {
+        return fBuffer;
+    }
+
+    XMLBuffer& getBuffer()
+    {
+        return fBuffer;
+    }
+
+    const XMLCh* getRawBuffer() const
+    {
+        fBuffer.fBuffer[fBuffer.fIndex] = 0;
+        return fBuffer.fBuffer;
+    }
+
+    XMLCh* getRawBuffer()
+    {
+        fBuffer.fBuffer[fBuffer.fIndex] = 0;
+        return fBuffer.fBuffer;
+    }
+
+    unsigned int getLen() const
+    {
+        return fBuffer.fIndex;
+    }
+
+    bool isEmpty()
+    {
+        return (fBuffer.fIndex == 0);
+    }
+
+    void reset()
+    {
+        fBuffer.reset();
+    }
+
+    void set(const XMLCh* const chars, const unsigned int count = 0)
+    {
+        fBuffer.set(chars, count);
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fBuffer
+    //      This is the buffer we got, and which we will release.
+    //
+    //  fMgr
+    //      This is the buffer manager we got the buffer from. This is needed
+    //      to release the buffer later.
+    // -----------------------------------------------------------------------
+    XMLBuffer&          fBuffer;
+    XMLBufferMgr* const fMgr;
+};
+
+#endif
diff --git a/src/framework/XMLContentModel.cpp b/src/framework/XMLContentModel.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d7633017f0e4e4de0dfcf0f4c68c182a6814f60b
--- /dev/null
+++ b/src/framework/XMLContentModel.cpp
@@ -0,0 +1,71 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:30  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:37  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <framework/XMLContentModel.hpp>
diff --git a/src/framework/XMLContentModel.hpp b/src/framework/XMLContentModel.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..aef5ebede25f5ec855baef03f8f7cc26d5a9012a
--- /dev/null
+++ b/src/framework/XMLContentModel.hpp
@@ -0,0 +1,123 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:30  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:37  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(CONTENTMODEL_HPP)
+#define CONTENTMODEL_HPP
+
+#include <util/XML4CDefs.hpp>
+#include <util/RefVectorOf.hpp>
+
+//
+//  This class defines the abstract interface for all content models. All
+//  elements have a content model against which (if validating) its content
+//  is checked. Each type of validator (DTD, Schema, etc...) can have 
+//  different types of content models, and even with each type of validator
+//  there can be specialized content models. So this simple class provides
+//  the abstract API via which all the types of contents models are dealt
+//  with generically. Its pretty simple.
+//
+class XMLPARSER_EXPORT XMLContentModel
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors are hidden, only the virtual Destructor is exposed
+    // -----------------------------------------------------------------------
+    virtual ~XMLContentModel()
+    {
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  The virtual content model interface provided by derived classes
+    // -----------------------------------------------------------------------
+    virtual bool getIsAmbiguous() const = 0;
+
+	virtual int validateContent
+    (
+        const   unsigned int*   childIds
+        , const unsigned int    childCount
+    ) const = 0;
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden Constructors
+    // -----------------------------------------------------------------------
+    XMLContentModel()
+    {
+    }
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLContentModel(const XMLContentModel&);
+    void operator=(const XMLContentModel&);
+};
+
+#endif
diff --git a/src/framework/XMLDocumentHandler.hpp b/src/framework/XMLDocumentHandler.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..832dff25db2361e55da47b82f4d9e349759562da
--- /dev/null
+++ b/src/framework/XMLDocumentHandler.hpp
@@ -0,0 +1,299 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+  * $Log$
+  * Revision 1.1  1999/11/09 01:08:31  twl
+  * Initial revision
+  *
+  * Revision 1.3  1999/11/08 20:44:37  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  */
+
+
+#if !defined(XMLDOCUMENTHANDLER_HPP)
+#define XMLDOCUMENTHANDLER_HPP
+
+#include <util/XML4CDefs.hpp>
+#include <util/RefVectorOf.hpp>
+#include <framework/XMLAttr.hpp>
+
+class XMLElementDecl;
+class XMLEntityDecl;
+
+/**
+  *
+  * This abstract class provides the interface for the scanner to return
+  * XML document information up to the parser as it scans through the
+  * document. The interface is very similar to org.sax.DocumentHandler, but
+  * has some extra methods required to get all the data out.
+  * 
+  * Some of the methods are designated as 'advanced' callbacks. They are
+  * enabled only if the 'setAdvancedCallbacks' flag has been set on the
+  * scanner. This scheme is used to avoid overhead when these more advanced
+  * events are not needed, such as in a SAX parser.</p>
+  */
+
+class XMLPARSER_EXPORT XMLDocumentHandler
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors are hidden, just the virtual destructor is exposed
+    // -----------------------------------------------------------------------
+    /** @name Destructor */
+    //@{
+    virtual ~XMLDocumentHandler()
+    {
+    }
+    //@}
+
+    /** @name The document handler interface */
+    //@{
+    /**
+      * Receive notification of character data.
+      *
+      * <p>The scanner will call this method to report each chunk of
+      * character data. The scanner may return all contiguous character
+      * data in a single chunk, or they may split it into several
+      * chunks; however, all of the characters in any single event
+      * will come from the same external entity, so that the Locator
+      * provides useful information.</p>
+      *
+      * <p>The parser must not attempt to read from the array
+      * outside of the specified range.</p>
+      *
+      * @param chars The content (characters) between markup from the XML
+      *              document.
+      * @param length The number of characters to read from the array.
+      * @param cdataSection Indicates that this data is inside a CDATA
+      *                     section.
+      * @see #ignorableWhitespace 
+      * @see Locator
+      */
+    virtual void docCharacters
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+        , const bool            cdataSection
+    ) = 0;
+
+    /**
+      * Receive notification of comments in the XML content being parsed.
+      *
+      * @param comment The text of the comment.
+      */
+    virtual void docComment
+    (
+        const   XMLCh* const    comment
+    ) = 0;
+
+    /**
+      * Receive notification of PI's parsed in the XML content.
+      *
+      * @param target The name of the PI.
+      * @param data   The body of the PI.
+      */
+    virtual void docPI
+    (
+        const   XMLCh* const    target
+        , const XMLCh* const    data
+    ) = 0;
+
+    /**
+      * Receive notification after the scanner has parsed the end of the
+      * document.
+      */
+    virtual void endDocument() = 0;
+
+    /**
+      * This method is called when scanner encounters the end of element tag.
+      * There will be a corresponding startElement() event for every
+      * endElement() event, but not necessarily the other way around. For
+      * empty tags, there is only a startElement() call.
+      *
+      * @param elementName The name of the element whose end tag was just
+      *                    parsed.
+      * @param isRoot  Indicates if this is the root element.
+      */
+    virtual void endElement
+    (
+        const   XMLElementDecl& elemDecl
+        , const unsigned int    uriId
+        , const bool            isRoot
+    ) = 0;
+
+    /**
+      * This method is called when scanner encounters the end of an entity
+      * reference.
+      *
+      * @param entityName The name of the entity reference just scanned.
+      */
+    virtual void endEntityReference
+    (
+        const   XMLEntityDecl&  entDecl
+    ) = 0;
+
+    /**
+      * Receive notification of ignorable whitespace in element content.
+      *
+      * <p>Validating Parsers must use this method to report each chunk
+      * of ignorable whitespace (see the W3C XML 1.0 recommendation,
+      * section 2.10): non-validating parsers may also use this method
+      * if they are capable of parsing and using content models.</p>
+      *
+      * <p>The scanner may return all contiguous whitespace in a single
+      * chunk, or it may split it into several chunks; however, all of
+      * the characters in any single event will come from the same
+      * external entity, so that the Locator provides useful
+      * information.</p>
+      *
+      * <p>The parser must not attempt to read from the array
+      * outside of the specified range.</p>
+      *
+      * @param chars The whitespace characters from the XML document.
+      * @param length The number of characters to read from the array.
+      * @param cdataSection Indicates that this data is inside a CDATA
+      *                     section.
+      * @see #characters
+      */
+    virtual void ignorableWhitespace
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+        , const bool            cdataSection
+    ) = 0;
+
+    /**
+      * This method is used to give the registered document handler a
+      * chance to reset itself. Its called by the scanner at the start of
+      * every parse.
+      */
+    virtual void resetDocument() = 0;
+
+    /**
+      * This method is the first callback called the scanner at the
+      * start of every parse.
+      */
+    virtual void startDocument() = 0;
+
+    virtual void startElement
+    (
+        const   XMLElementDecl&         elemDecl
+        , const unsigned int            uriId
+        , const XMLCh* const            prefixName
+        , const RefVectorOf<XMLAttr>&   attrList
+        , const unsigned int            attrCount
+        , const bool                    isEmpty
+        , const bool                    isRoot
+    ) = 0;
+
+    /**
+      * Receive notification when the scanner hits an entity reference.
+      * This is currently useful only to DOM parser configurations as SAX
+      * does not provide any api to return this information.
+      *
+      * @param entityName  The name of the entity that was referenced.
+      */
+    virtual void startEntityReference(const XMLEntityDecl& entDecl) = 0;
+
+    /**
+      * Receive notification when the scanner hits the XML declaration
+      * clause in the XML file. Currently neither DOM nor SAX provide
+      * API's to return back this information. This is an advanced
+      * callback.
+      *
+      * @param versionStr  The value of the <code>version</code> attribute
+      *                    of the XML decl.
+      * @param encodingStr  The value of the <code>encoding</code> attribute
+      *                     of the XML decl.
+      * @param standaloneStr  The value of the <code>standalone</code>
+      *                       attribute of the XML decl.
+      * @param autoEncodingStr  The encoding string auto-detected by the
+      *             scanner. In absence of any 'encoding' attribute in the
+      *             XML decl, the XML standard specifies how a parser can
+      *             auto-detect. If there is no <code>encodingStr</code>
+      *             this is what will be used to try to decode the file.
+      */
+    virtual void XMLDecl
+    (
+        const   XMLCh* const    versionStr
+        , const XMLCh* const    encodingStr
+        , const XMLCh* const    standaloneStr
+        , const XMLCh* const    autoEncodingStr
+    ) = 0;
+    //@}
+
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden Constructors
+    // -----------------------------------------------------------------------
+    XMLDocumentHandler()
+    {
+    }
+
+
+private:
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLDocumentHandler(const XMLDocumentHandler&);
+    void operator=(const XMLDocumentHandler&);
+};
+
+#endif
diff --git a/src/framework/XMLElementDecl.cpp b/src/framework/XMLElementDecl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b81c5bf284ddc554e77ed33516bd2c17a3292121
--- /dev/null
+++ b/src/framework/XMLElementDecl.cpp
@@ -0,0 +1,129 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:31  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:37  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/XMLUni.hpp>
+#include <framework/XMLElementDecl.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  XMLElementDecl: Public, static data
+// ---------------------------------------------------------------------------
+const unsigned int  XMLElementDecl::fgInvalidElemId  = 0xFFFFFFFE;
+const unsigned int  XMLElementDecl::fgPCDataElemId   = 0xFFFFFFFF;
+const XMLCh         XMLElementDecl::fgPCDataElemName[] =
+{
+        chPound, chLatin_P, chLatin_C, chLatin_D, chLatin_A
+    ,   chLatin_T, chLatin_A, chNull
+};
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLElementDecl: Destructor
+// ---------------------------------------------------------------------------
+XMLElementDecl::~XMLElementDecl()
+{
+    delete fContentModel;
+    delete [] fFormattedModel;
+}
+
+
+// ---------------------------------------------------------------------------
+//  ElementDecl: Miscellaneous
+// ---------------------------------------------------------------------------
+const XMLCh*
+XMLElementDecl::getFormattedContentModel(const XMLValidator& validator) const
+{
+    //
+    //  If its not already built, then call the protected virtual method
+    //  to allow the derived class to build it (since only it knows.)
+    //  Otherwise, just return the previously formatted methods.
+    //
+    //  Since we are faulting this in, within a const getter, we have to
+    //  cast off the const-ness.
+    //
+    if (!fFormattedModel)
+        ((XMLElementDecl*)this)->fFormattedModel = formatContentModel(validator);
+
+    return fFormattedModel;
+}
+
+
+// ---------------------------------------------------------------------------
+//  ElementDecl: Hidden constructors
+// ---------------------------------------------------------------------------
+XMLElementDecl::XMLElementDecl() :
+
+    fContentModel(0)
+    , fCreateReason(XMLElementDecl::NoReason)
+    , fFormattedModel(0)
+    , fId(XMLElementDecl::fgInvalidElemId)
+{
+}
diff --git a/src/framework/XMLElementDecl.hpp b/src/framework/XMLElementDecl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..ea83806c9d01219b51340534d4d443c21bffbb68
--- /dev/null
+++ b/src/framework/XMLElementDecl.hpp
@@ -0,0 +1,339 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:32  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:38  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(XMLELEMENTDECL_HPP)
+#define XMLELEMENTDECL_HPP
+
+#include <util/XMLString.hpp>
+#include <framework/XMLAttr.hpp>
+#include <framework/XMLAttDefList.hpp>
+#include <framework/XMLContentModel.hpp>
+
+class XMLValidator;
+
+//
+//  This class defines the core information of an element declaration. Each
+//  validator (DTD, Schema, etc...) will have its own information that it
+//  associations with the declaration of an element, but they must all share
+//  at least this core information, i.e. they must all derive from this
+//  class. The set of info enforced at this level is driven by the needs of
+//  XML 1.0 spec validation and well formedness checks.
+//
+//  This class supports keyed collection semantics by providing the getKey()
+//  method, which extracts the key field. getKey() just calls getFullName()
+//  which is virtual so that each type of validator can have its own version
+//  of what a full name is. For the DTD validator, its element decl
+//  derivatives will return QNames in form pre:name. A Schema validator
+//  would return expanded names in the form {uri}name.
+//
+//  This class defines some special element id values for invalid elements
+//  and PCDATA elements, as well as a string for the special PCDATA element
+//  name. All validators must honor these special values in order to allow
+//  content models to work generically (i.e. to let code know when its dealing
+//  with invalid or PCDATA element ids without having to know what type of
+//  validator its messing with.)
+//
+class XMLPARSER_EXPORT XMLElementDecl
+{
+ public:
+    // -----------------------------------------------------------------------
+    //  Class specific types
+    //
+    //  CreateReasons
+    //      This type is used to store how an element declaration got into
+    //      the validator's element pool. They are faulted in for various
+    //      reasons.
+    //
+    //  LookupOpts
+    //      These are the values used by the attribute lookup methods.
+    //
+    //  CharDataOpts
+    //      This is used to indicate how this type of element reacts to
+    //      character data as content.
+    // -----------------------------------------------------------------------
+    enum CreateReasons
+    {
+        NoReason
+        , Declared
+        , AttList
+        , InContentModel
+        , AsRootElem
+    };
+
+    enum LookupOpts
+    {
+        AddIfNotFound
+        , FailIfNotFound
+    };
+
+    enum CharDataOpts
+    {
+        NoCharData
+        , SpacesOk
+        , AllCharData
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Public static data
+    //
+    //  fgInvalidElemId
+    //      A value to represent an invalid element node id.
+    //
+    //  fgPCDataElemId
+    //      This is the value to use to represent a PCDATA node when an
+    //      element id is required.
+    //
+    //  fgPCDataElemName
+    //      This is the value to use to represent a PCDATA node when an
+    //      element name is required.
+    // -----------------------------------------------------------------------
+    static const unsigned int   fgInvalidElemId;
+    static const unsigned int   fgPCDataElemId;
+    static const XMLCh          fgPCDataElemName[];
+
+
+
+    // -----------------------------------------------------------------------
+    //  Destructor
+    // -----------------------------------------------------------------------
+    virtual ~XMLElementDecl();
+
+
+    // -----------------------------------------------------------------------
+    //  The virtual element decl interface
+    // -----------------------------------------------------------------------
+    virtual XMLAttDef* findAttr
+    (
+        const   XMLCh* const    qName
+        , const unsigned int    uriId
+        , const XMLCh* const    baseName
+        , const LookupOpts      options
+        ,       bool&           wasAdded
+    )   const = 0;
+    virtual XMLAttDefList& getAttDefList() const = 0;
+    virtual const XMLCh* getBaseName() const = 0;
+    virtual CharDataOpts getCharDataOpts() const = 0;
+    virtual const XMLCh* getFullName() const = 0;
+    virtual bool hasAttDefs() const = 0;
+    virtual bool resetDefs() = 0;
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    XMLContentModel* getContentModel();
+    const XMLContentModel* getContentModel() const;
+    CreateReasons getCreateReason() const;
+    unsigned int getId() const;
+    bool isDeclared() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setContentModel(XMLContentModel* const newModelToAdopt);
+    void setCreateReason(const CreateReasons newReason);
+    void setId(const unsigned int newId);
+
+
+    // -----------------------------------------------------------------------
+    //  Miscellaneous methods
+    // -----------------------------------------------------------------------
+    const XMLCh* getFormattedContentModel
+    (
+        const   XMLValidator&   validator
+    )   const;
+    const XMLCh* getKey() const;
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden constructors
+    // -----------------------------------------------------------------------
+    XMLElementDecl();
+
+
+    // -----------------------------------------------------------------------
+    //  Protected, virtual methods
+    // -----------------------------------------------------------------------
+    virtual XMLContentModel* makeContentModel() const = 0;
+    virtual XMLCh* formatContentModel
+    (
+        const   XMLValidator&   validator
+    )   const = 0;
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLElementDecl(const XMLElementDecl&);
+    void operator=(const XMLElementDecl&);
+
+
+    // -----------------------------------------------------------------------
+    //  Data members
+    //
+    //  fContentModel
+    //      The content model object for this element. It is stored here via
+    //      its abstract interface.
+    //
+    //  fCreateReason
+    //      We sometimes have to put an element decl object into the elem
+    //      decl pool before the element's declaration is seen, such as when
+    //      its used in another element's content model or an att list is
+    //      seen for it. This flag tells us whether its been declared, and
+    //      if not why it had to be created.
+    //
+    //  fFormattedModel
+    //      This is a faulted in member. When the outside world asks for
+    //      our content model as a string, we format it and fault it into
+    //      this field (to avoid doing the formatted over and over.)
+    //
+    //  fId
+    //      The unique id of this element. This is created by the derived
+    //      class, or more accurately the validator that owns the objects
+    //      of the derived types. But, since they all have to have them, we
+    //      let them all store the id here. It is defaulted to have the
+    //      value fgInvalidElem until explicitly set.
+    // -----------------------------------------------------------------------
+    XMLContentModel*    fContentModel;
+    CreateReasons       fCreateReason;
+    XMLCh*              fFormattedModel;
+    unsigned int        fId;
+};
+
+
+// ---------------------------------------------------------------------------
+//  XMLElementDecl: Miscellaneous methods
+// ---------------------------------------------------------------------------
+inline const XMLCh* XMLElementDecl::getKey() const
+{
+    //
+    //  We just call the virtual method, since only the derived class knows
+    //  what form the full name should take.
+    //
+    return getFullName();
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLElementDecl: Getter methods
+// ---------------------------------------------------------------------------
+inline XMLContentModel* XMLElementDecl::getContentModel()
+{
+    if (!fContentModel)
+        fContentModel = makeContentModel();
+    return fContentModel;
+}
+
+inline const XMLContentModel* XMLElementDecl::getContentModel() const
+{
+    // Fault in the content model (which requires a cast off of const)
+    if (!fContentModel)
+        ((XMLElementDecl*)this)->fContentModel = makeContentModel();
+    return fContentModel;
+}
+
+inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const
+{
+    return fCreateReason;
+}
+
+inline unsigned int XMLElementDecl::getId() const
+{
+    return fId;
+}
+
+inline bool XMLElementDecl::isDeclared() const
+{
+    return (fCreateReason == Declared);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLElementDecl: Setter methods
+// ---------------------------------------------------------------------------
+inline void
+XMLElementDecl::setContentModel(XMLContentModel* const newModelToAdopt)
+{
+    delete fContentModel;
+    fContentModel = newModelToAdopt;
+}
+
+inline void
+XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason)
+{
+    fCreateReason = newReason;
+}
+
+inline void XMLElementDecl::setId(const unsigned int newId)
+{
+    fId = newId;
+}
+
+#endif
diff --git a/src/framework/XMLEntityDecl.cpp b/src/framework/XMLEntityDecl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ba19198c3ace2da7e20ca3d5df2e8676190363a9
--- /dev/null
+++ b/src/framework/XMLEntityDecl.cpp
@@ -0,0 +1,176 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:32  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:38  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/XMLUni.hpp>
+#include <util/XMLString.hpp>
+#include <framework/XMLEntityDecl.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  XMLEntityDecl: Constructors and Destructor
+// ---------------------------------------------------------------------------
+XMLEntityDecl::XMLEntityDecl() :
+
+    fName(0)
+    , fNotationName(0)
+    , fPublicId(0)
+    , fSystemId(0)
+    , fValue(0)
+    , fValueLen(0)
+{
+}
+
+XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName) :
+
+    fName(0)
+    , fNotationName(0)
+    , fPublicId(0)
+    , fSystemId(0)
+    , fValue(0)
+    , fValueLen(0)
+{
+    fName = XMLString::replicate(entName);
+}
+
+XMLEntityDecl::XMLEntityDecl(const  XMLCh* const    entName
+                            , const XMLCh* const    value) :
+    fName(0)
+    , fNotationName(0)
+    , fPublicId(0)
+    , fSystemId(0)
+    , fValue(0)
+    , fValueLen(0)
+{
+    try
+    {
+        fName = XMLString::replicate(entName);
+        fValue = XMLString::replicate(value);
+        fValueLen = XMLString::stringLen(value);
+    }
+
+    catch(...)
+    {
+        cleanUp();
+    }
+}
+
+XMLEntityDecl::XMLEntityDecl(const  XMLCh* const    entName
+                            , const XMLCh           value) :
+    fName(0)
+    , fNotationName(0)
+    , fPublicId(0)
+    , fSystemId(0)
+    , fValue(0)
+    , fValueLen(0)
+{
+    try
+    {
+        fValue = new XMLCh[2];
+        fValue[0] = value;
+        fValue[1] = chNull;
+        fValueLen = 1;
+        fName = XMLString::replicate(entName);
+    }
+
+    catch(...)
+    {
+        cleanUp();
+    }
+}
+
+XMLEntityDecl::~XMLEntityDecl()
+{
+    cleanUp();
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLEntityDecl: Setter methods
+// ---------------------------------------------------------------------------
+void XMLEntityDecl::setName(const XMLCh* const entName)
+{
+    // Clean up the current name stuff
+    delete [] fName;
+    fName = 0;
+    fName = XMLString::replicate(entName);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLEntityDecl: Private helper methods
+// ---------------------------------------------------------------------------
+void XMLEntityDecl::cleanUp()
+{
+    delete [] fName;
+    delete [] fNotationName;
+    delete [] fValue;
+    delete [] fPublicId;
+    delete [] fSystemId;
+}
diff --git a/src/framework/XMLEntityDecl.hpp b/src/framework/XMLEntityDecl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..7f5fb89ac3a0195278aec91d38a4aaff757edd7e
--- /dev/null
+++ b/src/framework/XMLEntityDecl.hpp
@@ -0,0 +1,287 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:32  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:38  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(XMLENTITYDECL_HPP)
+#define XMLENTITYDECL_HPP
+
+#include <util/XMLString.hpp>
+
+//
+//  This class defines that core information that defines an entity, no
+//  matter what validator is used. Each validator will create a derivative
+//  of this class which adds any extra information it requires.
+//
+//  This class supportes keyed collection semantics via the getKey() method
+//  which extracts the key field, the entity name in this case.
+//
+class XMLPARSER_EXPORT XMLEntityDecl
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLEntityDecl();
+    XMLEntityDecl
+    (
+        const   XMLCh* const    entName
+    );
+    XMLEntityDecl
+    (
+        const   XMLCh* const    entName
+        , const XMLCh* const    value
+    );
+    XMLEntityDecl
+    (
+        const   XMLCh* const    entName
+        , const XMLCh           value
+    );
+    virtual ~XMLEntityDecl();
+
+
+    // -----------------------------------------------------------------------
+    //  Virtual entity decl interface
+    // -----------------------------------------------------------------------
+    virtual bool getDeclaredInIntSubset() const = 0;
+    virtual bool getIsParameter() const = 0;
+    virtual bool getIsSpecialChar() const = 0;
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getId() const;
+    const XMLCh* getName() const;
+    const XMLCh* getNotationName() const;
+    const XMLCh* getPublicId() const;
+    const XMLCh* getSystemId() const;
+    const XMLCh* getValue() const;
+    unsigned int getValueLen() const;
+    bool isExternal() const;
+    bool isUnparsed() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setId(const unsigned int newId);
+    void setName
+    (
+        const   XMLCh* const    entName
+    );
+    void setNotationName(const XMLCh* const newName);
+    void setPublicId(const XMLCh* const newId);
+    void setSystemId(const XMLCh* const newId);
+    void setValue(const XMLCh* const newValue);
+
+
+    // -----------------------------------------------------------------------
+    //  Support named pool syntax
+    // -----------------------------------------------------------------------
+    const XMLCh* getKey() const;
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLEntityDecl(const XMLEntityDecl&);
+    void operator=(XMLEntityDecl&);
+
+
+    // -----------------------------------------------------------------------
+    //  XMLEntityDecl: Private helper methods
+    // -----------------------------------------------------------------------
+    void cleanUp();
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fId
+    //      This is the unique id given to this entity decl.
+    //
+    //  fName
+    //      The name of the enitity. Entity names are never namespace based.
+    //
+    //  fNotationName
+    //      The optional notation of the entity. If there was none, then its
+    //      empty.
+    //
+    //  fPublicId
+    //      The public id of the entity, which can be empty.
+    //
+    //  fSystemId
+    //      The system id of the entity.
+    //
+    //  fValue
+    //  fValueLen
+    //      The entity's value and length, which is only valid if its an
+    //      internal style entity.
+    // -----------------------------------------------------------------------
+    unsigned int    fId;
+	XMLCh*          fName;
+    XMLCh*          fNotationName;
+    XMLCh*          fPublicId;
+    XMLCh*          fSystemId;
+    XMLCh*          fValue;
+    unsigned int    fValueLen;
+};
+
+
+// ---------------------------------------------------------------------------
+//  XMLEntityDecl: Getter methods
+// ---------------------------------------------------------------------------
+inline unsigned int XMLEntityDecl::getId() const
+{
+    return fId;
+}
+
+inline const XMLCh* XMLEntityDecl::getName() const
+{
+    return fName;
+}
+
+inline const XMLCh* XMLEntityDecl::getNotationName() const
+{
+    return fNotationName;
+}
+
+inline const XMLCh* XMLEntityDecl::getPublicId() const
+{
+    return fPublicId;
+}
+
+inline const XMLCh* XMLEntityDecl::getSystemId() const
+{
+    return fSystemId;
+}
+
+inline const XMLCh* XMLEntityDecl::getValue() const
+{
+    return fValue;
+}
+
+inline unsigned int XMLEntityDecl::getValueLen() const
+{
+    return fValueLen;
+}
+
+inline bool XMLEntityDecl::isExternal() const
+{
+    // If it has a system or public id, its external
+    return ((fPublicId != 0) || (fSystemId != 0));
+}
+
+inline bool XMLEntityDecl::isUnparsed() const
+{
+    // If it has a notation, its unparsed
+    return (fNotationName != 0);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLEntityDecl: Setter methods
+// ---------------------------------------------------------------------------
+inline void XMLEntityDecl::setId(const unsigned int newId)
+{
+    fId = newId;
+}
+
+inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
+{
+    delete [] fNotationName;
+    fNotationName = XMLString::replicate(newName);
+}
+
+inline void XMLEntityDecl::setPublicId(const XMLCh* const newId)
+{
+    delete [] fPublicId;
+    fPublicId = XMLString::replicate(newId);
+}
+
+inline void XMLEntityDecl::setSystemId(const XMLCh* const newId)
+{
+    delete [] fSystemId;
+    fSystemId = XMLString::replicate(newId);
+}
+
+inline void XMLEntityDecl::setValue(const XMLCh* const newValue)
+{
+    delete [] fValue;
+    fValue = XMLString::replicate(newValue);
+    fValueLen = XMLString::stringLen(newValue);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLEntityDecl: Support named pool syntax
+// ---------------------------------------------------------------------------
+inline const XMLCh* XMLEntityDecl::getKey() const
+{
+    return fName;
+}
+
+#endif
diff --git a/src/framework/XMLEntityHandler.hpp b/src/framework/XMLEntityHandler.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..70ea5f84f8e188c2daf487cfae3986a9661ae9c9
--- /dev/null
+++ b/src/framework/XMLEntityHandler.hpp
@@ -0,0 +1,171 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+  * $Log$
+  * Revision 1.1  1999/11/09 01:08:33  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:44:38  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  */
+
+
+#if !defined(XMLENTITYHANDLER_HPP)
+#define XMLENTITYHANDLER_HPP
+
+#include <util/XML4CDefs.hpp>
+
+class InputSource;
+class XMLBuffer;
+
+
+//
+//  This abstract class is a callback mechanism for the scanner. By creating
+//  a derivative of this class and plugging into the scanner, the scanner
+//  will call back on the object's methods to entity events.
+//
+class XMLPARSER_EXPORT XMLEntityHandler
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors are hidden, only the virtual destructor is exposed
+    // -----------------------------------------------------------------------
+    virtual ~XMLEntityHandler()
+    {
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  The virtual entity handler interface
+    // -----------------------------------------------------------------------
+    /** @name The pure virtual methods in this interface. */
+    //@{
+
+    /**
+      * This method get called after the scanner has finished reading from
+      * the given input source while processing external entity references.
+      *
+      * @param inputSource The input source for the entity
+      */
+    virtual void endInputSource(const InputSource& inputSource) = 0;
+
+    /**
+      * This method allows the passes the scanned systemId to the entity
+      * handler, thereby giving it a chance to provide any customized
+      * handling like resolving relative path names. The scanner first
+      * calls this method before calling <code>resolveEntity</code>.
+      *
+      * @param systemId The system id extracted by the scanner from the
+      *                 input source.
+      * @param toFill The buffer in which the fully expanded system id needs
+      *               to be stored.
+      */
+    virtual const bool expandSystemId
+    (
+        const   XMLCh* const    systemId
+        ,       XMLBuffer&      toFill
+    ) = 0;
+
+    /**
+      * This method allows the entity handler to reset itself, so that
+      * it can be used again.
+      */
+    virtual void resetEntities() = 0;
+
+    /**
+      * This method allows the entity handler to provide customized
+      * application specific entity resolution. This method is defined
+      * by SAX 1.0 API.
+      *
+      * @param systemId The system id of the external entity reference. 
+      * @param publicId The public id of the external entity reference.
+      */
+    virtual InputSource* resolveEntity
+    (
+        const   XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    ) = 0;
+
+    /**
+      * This method will be called before the scanner starts reading
+      * from an input source while processing external entity references.
+      *
+      * @param inputSource The external input source.
+      */
+    virtual void startInputSource(const InputSource& inputSource) = 0;
+    //@}
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden Constructors
+    // -----------------------------------------------------------------------
+    XMLEntityHandler()
+    {
+    }
+
+
+private:
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and destructor
+    // -----------------------------------------------------------------------
+    XMLEntityHandler(const XMLEntityHandler&);
+    void operator=(const XMLEntityHandler&);
+};
+
+#endif
diff --git a/src/framework/XMLErrorCodes.hpp b/src/framework/XMLErrorCodes.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..a146573b64e32cae246d40f5d264dbe3723442b9
--- /dev/null
+++ b/src/framework/XMLErrorCodes.hpp
@@ -0,0 +1,175 @@
+// This file is generated, don't edit it!!
+
+#if !defined(ERRHEADER_XML4CErrs)
+#define ERRHEADER_XML4CErrs
+
+#include <framework/XMLErrorReporter.hpp>
+
+class XML4CErrs
+{
+public :
+    enum Codes
+    {
+        NoError                            = 0
+      , W_LowBounds                        = 1
+      , NotationAlreadyExists              = 2
+      , AttListAlreadyExists               = 3
+      , ContradictoryEncoding              = 4
+      , UndeclaredElemInCM                 = 5
+      , UndeclaredElemInAttList            = 6
+      , W_HighBounds                       = 7
+      , E_LowBounds                        = 8
+      , ExpectedCommentOrCDATA             = 9
+      , ExpectedAttrName                   = 10
+      , ExpectedNotationName               = 11
+      , NoRepInMixed                       = 12
+      , BadDefAttrDecl                     = 13
+      , ExpectedDefAttrDecl                = 14
+      , AttListSyntaxError                 = 15
+      , ExpectedEqSign                     = 16
+      , DupAttrName                        = 17
+      , BadIdForXMLLangAttr                = 18
+      , ExpectedElementName                = 19
+      , MustStartWithXMLDecl               = 20
+      , CommentsMustStartWith              = 21
+      , InvalidDocumentStructure           = 22
+      , ExpectedDeclString                 = 23
+      , BadXMLVersion                      = 24
+      , UnsupportedXMLVersion              = 25
+      , UnterminatedXMLDecl                = 26
+      , BadXMLEncoding                     = 27
+      , BadStandalone                      = 28
+      , UnterminatedComment                = 29
+      , PINameExpected                     = 30
+      , UnterminatedPI                     = 31
+      , InvalidCharacter                   = 32
+      , UnexpectedTextBeforeRoot           = 33
+      , UnterminatedStartTag               = 34
+      , ExpectedAttrValue                  = 35
+      , UnterminatedEndTag                 = 36
+      , ExpectedAttributeType              = 37
+      , ExpectedEndOfTagX                  = 38
+      , ExpectedMarkup                     = 39
+      , NotValidAfterContent               = 40
+      , ExpectedComment                    = 41
+      , ExpectedCommentOrPI                = 42
+      , ExpectedWhitespace                 = 43
+      , NoRootElemInDOCTYPE                = 44
+      , ExpectedQuotedString               = 45
+      , ExpectedPublicId                   = 46
+      , InvalidPublicIdChar                = 47
+      , UnterminatedDOCTYPE                = 48
+      , InvalidCharacterInIntSubset        = 49
+      , ExpectedCDATA                      = 50
+      , InvalidInitialNameChar             = 51
+      , InvalidNameChar                    = 52
+      , UnexpectedWhitespace               = 53
+      , InvalidCharacterInAttrValue        = 54
+      , ExpectedMarkupDecl                 = 55
+      , TextDeclNotLegalHere               = 56
+      , ConditionalSectInIntSubset         = 57
+      , ExpectedPEName                     = 58
+      , UnterminatedEntityDecl             = 59
+      , InvalidCharacterRef                = 60
+      , UnterminatedCharRef                = 61
+      , ExpectedEntityRefName              = 62
+      , EntityNotFound                     = 63
+      , NoUnparsedEntityRefs               = 64
+      , UnterminatedEntityRef              = 65
+      , RecursiveEntity                    = 66
+      , PartialMarkupInEntity              = 67
+      , UnterminatedElementDecl            = 68
+      , ExpectedContentSpecExpr            = 69
+      , ExpectedAsterisk                   = 70
+      , UnterminatedContentModel           = 71
+      , ExpectedSystemId                   = 72
+      , ExpectedSystemOrPublicId           = 73
+      , UnterminatedNotationDecl           = 74
+      , ExpectedSeqChoiceLeaf              = 75
+      , ExpectedChoiceOrCloseParen         = 76
+      , ExpectedSeqOrCloseParen            = 77
+      , ExpectedEnumValue                  = 78
+      , ExpectedEnumSepOrParen             = 79
+      , UnterminatedEntityLiteral          = 80
+      , MoreEndThanStartTags               = 81
+      , IllegalRefInStandalone             = 82
+      , ExpectedOpenParen                  = 83
+      , AttrAlreadyUsedInSTag              = 84
+      , BracketInAttrValue                 = 85
+      , Expected2ndSurrogateChar           = 86
+      , ExpectedEndOfConditional           = 87
+      , ExpectedIncOrIgn                   = 88
+      , ExpectedINCLUDEBracket             = 89
+      , ExpectedTextDecl                   = 90
+      , ExpectedXMLDecl                    = 91
+      , UnexpectedEOE                      = 92
+      , PEPropogated                       = 93
+      , ExtraCloseSquare                   = 94
+      , PERefInMarkupInIntSubset           = 95
+      , EntityPropogated                   = 96
+      , ExpectedNumericalCharRef           = 97
+      , ExpectedOpenSquareBracket          = 98
+      , BadSequenceInCharData              = 99
+      , IllegalSequenceInComment           = 100
+      , UnterminatedCDATASection           = 101
+      , ExpectedNDATA                      = 102
+      , NDATANotValidForPE                 = 103
+      , HexRadixMustBeLowerCase            = 104
+      , DeclStringRep                      = 105
+      , DeclStringsInWrongOrder            = 106
+      , NoExtRefsInAttValue                = 107
+      , XMLDeclMustBeLowerCase             = 108
+      , ExpectedEntityValue                = 109
+      , BadDigitForRadix                   = 110
+      , EndedWithTagsOnStack               = 111
+      , AmbiguousContentModel              = 112
+      , NestedCDATA                        = 113
+      , UnknownPrefix                      = 114
+      , PartialTagMarkupError              = 115
+      , EmptyMainEntity                    = 116
+      , CDATAOutsideOfContent              = 117
+      , OnlyCharRefsAllowedHere            = 118
+      , Unexpected2ndSurrogateChar         = 119
+      , NoPIStartsWithXML                  = 120
+      , XMLDeclMustBeFirst                 = 121
+      , XMLVersionRequired                 = 122
+      , StandaloneNotLegal                 = 123
+      , TooManyColonsInName                = 124
+      , InvalidColonPos                    = 125
+      , ColonNotLegalWithNS                = 126
+      , SysException                       = 127
+      , XMLException                       = 128
+      , UnexpectedEOF                      = 129
+      , E_HighBounds                       = 130
+      , V_LowBounds                        = 131
+      , V_HighBounds                       = 132
+    };
+
+    static bool isFatal(const XML4CErrs::Codes toCheck)
+    {
+        return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
+    }
+
+    static bool isWarning(const XML4CErrs::Codes toCheck)
+    {
+        return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
+    }
+
+    static bool isValid(const XML4CErrs::Codes toCheck)
+    {
+        return ((toCheck >= V_LowBounds) && (toCheck <= V_HighBounds));
+    }
+
+    static XMLErrorReporter::ErrTypes errorType(const XML4CErrs::Codes toCheck)
+    {
+       if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
+           return XMLErrorReporter::ErrType_Warning;
+       else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
+            return XMLErrorReporter::ErrType_Fatal;
+       else if ((toCheck >= V_LowBounds) && (toCheck <= V_HighBounds))
+            return XMLErrorReporter::ErrType_Invalid;
+       return XMLErrorReporter::ErrTypes_Unknown;
+    }
+};
+#endif
+
diff --git a/src/framework/XMLErrorReporter.hpp b/src/framework/XMLErrorReporter.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..8c8d91e3728220d285902d229b2846c90bbd88e6
--- /dev/null
+++ b/src/framework/XMLErrorReporter.hpp
@@ -0,0 +1,140 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+ /**
+  * $Log$
+  * Revision 1.1  1999/11/09 01:08:34  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:44:39  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  */
+
+
+#if !defined(XMLERRORREPORTER_HPP)
+#define XMLERRORREPORTER_HPP
+
+#include <util/XML4CDefs.hpp>
+#include <util/XMLMsgLoader.hpp>
+
+
+//
+//  This abstract class defines a callback mechanism for the scanner. By
+//  creating a derivate of this class and plugging an instance of that class
+//  into the scanner, the scanner will call back on the object's methods
+//  to report error events.
+//
+class XMLPARSER_EXPORT XMLErrorReporter
+{
+public:
+    // -----------------------------------------------------------------------
+    //  The types of errors we can issue
+    // -----------------------------------------------------------------------
+    enum ErrTypes
+    {
+        ErrType_Warning
+        , ErrType_Invalid
+        , ErrType_Fatal
+
+        , ErrTypes_Unknown
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Constructors are hidden, only the virtual destructor is exposed
+    // -----------------------------------------------------------------------
+    virtual ~XMLErrorReporter()
+    {
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  The error handler interface
+    // -----------------------------------------------------------------------
+    virtual void error
+    (
+        const   unsigned int        errCode
+        , const XMLCh* const        errDomain
+        , const ErrTypes            type
+        , const XMLCh* const        errorText
+        , const XMLCh* const        systemId
+        , const XMLCh* const        publicId
+        , const unsigned int        lineNum
+        , const unsigned int        colNum
+    ) = 0;
+
+    virtual void resetErrors() = 0;
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden Constructors
+    // -----------------------------------------------------------------------
+    XMLErrorReporter()
+    {
+    }
+
+
+private:
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and destructor
+    // -----------------------------------------------------------------------
+    XMLErrorReporter(const XMLErrorReporter&);
+    void operator=(const XMLErrorReporter&);
+};
+
+#endif
diff --git a/src/framework/XMLNotationDecl.cpp b/src/framework/XMLNotationDecl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..56f34bc011a2e91afefd72518297e0a34dde443a
--- /dev/null
+++ b/src/framework/XMLNotationDecl.cpp
@@ -0,0 +1,132 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:35  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:39  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <framework/XMLNotationDecl.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  XMLNotationDecl: Constructors and operators
+// ---------------------------------------------------------------------------
+XMLNotationDecl::XMLNotationDecl() :
+
+    fName(0)
+    , fPublicId(0)
+    , fSystemId(0)
+{
+}
+
+XMLNotationDecl::XMLNotationDecl(   const   XMLCh* const    notName
+                                    , const XMLCh* const    pubId
+                                    , const XMLCh* const    sysId) :
+    fName(0)
+    , fPublicId(0)
+    , fSystemId(0)
+{
+    try
+    {
+        fPublicId = XMLString::replicate(pubId);
+        fSystemId = XMLString::replicate(sysId);
+        setName(notName);
+    }
+
+    catch(...)
+    {
+        cleanUp();
+    }
+}
+
+XMLNotationDecl::~XMLNotationDecl()
+{
+    cleanUp();
+}
+
+
+// -----------------------------------------------------------------------
+//  Setter methods
+// -----------------------------------------------------------------------
+void XMLNotationDecl::setName(const XMLCh* const notName)
+{
+    // Clean up the current name stuff and replicate the passed name
+    delete [] fName;
+    fName = 0;
+    fName = XMLString::replicate(notName);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLNotationDecl: Private helper methods
+// ---------------------------------------------------------------------------
+void XMLNotationDecl::cleanUp()
+{
+    delete [] fName;
+    delete [] fPublicId;
+    delete [] fSystemId;
+}
diff --git a/src/framework/XMLNotationDecl.hpp b/src/framework/XMLNotationDecl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..2bbbcb3f33480ed4c7ce589c7a5c3627a361a091
--- /dev/null
+++ b/src/framework/XMLNotationDecl.hpp
@@ -0,0 +1,212 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:35  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:39  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(XMLNOTATIONDECL_HPP)
+#define XMLNOTATIONDECL_HPP
+
+#include <util/XML4CDefs.hpp>
+#include <util/XMLString.hpp>
+
+//
+//  This class represents the core information about a notation declaration
+//  that all validators must at least support. Each validator will create a
+//  derivative of this class which adds any information it requires for its
+//  own extra needs.
+//
+class XMLPARSER_EXPORT XMLNotationDecl
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLNotationDecl();
+    XMLNotationDecl
+    (
+        const   XMLCh* const    notName
+        , const XMLCh* const    pubId
+        , const XMLCh* const    sysId
+    );
+    ~XMLNotationDecl();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getId() const;
+    const XMLCh* getName() const;
+    const XMLCh* getPublicId() const;
+    const XMLCh* getSystemId() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setId(const unsigned int newId);
+    void setName
+    (
+        const   XMLCh* const    notName
+    );
+    void setPublicId(const XMLCh* const newId);
+    void setSystemId(const XMLCh* const newId);
+
+
+    // -----------------------------------------------------------------------
+    //  Support named collection element semantics
+    // -----------------------------------------------------------------------
+    const XMLCh* getKey() const;
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLNotationDecl(const XMLNotationDecl&);
+    void operator=(const XMLNotationDecl&);
+
+
+    // -----------------------------------------------------------------------
+    //  XMLNotationDecl: Private helper methods
+    // -----------------------------------------------------------------------
+    void cleanUp();
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fId
+    //      This is the unique id given to this notation decl.
+    //
+    //  fName
+    //      The notation's name, which identifies the type of notation it
+    //      applies to.
+    //
+    //  fPublicId
+    //      The text of the notation's public id, if any.
+    //
+    //  fSystemId
+    //      The text of the notation's system id, if any.
+    // -----------------------------------------------------------------------
+    unsigned int    fId;
+	XMLCh*          fName;
+    XMLCh*          fPublicId;
+    XMLCh*          fSystemId;
+};
+
+
+// -----------------------------------------------------------------------
+//  Getter methods
+// -----------------------------------------------------------------------
+inline unsigned int XMLNotationDecl::getId() const
+{
+    return fId;
+}
+
+inline const XMLCh* XMLNotationDecl::getName() const
+{
+    return fName;
+}
+
+inline const XMLCh* XMLNotationDecl::getPublicId() const
+{
+    return fPublicId;
+}
+
+inline const XMLCh* XMLNotationDecl::getSystemId() const
+{
+    return fSystemId;
+}
+
+
+// -----------------------------------------------------------------------
+//  Setter methods
+// -----------------------------------------------------------------------
+inline void XMLNotationDecl::setId(const unsigned int newId)
+{
+    fId = newId;
+}
+
+inline void XMLNotationDecl::setPublicId(const XMLCh* const newId)
+{
+    delete [] fPublicId;
+    fPublicId = XMLString::replicate(newId);
+}
+
+inline void XMLNotationDecl::setSystemId(const XMLCh* const newId)
+{
+    delete [] fSystemId;
+    fSystemId = XMLString::replicate(newId);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLNotationDecl: Support named pool element semantics
+// ---------------------------------------------------------------------------
+inline const XMLCh* XMLNotationDecl::getKey() const
+{
+    return fName;
+}
+
+#endif
diff --git a/src/framework/XMLPScanToken.hpp b/src/framework/XMLPScanToken.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..946e2f48e335721ad9c72a30864c358a517a8021
--- /dev/null
+++ b/src/framework/XMLPScanToken.hpp
@@ -0,0 +1,181 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:36  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:39  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(XMLPSCANTOKEN_HPP)
+#define XMLPSCANTOKEN_HPP
+
+class XMLScanner;
+
+//
+//  This simple class is used as a sanity check when the scanner is used to
+//  do progressive parsing. It insures that things are not done out of
+//  sequence and that sequences of scan calls are made correctly to the
+//  right scanner instances.
+//
+class XMLPARSER_EXPORT XMLPScanToken
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLPScanToken();
+    XMLPScanToken(const XMLPScanToken& toCopy);
+    ~XMLPScanToken();
+
+
+    // -----------------------------------------------------------------------
+    //  Public operators
+    // -----------------------------------------------------------------------
+    XMLPScanToken& operator=(const XMLPScanToken& toCopy);
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  XMLScanner is our friend, can you say friend? Sure...
+    // -----------------------------------------------------------------------
+    friend class XMLScanner;
+
+
+    // -----------------------------------------------------------------------
+    //  Hidden methods for use by XMLScanner
+    // -----------------------------------------------------------------------
+    void set
+    (
+        const   XMLUInt32   scannerId
+        , const XMLUInt32   sequenceId
+    );
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fScannerId
+    //      This field is set to the id of the scanner, to catch problems
+    //      where a token is gotten from one scanner and passed to another.
+    //      Each scanner is assigned an incrementing id.
+    //
+    //  fSequenceId
+    //      In order to avoid problems such as calling scanNext() without
+    //      a call to scanFirst() and such, this value is set when scanFirst()
+    //      is called and matches this token to the current sequence id of
+    //      the scanner.
+    // -----------------------------------------------------------------------
+    XMLUInt32   fScannerId;
+    XMLUInt32   fSequenceId;
+};
+
+
+// ---------------------------------------------------------------------------
+//  XMLPScanToken: Constructors and Operators
+// ---------------------------------------------------------------------------
+inline XMLPScanToken::XMLPScanToken() :
+
+    fScannerId(0)
+    , fSequenceId(0)
+{
+}
+
+inline XMLPScanToken::XMLPScanToken(const XMLPScanToken& toCopy) :
+
+    fScannerId(toCopy.fScannerId)
+    , fSequenceId(toCopy.fSequenceId)
+{
+}
+
+inline XMLPScanToken::~XMLPScanToken()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLPScanToken: Public operators
+// ---------------------------------------------------------------------------
+inline XMLPScanToken& XMLPScanToken::operator=(const XMLPScanToken& toCopy)
+{
+    if (this == &toCopy)
+        return *this;
+
+    fScannerId = toCopy.fScannerId;
+    fSequenceId = toCopy.fSequenceId;
+
+    return *this;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLPScanToken: Hidden methods
+// ---------------------------------------------------------------------------
+inline void XMLPScanToken::set( const   XMLUInt32   scannerId
+                                , const XMLUInt32   sequenceId)
+{
+    fScannerId = scannerId;
+    fSequenceId = sequenceId;
+}
+
+
+#endif
diff --git a/src/framework/XMLRecognizer.cpp b/src/framework/XMLRecognizer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..141a8df1b1643a28b4b4243a2bad220f5bfbc3a6
--- /dev/null
+++ b/src/framework/XMLRecognizer.cpp
@@ -0,0 +1,255 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ *  $Log$
+ *  Revision 1.1  1999/11/09 01:08:37  twl
+ *  Initial revision
+ *
+ *  Revision 1.2  1999/11/08 20:44:40  rahul
+ *  Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/RuntimeException.hpp>
+#include <util/XMLString.hpp>
+#include <util/XMLUni.hpp>
+#include <framework/XMLRecognizer.hpp>
+#include <memory.h>
+#include <string.h>
+
+
+// ---------------------------------------------------------------------------
+//  Local data
+//
+//  gEncodingNameMap
+//      This array maps the Encodings enum values to their canonical names.
+//      Be sure to keep this in sync with that enum!
+//
+//  gEBCDICPre
+//      The byte sequence prefix for a legal EBCDIC encoded file. This tells
+//      enough to let us read the XMLDecl in EBCDIC and get the real encoding
+//      string out.
+//
+//  gUCS4XXX
+//      The byte sequence prefixes for a legal UCS encoded file. If we get
+//      one of these, we can read the decl line in UCS and get the actual
+//      encoding.
+//
+//  gUTF16XXX
+//      These are the byte sequences that a legal UTF-16 (without BOM) file
+//      can start with. The BOM is checked for, but if not found we still
+//      will try for this sequence. Once we hit one of these, we can read
+//      the first line in UTF-6 and get the real encoding out.
+// ---------------------------------------------------------------------------
+static const XMLCh* gEncodingNameMap[XMLRecognizer::Encodings_Count] =
+{
+    XMLUni::fgEBCDICEncodingString
+    , XMLUni::fgUCS4BEncodingString
+    , XMLUni::fgUCS4LEncodingString
+    , XMLUni::fgUSASCIIEncodingString
+    , XMLUni::fgUTF8EncodingString
+    , XMLUni::fgUTF16BEncodingString
+    , XMLUni::fgUTF16LEncodingString
+};
+static const XMLByte    gEBCDICPre[]    = { 0x4C, 0x6F, 0xA7, 0x94, 0x93, 0x40 };
+static const XMLByte    gUCS4BPre[]     = { 0x00, 0x00, 0x00, 0x3C };
+static const XMLByte    gUCS4LPre[]     = { 0x3C, 0x00, 0x00, 0x00 };
+static const XMLByte    gUTF16BPre[]    = { 0x00, 0x3C, 0x00, 0x3F };
+static const XMLByte    gUTF16LPre[]    = { 0x3C, 0x00, 0x3F, 0x00 };
+static const char       gXMLDecl_ASCII[]= { 0x3C, 0x3F, 0x78, 0x6D, 0x6C };
+
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLRecognizer: Encoding recognition methods
+// ---------------------------------------------------------------------------
+XMLRecognizer::Encodings
+XMLRecognizer::basicEncodingProbe(  const   XMLByte* const  rawBuffer
+                                    , const unsigned int    rawByteCount)
+{
+    //
+    //  As an optimization to check the 90% case, check first for the ASCII
+    //  sequence '<?xml', which means its either US-ASCII, UTF-8, or some
+    //  other encoding that we don't do manually but which happens to share
+    //  the US-ASCII code points for these characters. So just return UTF-8
+    //  to get us through the first line.
+    //
+    if (rawByteCount > 5)
+    {
+        if (!memcmp(rawBuffer, gXMLDecl_ASCII, 5))
+            return UTF_8;
+    }
+
+    //
+    //  If the count of raw bytes is less than 2, it cannot be anything
+    //  we understand, so return UTF-8 as a fallback.
+    //
+    if (rawByteCount < 2)
+        return UTF_8;
+
+    //
+    //  We know its at least two bytes, so lets check for a UTF-16 BOM. That
+    //  is quick to check and enough to identify two major encodings.
+    //
+    if ((rawBuffer[0] == 0xFE) && (rawBuffer[1] == 0xFF))
+        return UTF_16B;
+    else if ((rawBuffer[0] == 0xFF) && (rawBuffer[1] == 0xFE))
+        return UTF_16L;
+
+    //
+    //  Oh well, not one of those. So now lets see if we have at least 4
+    //  bytes. If not, then we are out of ideas and can return UTF-8 as the
+    //  fallback.
+    //
+    if (rawByteCount < 4)
+        return UTF_8;
+
+    //
+    //  We have at least 4 bytes. So lets check the 4 byte sequences that
+    //  indicate other UTF-16 and UCS encodings.
+    //
+    if ((rawBuffer[0] == 0x00) || (rawBuffer[0] == 0x3C))
+    {
+        if (!memcmp(rawBuffer, gUCS4BPre, 4))
+            return UCS_4B;
+        else if (!memcmp(rawBuffer, gUCS4LPre, 4))
+            return UCS_4L;
+        else if (!memcmp(rawBuffer, gUTF16BPre, 4))
+            return UTF_16B;
+        else if (!memcmp(rawBuffer, gUTF16LPre, 4))
+            return UTF_16L;
+    }
+
+    //
+    //  See if we have enough bytes to possibly match the EBCDIC prefix.
+    //  If so, try it.
+    //
+    if (rawByteCount > 5)
+    {
+        if (!memcmp(rawBuffer, gEBCDICPre, 5))
+            return EBCDIC;
+    }
+
+    //
+    //  Does not seem to be anything we know, so go with UTF-8 to get at
+    //  least through the first line and see what it really is.
+    //
+    return UTF_8;
+}
+
+
+XMLRecognizer::Encodings
+XMLRecognizer::encodingForName(const XMLCh* const encName)
+{
+    //
+    //  Compare the passed string, case insensitively, to the variations
+    //  that we recognize.
+    //
+    //  !!NOTE: Note that we don't handle EBCDIC here because we don't handle
+    //  that one ourselves. It is allowed to fall into 'other'.
+    //
+    if (!XMLString::compareIString(encName, XMLUni::fgUTF8EncodingString)
+    ||  !XMLString::compareIString(encName, XMLUni::fgUTF8EncodingString2))
+    {
+        return XMLRecognizer::UTF_8;
+    }
+     else if (!XMLString::compareIString(encName, XMLUni::fgUSASCIIEncodingString)
+          ||  !XMLString::compareIString(encName, XMLUni::fgUSASCIIEncodingString2)
+          ||  !XMLString::compareIString(encName, XMLUni::fgUSASCIIEncodingString3)
+          ||  !XMLString::compareIString(encName, XMLUni::fgUSASCIIEncodingString4))
+    {
+        return XMLRecognizer::US_ASCII;
+    }
+     else if (!XMLString::compareIString(encName, XMLUni::fgUTF16LEncodingString)
+          ||  !XMLString::compareIString(encName, XMLUni::fgUTF16LEncodingString2))
+    {
+        return XMLRecognizer::UTF_16L;
+    }
+     else if (!XMLString::compareIString(encName, XMLUni::fgUTF16BEncodingString)
+          ||  !XMLString::compareIString(encName, XMLUni::fgUTF16BEncodingString2))
+    {
+        return XMLRecognizer::UTF_16B;
+    }
+     else if (!XMLString::compareIString(encName, XMLUni::fgUCS4LEncodingString)
+          ||  !XMLString::compareIString(encName, XMLUni::fgUCS4LEncodingString2))
+    {
+        return XMLRecognizer::UCS_4L;
+    }
+     else if (!XMLString::compareIString(encName, XMLUni::fgUCS4BEncodingString)
+          ||  !XMLString::compareIString(encName, XMLUni::fgUCS4BEncodingString2))
+    {
+        return XMLRecognizer::UCS_4B;
+    }
+
+    // Return 'other' since we don't recognizer it
+    return XMLRecognizer::OtherEncoding;
+}
+
+
+const XMLCh*
+XMLRecognizer::nameForEncoding(const XMLRecognizer::Encodings theEncoding)
+{
+    if (theEncoding > Encodings_Count)
+        ThrowXML(RuntimeException, XML4CExcepts::XMLRec_UnknownEncoding);
+
+    return gEncodingNameMap[theEncoding];
+}
diff --git a/src/framework/XMLRecognizer.hpp b/src/framework/XMLRecognizer.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..9683613b3f3ec04c6b95cfff065278aa0060a033
--- /dev/null
+++ b/src/framework/XMLRecognizer.hpp
@@ -0,0 +1,154 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ *  $Log$
+ *  Revision 1.1  1999/11/09 01:08:37  twl
+ *  Initial revision
+ *
+ *  Revision 1.2  1999/11/08 20:44:40  rahul
+ *  Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(XMLRECOGNIZER_HPP)
+#define XMLRECOGNIZER_HPP
+
+//
+//  This class provides some simple code to recognize the encodings of
+//  XML files. This recognition only does very basic sensing of the encoding
+//  in a broad sense. Basically its just enough to let us get started and
+//  read the XMLDecl line. The scanner, once it reads the XMLDecl, will
+//  tell the reader any actual encoding string it found and the reader can
+//  update itself to be more specific at that point.
+//
+class XMLPARSER_EXPORT XMLRecognizer
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Class types
+    //
+    //  This enum represents the various encoding families that we have to
+    //  deal with individually at the scanner level. This does not indicate
+    //  the exact encoding, just the rough family that would let us scan
+    //  the XML/TextDecl to find the encoding string.
+    //
+    //  The 'L's and 'B's stand for little or big endian. We conditionally
+    //  create versions that will automatically map to the local UTF-16 and
+    //  UCS-4 endian modes.
+    //
+    //  OtherEncoding means that its some transcoder based encoding, i.e. not
+    //  one of the ones that we do internally. Its a special case and should
+    //  never be used directly outside of the reader.
+    //
+    //  NOTE: Keep this in sync with the name map array in the Cpp file!!
+    // -----------------------------------------------------------------------
+    enum Encodings
+    {
+        EBCDIC          = 0
+        , UCS_4B        = 1
+        , UCS_4L        = 2
+        , US_ASCII      = 3
+        , UTF_8         = 4
+        , UTF_16B       = 5
+        , UTF_16L       = 6
+
+        , Encodings_Count
+        , Encodings_Min = EBCDIC
+        , Encodings_Max = UTF_16L
+
+        , OtherEncoding = 999
+
+        #if defined(ENDIANMODE_BIG)
+        , Def_UTF16     = UTF_16B
+        , Def_UCS4      = UCS_4B
+        #else
+        , Def_UTF16     = UTF_16L
+        , Def_UCS4      = UCS_4L
+        #endif
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Encoding recognition methods
+    // -----------------------------------------------------------------------
+    static XMLRecognizer::Encodings basicEncodingProbe
+    (
+        const   XMLByte* const      rawBuffer
+        , const unsigned int        rawByteCount
+    );
+
+    static XMLRecognizer::Encodings encodingForName
+    (
+        const   XMLCh* const    theEncName
+    );
+
+    static const XMLCh* nameForEncoding(const Encodings theEncoding);
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors, operators, and destructor
+    //
+    //  This class is effectively being used as a namespace for some static
+    //  methods.
+    // -----------------------------------------------------------------------
+    XMLRecognizer();
+    ~XMLRecognizer();
+    void operator=(const XMLRecognizer&);
+};
+
+#endif
diff --git a/src/framework/XMLRefInfo.hpp b/src/framework/XMLRefInfo.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..2dc9926cf2d00d8e2e1012de1fb851b8abf3f8a5
--- /dev/null
+++ b/src/framework/XMLRefInfo.hpp
@@ -0,0 +1,209 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:37  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:40  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(XMLIDREFINFO_HPP)
+#define XMLIDREFINFO_HPP
+
+
+//
+//  This class provides a simples means to track ID Ref usage. Since id/idref
+//  semamatics are part of XML 1.0, any validator will likely to be able to
+//  track them. Instances of this class represent a reference and two markers,
+//  one for its being declared and another for its being used. When the
+//  document is done, one can look at each instance and, if used but not
+//  declared, its an error.
+//
+//  The getKey() method allows it to support keyed collection semantics. It
+//  returns the QName of the referenced name.
+//
+class XMLPARSER_EXPORT XMLRefInfo
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLRefInfo
+    (
+        const   XMLCh* const    refName
+        , const bool            fDeclared = false
+        , const bool            fUsed = false
+    );
+    ~XMLRefInfo();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    bool getDeclared() const;
+    const XMLCh* getRefName() const;
+    bool getUsed() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setDeclared(const bool newValue);
+    void setUsed(const bool newValue);
+
+
+    // -----------------------------------------------------------------------
+    //  Support hash table semantics
+    // -----------------------------------------------------------------------
+    XMLCh* getKey() const;
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLRefInfo();
+    XMLRefInfo(const XMLRefInfo&);
+    void operator=(XMLRefInfo&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fDeclared
+    //      The name was declared somewhere as an ID attribute.
+    //
+    //  fRefName
+    //      The name of the ref that this object represents. This is not a
+    //      name of the attribute, but of the value of an ID or IDREF attr
+    //      in content.
+    //
+    //  fUsed
+    //      The name was used somewhere in an IDREF/IDREFS attribute. If this
+    //      is true, but fDeclared is false, then the ref does not refer to
+    //      a declared ID.
+    // -----------------------------------------------------------------------
+    bool        fDeclared;
+    XMLCh*      fRefName;
+    bool        fUsed;
+};
+
+
+// ---------------------------------------------------------------------------
+//  XMLRefInfo: Constructors and Destructor
+// ---------------------------------------------------------------------------
+inline XMLRefInfo::XMLRefInfo(  const   XMLCh* const    refName
+                                , const bool            declared
+                                , const bool            used) :
+    fDeclared(declared)
+    , fRefName(XMLString::replicate(refName))
+    , fUsed(used)
+{
+}
+
+inline XMLRefInfo::~XMLRefInfo()
+{
+    delete [] fRefName;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLRefInfo: Getter methods
+// ---------------------------------------------------------------------------
+inline bool XMLRefInfo::getDeclared() const
+{
+    return fDeclared;
+}
+
+inline const XMLCh* XMLRefInfo::getRefName() const
+{
+    return fRefName;
+}
+
+inline bool XMLRefInfo::getUsed() const
+{
+    return fUsed;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLRefInfo: Setter methods
+// ---------------------------------------------------------------------------
+inline void XMLRefInfo::setDeclared(const bool newValue)
+{
+    fDeclared = newValue;
+}
+
+inline void XMLRefInfo::setUsed(const bool newValue)
+{
+    fUsed = newValue;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLRefInfo: Support hash table semantics
+// ---------------------------------------------------------------------------
+inline XMLCh* XMLRefInfo::getKey() const
+{
+    return fRefName;
+}
+
+#endif
diff --git a/src/framework/XMLValidator.cpp b/src/framework/XMLValidator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f4fb1cec21136e9be82f86fe5da2d664a1dd7a8c
--- /dev/null
+++ b/src/framework/XMLValidator.cpp
@@ -0,0 +1,287 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+  * $Log$
+  * Revision 1.1  1999/11/09 01:08:37  twl
+  * Initial revision
+  *
+  * Revision 1.3  1999/11/08 20:44:40  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/Janitor.hpp>
+#include <util/Mutexes.hpp>
+#include <util/PlatformUtils.hpp>
+#include <util/XMLMsgLoader.hpp>
+#include <util/XMLString.hpp>
+#include <framework/XMLErrorReporter.hpp>
+#include <framework/XMLValidator.hpp>
+#include <internal/XMLScanner.hpp>
+
+
+
+// ---------------------------------------------------------------------------
+//  Local static data
+// ---------------------------------------------------------------------------
+static XMLMutex         gValidatorMutex;
+static XMLMsgLoader&    getMsgLoader()
+{
+    static XMLMsgLoader* gMsgLoader = 0;
+
+    if (!gMsgLoader)
+    {
+        XMLMutexLock lockInit(&gValidatorMutex);
+        if (!gMsgLoader)
+        {
+            gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain);
+            if (!gMsgLoader)
+                XMLPlatformUtils::panic(XMLPlatformUtils::Panic_CantLoadMsgDomain);
+        }
+    }
+    return *gMsgLoader;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLValidator: Error emitting methods
+// ---------------------------------------------------------------------------
+
+//
+//  These methods are called whenever the scanner wants to emit an error.
+//  It handles getting the message loaded, doing token replacement, etc...
+//  and then calling the error handler, if its installed.
+//
+void XMLValidator::emitError(const XML4CValid::Codes toEmit)
+{
+    if (fErrorReporter)
+    {
+        // Load the message into a local for display
+        const unsigned int msgSize = 1023;
+        XMLCh errText[msgSize + 1];
+
+        // Lock the mutex and load the text
+        {
+            XMLMutexLock lockInit(&gValidatorMutex);
+            if (!getMsgLoader().loadMsg(toEmit, errText, msgSize))
+            {
+                // <TBD> Probably should load a default msg here
+            }
+        }
+
+        //
+        //  Create a LastExtEntityInfo structure and get the reader manager
+        //  to fill it in for us. This will give us the information about
+        //  the last reader on the stack that was an external entity of some
+        //  sort (i.e. it will ignore internal entities.
+        //
+        ReaderMgr::LastExtEntityInfo lastInfo;
+        fReaderMgr->getLastExtEntityInfo(lastInfo);
+
+        fErrorReporter->error
+        (
+            toEmit
+            , XMLUni::fgValidityDomain
+            , XML4CValid::errorType(toEmit)
+            , errText
+            , lastInfo.systemId
+            , lastInfo.publicId
+            , lastInfo.lineNumber
+            , lastInfo.colNumber
+        );
+    }
+
+    // Bail out if its fatal an we are to give up on the first fatal error
+    if (XML4CValid::isFatal(toEmit)
+    &&  fScanner->getExitOnFirstFatal()
+    &&  fScanner->getInException())
+    {
+        throw toEmit;
+    }
+}
+
+void XMLValidator::emitError( const   XML4CValid::Codes   toEmit
+                            , const XMLCh* const        text1
+                            , const XMLCh* const        text2
+                            , const XMLCh* const        text3
+                            , const XMLCh* const        text4)
+{
+    if (fErrorReporter)
+    {
+        //
+        //  Load the message into alocal and replace any tokens found in
+        //  the text.
+        //
+        const unsigned int maxChars = 2047;
+        XMLCh errText[maxChars + 1];
+
+        // Lock the mutex and load the text
+        {
+            XMLMutexLock lockInit(&gValidatorMutex);
+            if (!getMsgLoader().loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4))
+            {
+                // <TBD> Should probably load a default message here
+            }
+        }
+
+        //
+        //  Create a LastExtEntityInfo structure and get the reader manager
+        //  to fill it in for us. This will give us the information about
+        //  the last reader on the stack that was an external entity of some
+        //  sort (i.e. it will ignore internal entities.
+        //
+        ReaderMgr::LastExtEntityInfo lastInfo;
+        fReaderMgr->getLastExtEntityInfo(lastInfo);
+
+        fErrorReporter->error
+        (
+            toEmit
+            , XMLUni::fgValidityDomain
+            , XML4CValid::errorType(toEmit)
+            , errText
+            , lastInfo.systemId
+            , lastInfo.publicId
+            , lastInfo.lineNumber
+            , lastInfo.colNumber
+        );
+    }
+
+    // Bail out if its fatal an we are to give up on the first fatal error
+    if (XML4CValid::isFatal(toEmit)
+    &&  fScanner->getExitOnFirstFatal()
+    &&  fScanner->getInException())
+    {
+        throw toEmit;
+    }
+}
+
+void XMLValidator::emitError( const   XML4CValid::Codes   toEmit
+                            , const char* const         text1
+                            , const char* const         text2
+                            , const char* const         text3
+                            , const char* const         text4)
+{
+    if (fErrorReporter)
+    {
+        //
+        //  Load the message into alocal and replace any tokens found in
+        //  the text.
+        //
+        const unsigned int maxChars = 2047;
+        XMLCh errText[maxChars + 1];
+
+        // Lock the mutex and load the text
+        {
+            XMLMutexLock lockInit(&gValidatorMutex);
+            if (!getMsgLoader().loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4))
+            {
+                // <TBD> Should probably load a default message here
+            }
+        }
+
+        //
+        //  Create a LastExtEntityInfo structure and get the reader manager
+        //  to fill it in for us. This will give us the information about
+        //  the last reader on the stack that was an external entity of some
+        //  sort (i.e. it will ignore internal entities.
+        //
+        ReaderMgr::LastExtEntityInfo lastInfo;
+        fReaderMgr->getLastExtEntityInfo(lastInfo);
+
+        fErrorReporter->error
+        (
+            toEmit
+            , XMLUni::fgValidityDomain
+            , XML4CValid::errorType(toEmit)
+            , errText
+            , lastInfo.systemId
+            , lastInfo.publicId
+            , lastInfo.lineNumber
+            , lastInfo.colNumber
+        );
+    }
+
+    // Bail out if its fatal an we are to give up on the first fatal error
+    if (XML4CValid::isFatal(toEmit)
+    &&  fScanner->getExitOnFirstFatal()
+    &&  fScanner->getInException())
+    {
+        throw toEmit;
+    }
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLValidator: Hidden Constructors
+// ---------------------------------------------------------------------------
+XMLValidator::XMLValidator(XMLErrorReporter* const errReporter) :
+
+    fBufMgr(0)
+    , fEmptyNamespaceId(-1)
+    , fErrorReporter(errReporter)
+    , fGlobalNamespaceId(-1)
+    , fReaderMgr(0)
+    , fScanner(0)
+    , fUnknownNamespaceId(-1)
+    , fXMLNamespaceId(-1)
+    , fXMLNSNamespaceId(-1)
+{
+}
diff --git a/src/framework/XMLValidator.hpp b/src/framework/XMLValidator.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..5c1ab785644ca846c48ce4bd502afa15e01e9af0
--- /dev/null
+++ b/src/framework/XMLValidator.hpp
@@ -0,0 +1,486 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+  * $Log$
+  * Revision 1.1  1999/11/09 01:08:38  twl
+  * Initial revision
+  *
+  * Revision 1.4  1999/11/08 20:44:41  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  */
+
+
+#if !defined(XMLVALIDATOR_HPP)
+#define XMLVALIDATOR_HPP
+
+#include <util/XML4CDefs.hpp>
+#include <util/XMLEnumerator.hpp>
+#include <util/RefHashTableOf.hpp>
+#include <framework/XMLAttr.hpp>
+#include <framework/XMLValidityCodes.hpp>
+#include <framework/XMLRefInfo.hpp>
+
+class ReaderMgr;
+class XMLBuffer;
+class XMLBufferMgr;
+class XMLElementDecl;
+class XMLEntityDecl;
+class XMLEntityHandler;
+class XMLErrorReporter;
+class XMLNotationDecl;
+class XMLMsgLoader;
+class XMLScanner;
+
+
+//
+//  This abstract class provides the interface for all validators. This is
+//  the simple amount of API that all validators must honor, in order for
+//  the scanner to use them to do validation. All validators will actually
+//  contain much more functionality than is accessible via this common API,
+//  but that functionality requires that you know what type of validator you
+//  are dealing with.
+//
+//  Basically, at this level, the primary concern is to be able to query
+//  core information about elements and attributes. Adding decls to the
+//  validator requires that you go through the derived interface because they
+//  all have their own decl types. At this level, we can return information
+//  via the base decl classes, from which each validator derives its own
+//  decl classes.
+//
+
+class XMLPARSER_EXPORT XMLValidator
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Class specific types
+    // -----------------------------------------------------------------------
+    enum Constants
+    {
+        Success     = -1
+        , BadParent = -2
+        , BadChild  = -3
+    };
+
+
+    enum LookupOpts
+    {
+        AddIfNotFound
+        , FailIfNotFound
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Constructors are hidden, just the virtual destructor is exposed
+    // -----------------------------------------------------------------------
+    virtual ~XMLValidator()
+    {
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getEmptyNamespaceId() const;
+    unsigned int getGlobalNamespaceId() const;
+    unsigned int getUnknownNamespaceId() const;
+    unsigned int getXMLNamespaceId() const;
+    unsigned int getXMLNSNamespaceId() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    //
+    //  setScannerInfo() is called by the scanner to tell the validator
+    //  about the stuff it needs to have access to.
+    // -----------------------------------------------------------------------
+    void setScannerInfo
+    (
+        XMLScanner* const           owningScanner
+        , ReaderMgr* const          readerMgr
+        , XMLBufferMgr* const       bufMgr
+    );
+
+    void setErrorReporter
+    (
+        XMLErrorReporter* const errorReporter
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  The virtual validator interface
+    // -----------------------------------------------------------------------
+    virtual int addOrFindNSId
+    (
+        const   XMLCh* const    uriText
+    ) = 0;
+
+    virtual int checkContent
+    (
+        const   unsigned int    elemId
+        , const unsigned int*   childIds
+        , const unsigned int    childCount
+    ) = 0;
+
+    virtual bool checkRootElement
+    (
+        const   unsigned int    elemId
+    ) = 0;
+
+    virtual void faultInAttr
+    (
+                XMLAttr&    toFill
+        , const XMLAttDef&  attDef
+    )   const = 0;
+
+    virtual const XMLElementDecl* findElemDecl
+    (
+        const   unsigned int    uriId
+        , const XMLCh* const    baseName
+        , const XMLCh* const    qName
+        , const LookupOpts      options
+        ,       bool&           wasAdded
+    )   const = 0;
+
+    virtual XMLElementDecl* findElemDecl
+    (
+        const   unsigned int    uriId
+        , const XMLCh* const    baseName
+        , const XMLCh* const    qName
+        , const LookupOpts      options
+        ,       bool&           wasAdded
+    ) = 0;
+
+    virtual const XMLEntityDecl* findEntityDecl
+    (
+        const   XMLCh* const    entName
+        , const bool            isPE
+    )   const = 0;
+
+    virtual XMLEntityDecl* findEntityDecl
+    (
+        const   XMLCh* const    entName
+        , const bool            isPE
+    ) = 0;
+
+    virtual unsigned int findElemId
+    (
+        const   unsigned int    uriId
+        , const XMLCh* const    baseName
+        , const XMLCh* const    qName
+    )   const = 0;
+
+    virtual const XMLNotationDecl* findNotationDecl
+    (
+        const   XMLCh* const    notName
+    )   const = 0;
+
+    virtual XMLNotationDecl* findNotationDecl
+    (
+        const   XMLCh* const    notName
+    ) = 0;
+
+    virtual unsigned int findNSId
+    (
+        const   XMLCh* const    nsName
+    )   const = 0;
+
+    virtual const XMLElementDecl* getElemDecl
+    (
+        const   unsigned int    elemId
+    )   const = 0;
+
+    virtual XMLElementDecl* getElemDecl
+    (
+        const   unsigned int    elemId
+    ) = 0;
+
+    virtual bool getURIText
+    (
+        const   unsigned int    uriId
+        ,       XMLBuffer&      uriBufToFill
+    )   const = 0;
+
+    virtual void postParseValidation() = 0;
+
+    virtual void reset() = 0;
+
+    virtual bool requiresNamespaces() const = 0;
+
+    virtual void validateAttrValue
+    (
+        const   XMLAttDef&                  attDef
+        , const XMLCh* const                attrValue
+    ) = 0;
+
+
+    // -----------------------------------------------------------------------
+    //  Virtual DTD handler interface. If handlesDTD() returns true, then
+    //  scanDTD() will be called when a DOCTYPE is seen.
+    // -----------------------------------------------------------------------
+    virtual bool handlesDTD() const = 0;
+    virtual void scanDTD(const bool reuseValidator) = 0;
+
+
+    // -----------------------------------------------------------------------
+    //  Error emitter methods
+    // -----------------------------------------------------------------------
+    void emitError(const XML4CValid::Codes toEmit);
+    void emitError
+    (
+        const   XML4CValid::Codes   toEmit
+        , const XMLCh* const        text1
+        , const XMLCh* const        text2 = 0
+        , const XMLCh* const        text3 = 0
+        , const XMLCh* const        text4 = 0
+    );
+    void emitError
+    (
+        const   XML4CValid::Codes   toEmit
+        , const char* const         text1
+        , const char* const         text2 = 0
+        , const char* const         text3 = 0
+        , const char* const         text4 = 0
+    );
+
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden constructors
+    // -----------------------------------------------------------------------
+    XMLValidator
+    (
+        XMLErrorReporter* const errReporter = 0
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Protected getters
+    // -----------------------------------------------------------------------
+    const XMLBufferMgr* getBufMgr() const;
+    XMLBufferMgr* getBufMgr();
+    const ReaderMgr* getReaderMgr() const;
+    ReaderMgr* getReaderMgr();
+    const XMLScanner* getScanner() const;
+    XMLScanner* getScanner();
+
+
+    // -----------------------------------------------------------------------
+    //  Protected methods
+    // -----------------------------------------------------------------------
+    void setBaseFields
+    (
+        const   unsigned int    emptyNamespaceId
+        , const unsigned int    globalNamespaceId
+        , const unsigned int    unknownNamespaceId
+        , const unsigned int    xmlNamespaceId
+        , const unsigned int    xmlNSNamespaceId
+    );
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented Constructors and Operators
+    // -----------------------------------------------------------------------
+    XMLValidator(const XMLValidator&);
+    void operator=(const XMLValidator&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fEmptyNamespaceId
+    //      This is the id of the empty namespace URI. This is a special one
+    //      because of the xmlns="" type of deal. We have to quickly sense
+    //      that its the empty namespace.
+    //
+    //  fErrorReporter
+    //      The error reporter we are to use, if any.
+    //
+    //  fGlobalNamespaceId
+    //      This is the id of the namespace URI which is assigned to the
+    //      global namespace. Its for debug purposes only, since there is no
+    //      real global namespace URI. Its set by the derived class.
+    //
+    //  fUnknownNamespaceId
+    //      This is the id of the namespace URI which is assigned to the
+    //      global namespace. Its for debug purposes only, since there is no
+    //      real global namespace URI. Its set by the derived class.
+    //
+    //  fXMLNamespaceId
+    //  fXMLNSNamespaceId
+    //      These are the ids of the namespace URIs which are assigned to the
+    //      'xml' and 'xmlns' special prefixes. The former is officially
+    //      defined but the latter is not, so we just provide one for debug
+    //      purposes.
+    // -----------------------------------------------------------------------
+    XMLBufferMgr*       fBufMgr;
+    unsigned int        fEmptyNamespaceId;
+    XMLErrorReporter*   fErrorReporter;
+    unsigned int        fGlobalNamespaceId;
+    ReaderMgr*          fReaderMgr;
+    XMLScanner*         fScanner;
+    unsigned int        fUnknownNamespaceId;
+    unsigned int        fXMLNamespaceId;
+    unsigned int        fXMLNSNamespaceId;
+
+};
+
+
+// ---------------------------------------------------------------------------
+//  XMLValidator: Getter methods
+// ---------------------------------------------------------------------------
+inline unsigned int XMLValidator::getEmptyNamespaceId() const
+{
+    return fEmptyNamespaceId;
+}
+
+inline unsigned int XMLValidator::getGlobalNamespaceId() const
+{
+    return fGlobalNamespaceId;
+}
+
+inline unsigned int XMLValidator::getUnknownNamespaceId() const
+{
+    return fUnknownNamespaceId;
+}
+
+inline unsigned int XMLValidator::getXMLNamespaceId() const
+{
+    return fXMLNamespaceId;
+}
+
+inline unsigned int XMLValidator::getXMLNSNamespaceId() const
+{
+    return fXMLNSNamespaceId;
+}
+
+
+// -----------------------------------------------------------------------
+//  Setter methods
+// -----------------------------------------------------------------------
+inline void
+XMLValidator::setScannerInfo(XMLScanner* const      owningScanner
+                            , ReaderMgr* const      readerMgr
+                            , XMLBufferMgr* const   bufMgr)
+{
+    // We don't own any of these, we just reference them
+    fScanner = owningScanner;
+    fReaderMgr = readerMgr;
+    fBufMgr = bufMgr;
+}
+
+inline void
+XMLValidator::setErrorReporter(XMLErrorReporter* const errorReporter)
+{
+    fErrorReporter = errorReporter;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLValidator: Protected getter
+// ---------------------------------------------------------------------------
+inline const XMLBufferMgr* XMLValidator::getBufMgr() const
+{
+    return fBufMgr;
+}
+
+inline XMLBufferMgr* XMLValidator::getBufMgr()
+{
+    return fBufMgr;
+}
+
+inline const ReaderMgr* XMLValidator::getReaderMgr() const
+{
+    return fReaderMgr;
+}
+
+inline ReaderMgr* XMLValidator::getReaderMgr()
+{
+    return fReaderMgr;
+}
+
+inline const XMLScanner* XMLValidator::getScanner() const
+{
+    return fScanner;
+}
+
+inline XMLScanner* XMLValidator::getScanner()
+{
+    return fScanner;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLValidator: Protected methods
+// ---------------------------------------------------------------------------
+inline void
+XMLValidator::setBaseFields(const   unsigned int    emptyNamespaceId
+                            , const unsigned int    globalNamespaceId
+                            , const unsigned int    unknownNamespaceId
+                            , const unsigned int    xmlNamespaceId
+                            , const unsigned int    xmlNSNamespaceId)
+{
+    fEmptyNamespaceId   = emptyNamespaceId;
+    fGlobalNamespaceId  = globalNamespaceId;
+    fUnknownNamespaceId = unknownNamespaceId;
+    fXMLNamespaceId     = xmlNamespaceId;
+    fXMLNSNamespaceId   = xmlNSNamespaceId;
+}
+
+#endif
diff --git a/src/framework/XMLValidityCodes.hpp b/src/framework/XMLValidityCodes.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e7484aac2639e9e4ff9d9222ebbab24f67f2e408
--- /dev/null
+++ b/src/framework/XMLValidityCodes.hpp
@@ -0,0 +1,74 @@
+// This file is generated, don't edit it!!
+
+#if !defined(ERRHEADER_XML4CValid)
+#define ERRHEADER_XML4CValid
+
+#include <framework/XMLErrorReporter.hpp>
+
+class XML4CValid
+{
+public :
+    enum Codes
+    {
+        NoError                            = 0
+      , V_LowBounds                        = 1
+      , ElementNotDefined                  = 2
+      , AttNotDefined                      = 3
+      , NotationNotDeclared                = 4
+      , RootElemNotLikeDocType             = 5
+      , RequiredAttrNotProvided            = 6
+      , ElementNotValidForContent          = 7
+      , BadIDAttrDefType                   = 8
+      , InvalidEmptyAttValue               = 9
+      , ElementAlreadyExists               = 10
+      , MultipleIdAttrs                    = 11
+      , ReusedIDValue                      = 12
+      , IDNotDeclared                      = 13
+      , UnknownNotRefAttr                  = 14
+      , UndeclaredElemInDocType            = 15
+      , EmptyNotValidForContent            = 16
+      , AttNotDefinedForElement            = 17
+      , BadEntityRefAttr                   = 18
+      , UnknownEntityRefAttr               = 19
+      , NotEnoughElemsForCM                = 20
+      , NoCharDataInCM                     = 21
+      , DoesNotMatchEnumList               = 22
+      , AttrValNotName                     = 23
+      , NoMultipleValues                   = 24
+      , NotSameAsFixedValue                = 25
+      , RepElemInMixed                     = 26
+      , V_HighBounds                       = 27
+      , W_LowBounds                        = 28
+      , W_HighBounds                       = 29
+      , E_LowBounds                        = 30
+      , E_HighBounds                       = 31
+    };
+
+    static bool isFatal(const XML4CValid::Codes toCheck)
+    {
+        return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
+    }
+
+    static bool isWarning(const XML4CValid::Codes toCheck)
+    {
+        return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
+    }
+
+    static bool isValid(const XML4CValid::Codes toCheck)
+    {
+        return ((toCheck >= V_LowBounds) && (toCheck <= V_HighBounds));
+    }
+
+    static XMLErrorReporter::ErrTypes errorType(const XML4CValid::Codes toCheck)
+    {
+       if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
+           return XMLErrorReporter::ErrType_Warning;
+       else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
+            return XMLErrorReporter::ErrType_Fatal;
+       else if ((toCheck >= V_LowBounds) && (toCheck <= V_HighBounds))
+            return XMLErrorReporter::ErrType_Invalid;
+       return XMLErrorReporter::ErrTypes_Unknown;
+    }
+};
+#endif
+
diff --git a/src/internal/CharTypeTables.hpp b/src/internal/CharTypeTables.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..010e3b95db805b101906f11f8bf67ea9d94e357b
--- /dev/null
+++ b/src/internal/CharTypeTables.hpp
@@ -0,0 +1,243 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:03  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:41  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  These are character type lookup tables. They are included into XMLReader
+//  but are in their own private header in order to keep from making that
+//  file unreadable.
+//
+//  THE RANGES and SINGLES MUST BE IN NUMERICAL ORDER, because the lookup
+//  method will use this info to short circuit the search!
+// ---------------------------------------------------------------------------
+static const XMLCh gBaseChars[] =
+{
+    // Ranges
+        0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6
+    ,   0x00F8, 0x00FF
+
+    ,   0x0100, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E
+    ,   0x0180, 0x01C3, 0x01CD, 0x01F0, 0x01F4, 0x01F5, 0x01FA, 0x0217
+    ,   0x0250, 0x02A8, 0x02BB, 0x02C1, 0x0388, 0x038A, 0x038E, 0x03A1
+    ,   0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03E2, 0x03F3, 0x0401, 0x040C
+    ,   0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4
+    ,   0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5
+    ,   0x04F8, 0x04F9, 0x0531, 0x0556, 0x0561, 0x0586, 0x05D0, 0x05EA
+    ,   0x05F0, 0x05F2, 0x0621, 0x063A, 0x0641, 0x064A, 0x0671, 0x06B7
+    ,   0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06D3, 0x06E5, 0x06E6
+    ,   0x0905, 0x0939, 0x0958, 0x0961, 0x0985, 0x098C, 0x098F, 0x0990
+    ,   0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B6, 0x09B9, 0x09DC, 0x09DD
+    ,   0x09DF, 0x09E1, 0x09F0, 0x09F1, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10
+    ,   0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36
+    ,   0x0A38, 0x0A39, 0x0A59, 0x0A5C, 0x0A72, 0x0A74, 0x0A85, 0x0A8B
+    ,   0x0A8F, 0x0A91, 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3
+    ,   0x0AB5, 0x0AB9, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28
+    ,   0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B5C, 0x0B5D
+    ,   0x0B5F, 0x0B61, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95
+    ,   0x0B99, 0x0B9A, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA
+    ,   0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10
+    ,   0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C60, 0x0C61
+    ,   0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3
+    ,   0x0CB5, 0x0CB9, 0x0CE0, 0x0CE1, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10
+    ,   0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D60, 0x0D61, 0x0E01, 0x0E2E
+    ,   0x0E32, 0x0E33, 0x0E40, 0x0E45, 0x0E81, 0x0E82, 0x0E87, 0x0E88
+    ,   0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EAA, 0x0EAB
+    ,   0x0EAD, 0x0EAE, 0x0EB2, 0x0EB3, 0x0EC0, 0x0EC4, 0x0F40, 0x0F47
+    ,   0x0F49, 0x0F69, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1102, 0x1103
+    ,   0x1105, 0x1107, 0x110B, 0x110C, 0x110E, 0x1112, 0x1154, 0x1155
+    ,   0x115F, 0x1161, 0x116D, 0x116E, 0x1172, 0x1173, 0x11AE, 0x11AF
+    ,   0x11B7, 0x11B8, 0x11BC, 0x11C2, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9
+    ,   0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D
+    ,   0x1F50, 0x1F57, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC
+    ,   0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB
+    ,   0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x212A, 0x212B
+    ,   0x2180, 0x2182, 0x3041, 0x3094, 0x30A1, 0x30FA, 0x3105, 0x312C
+    ,   0xAC00, 0xD7A3
+    ,   0x00
+
+    // Singles
+    ,   0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5
+    ,   0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C
+    ,   0x0CDE, 0x0E30, 0x0E84, 0x0E8A, 0x0E8D, 0x0EA5, 0x0EA7, 0x0EB0
+    ,   0x0EBD, 0x1100, 0x1109, 0x113C, 0x113E, 0x1140, 0x114C, 0x114E
+    ,   0x1150, 0x1159, 0x1163, 0x1165, 0x1167, 0x1169, 0x1175, 0x119E
+    ,   0x11A8, 0x11AB, 0x11BA, 0x11EB, 0x11F0, 0x11F9, 0x1F59, 0x1F5B
+    ,   0x1F5D, 0x1FBE, 0x2126, 0x212E
+    ,   0x00
+};
+
+
+static const XMLCh gCombiningChars[] =
+{
+    // Ranges
+        0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1
+    ,   0x05A3, 0x05B9, 0x05C1, 0x05C2, 0x06D6, 0x06DC, 0x06E0, 0x06E4
+    ,   0x06E7, 0x06E8, 0x06EA, 0x06ED, 0x0901, 0x0903, 0x093E, 0x094C
+    ,   0x0951, 0x0954, 0x0962, 0x0963, 0x0981, 0x0983, 0x09C0, 0x09C4
+    ,   0x09C7, 0x09C8, 0x09CB, 0x09CD, 0x09E2, 0x09E3, 0x0A40, 0x0A42
+    ,   0x0A47, 0x0A48, 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A83
+    ,   0x0ABE, 0x0AC5, 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0B01, 0x0B03
+    ,   0x0B3E, 0x0B43, 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B56, 0x0B57
+    ,   0x0B82, 0x0B83, 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD
+    ,   0x0C01, 0x0C03, 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D
+    ,   0x0C55, 0x0C56, 0x0C82, 0x0C83, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8
+    ,   0x0CCA, 0x0CCD, 0x0CD5, 0x0CD6, 0x0D02, 0x0D03, 0x0D3E, 0x0D43
+    ,   0x0D46, 0x0D48, 0x0D4A, 0x0D4D, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E
+    ,   0x0EB4, 0x0EB9, 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19
+    ,   0x0F71, 0x0F84, 0x0F86, 0x0F8B, 0x0F90, 0x0F95, 0x0F99, 0x0FAD
+    ,   0x0FB1, 0x0FB7, 0x20D0, 0x20DC, 0x302A, 0x302F
+    ,   0x00
+
+    // Singles
+    ,   0x05BB, 0x05BD, 0x05BF, 0x05C4, 0x064B, 0x0652, 0x0670, 0x06DD
+    ,   0x06DF, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF, 0x09D7, 0x0A02
+    ,   0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7, 0x0D57, 0x0E31
+    ,   0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F, 0x0F97, 0x0FB9
+    ,   0x20E1, 0x3099, 0x309A
+    ,   0x00
+};
+
+
+static const XMLCh gDigitChars[] =
+{
+    // Ranges
+        0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F
+    ,   0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F
+    ,   0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F
+    ,   0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F29
+    ,   0x00
+
+    // Singles
+    ,   0x00
+};
+
+
+static const XMLCh gIdeographicChars[] =
+{
+    // Ranges
+        0x3021, 0x3029, 0x4E00, 0x9FA5
+    ,   0x00
+
+    // Singles
+    ,   0x3007
+    ,   0x00
+};
+
+static const XMLCh gExtenderChars[] =
+{
+    // Ranges
+        0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE
+    ,   0x00
+
+    // Singles
+    ,   0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005
+    ,   0x00
+};
+
+
+static const XMLCh gLetterChars[] =
+{
+    // Ranges
+        0x3021, 0x3029, 0x4E00, 0x9FA5
+    ,   0x00
+
+    // Sngles
+    ,   0x3007
+    ,   0x00
+};
+
+
+static const XMLCh gPublicIdChars[] =
+{
+    // Ranges
+        0x0023, 0x0025, 0x0027, 0x003B, 0x003F, 0x005A, 0x0061, 0x007A
+    ,   0x00
+
+    // Singles
+    ,   0x000A, 0x000D, 0x0020, 0x0021, 0x003D, 0x005F
+    ,   0x00
+};
+
+
+static const XMLCh gWhitespaceChars[] =
+{
+    // Ranges
+        0x00
+
+    ,   0x0020, 0x0009, 0x000D, 0x000A
+    ,   0x00
+};
+
+
+static const XMLCh gXMLChars[] =
+{
+    // Ranges
+        0x0020, 0xD7FF, 0xE000, 0xFFFD
+    ,   0x00
+
+    ,   0x0009, 0x000D, 0x000A
+    ,   0x00
+};
diff --git a/src/internal/ElemStack.cpp b/src/internal/ElemStack.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d5d41ec5c62a3c8d388a1e1c4b01b64a301cb86a
--- /dev/null
+++ b/src/internal/ElemStack.cpp
@@ -0,0 +1,539 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:04  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:44:41  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <memory.h>
+#include <string.h>
+#include <util/EmptyStackException.hpp>
+#include <util/NoSuchElementException.hpp>
+#include <framework/XMLElementDecl.hpp>
+#include <internal/ElemStack.hpp>
+
+#if defined(XML4C_DEBUG)
+#include <util/TextOutputStream.hpp>
+#include <framework/XMLValidator.hpp>
+#endif
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Constructors and Destructor
+// ---------------------------------------------------------------------------
+ElemStack::ElemStack() :
+
+    fEmptyNamespaceId(0)
+    , fGlobalNamespaceId(0)
+    , fGlobalPoolId(0)
+    , fStack(0)
+    , fStackCapacity(32)
+    , fStackTop(0)
+    , fUnknownNamespaceId(0)
+    , fXMLNamespaceId(0)
+    , fXMLPoolId(0)
+    , fXMLNSNamespaceId(0)
+    , fXMLNSPoolId(0)
+{
+    // Do an initial allocation of the stack and zero it out
+    fStack = new StackElem*[fStackCapacity];
+    memset(fStack, 0, fStackCapacity * sizeof(StackElem*));
+}
+
+ElemStack::~ElemStack()
+{
+    //
+    //  Start working from the bottom of the stack and clear it out as we
+    //  go up. Once we hit an uninitialized one, we can break out.
+    //
+    for (unsigned int stackInd = 0; stackInd < fStackCapacity; stackInd++)
+    {
+        // If this entry has been set, then lets clean it up
+        if (!fStack[stackInd])
+            break;
+
+        // Delete the row for this entry, then delete the row structure
+        delete [] fStack[stackInd]->fChildIds;
+        delete fStack[stackInd];
+    }
+
+    // Delete the stack array itself now
+    delete [] fStack;
+}
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Stack access
+// ---------------------------------------------------------------------------
+unsigned int ElemStack::addLevel()
+{
+    // See if we need to expand the stack
+    if (fStackTop == fStackCapacity)
+        expandStack();
+
+    // If this element has not been initialized yet, then initialize it
+    if (!fStack[fStackTop])
+    {
+        fStack[fStackTop] = new StackElem;
+        fStack[fStackTop]->fChildCapacity = 0;
+        fStack[fStackTop]->fChildIds = 0;
+        fStack[fStackTop]->fMapCapacity = 0;
+        fStack[fStackTop]->fMap = 0;
+    }
+
+    // Set up the new top row
+    fStack[fStackTop]->fThisElement = 0;
+    fStack[fStackTop]->fReaderNum = 0xFFFFFFFF;
+    fStack[fStackTop]->fChildCount = 0;
+    fStack[fStackTop]->fMapCount = 0;
+
+    // Bump the top of stack
+    fStackTop++;
+
+    return fStackTop-1;
+}
+
+
+unsigned int
+ElemStack::addLevel(XMLElementDecl* const toSet, const unsigned int readerNum)
+{
+    // See if we need to expand the stack
+    if (fStackTop == fStackCapacity)
+        expandStack();
+
+    // If this element has not been initialized yet, then initialize it
+    if (!fStack[fStackTop])
+    {
+        fStack[fStackTop] = new StackElem;
+        fStack[fStackTop]->fChildCapacity = 0;
+        fStack[fStackTop]->fChildIds = 0;
+        fStack[fStackTop]->fMapCapacity = 0;
+        fStack[fStackTop]->fMap = 0;
+    }
+
+    // Set up the new top row
+    fStack[fStackTop]->fThisElement = 0;
+    fStack[fStackTop]->fReaderNum = 0xFFFFFFFF;
+    fStack[fStackTop]->fChildCount = 0;
+    fStack[fStackTop]->fMapCount = 0;
+
+    // And store the new stuff
+    fStack[fStackTop]->fThisElement = toSet;
+    fStack[fStackTop]->fReaderNum = readerNum;
+
+    // Bump the top of stack
+    fStackTop++;
+
+    return fStackTop-1;
+}
+
+
+
+const XMLElementDecl& ElemStack::elemAt(const unsigned int index) const
+{
+    if (!fStackTop)
+        ThrowXML(EmptyStackException, XML4CExcepts::ElemStack_EmptyStack);
+
+    if (index >= fStack[fStackTop-1]->fChildCount)
+        ThrowXML(ArrayIndexOutOfBoundsException, XML4CExcepts::ElemStack_BadIndex);
+
+    return *(fStack[fStackTop-1]->fThisElement);
+}
+
+
+const ElemStack::StackElem* ElemStack::popTop()
+{
+    // Watch for an underflow error
+    if (!fStackTop)
+        ThrowXML(EmptyStackException, XML4CExcepts::ElemStack_StackUnderflow);
+
+    fStackTop--;
+    return fStack[fStackTop];
+}
+
+
+void
+ElemStack::setElement(XMLElementDecl* const toSet, const unsigned int readerNum)
+{
+    if (!fStackTop)
+        ThrowXML(EmptyStackException, XML4CExcepts::ElemStack_EmptyStack);
+
+    fStack[fStackTop - 1]->fThisElement = toSet;
+    fStack[fStackTop - 1]->fReaderNum = readerNum;
+}
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Stack top access
+// ---------------------------------------------------------------------------
+unsigned int ElemStack::addChild(const unsigned int childId, const bool toParent)
+{
+    if (!fStackTop)
+        ThrowXML(EmptyStackException, XML4CExcepts::ElemStack_EmptyStack);
+
+    //
+    //  If they want to add to the parent, then we have to have at least two
+    //  elements on the stack.
+    //
+    if (toParent && (fStackTop < 2))
+        ThrowXML(NoSuchElementException, XML4CExcepts::ElemStack_NoParentPushed);
+
+    // Get a convenience pointer to the stack top row
+    StackElem* curRow = toParent
+                        ? fStack[fStackTop - 2] : fStack[fStackTop - 1];
+
+    // See if we need to expand this row's child array
+    if (curRow->fChildCount == curRow->fChildCapacity)
+    {
+        // Increase the capacity by a quarter and allocate a new row
+        const unsigned int newCapacity = curRow->fChildCapacity ? 
+                                         (unsigned int)(curRow->fChildCapacity * 1.25) :
+                                         32;
+        unsigned int* newRow = new unsigned int[newCapacity];
+
+        //
+        //  Copy over the old contents. We don't have to initialize the new
+        //  part because The current child count is used to know how much of
+        //  it is valid.
+        //
+        //  Only both doing this if there is any current content, since
+        //  this code also does the initial faulting in of the array when
+        //  both the current capacity and child count are zero.
+        //
+        if (curRow->fChildCount)
+        {
+            memcpy
+            (
+                newRow
+                , curRow->fChildIds
+                , curRow->fChildCapacity * sizeof(unsigned int)
+            );
+        }
+
+        // Clean up the old children and store the new info
+        delete [] curRow->fChildIds;
+        curRow->fChildIds = newRow;
+        curRow->fChildCapacity = newCapacity;
+    }
+
+    // Add this id to the end of the row's child id array and bump the count
+    curRow->fChildIds[curRow->fChildCount++] = childId;
+
+    // Return the level of the index we just filled (before the bump)
+    return curRow->fChildCount - 1;
+}
+
+const ElemStack::StackElem* ElemStack::topElement() const
+{
+    if (!fStackTop)
+        ThrowXML(EmptyStackException, XML4CExcepts::ElemStack_EmptyStack);
+
+    return fStack[fStackTop - 1];
+}
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Prefix map methods
+// ---------------------------------------------------------------------------
+void ElemStack::addPrefix(  const   XMLCh* const    prefixToAdd
+                            , const unsigned int    uriId)
+{
+    if (!fStackTop)
+        ThrowXML(EmptyStackException, XML4CExcepts::ElemStack_EmptyStack);
+
+    // Get a convenience pointer to the stack top row
+    StackElem* curRow = fStack[fStackTop - 1];
+
+    // Map the prefix to its unique id
+    const unsigned int prefId = fPrefixPool.addOrFind(prefixToAdd);
+
+    //
+    //  Add a new element to the prefix map for this element. If its full,
+    //  then expand it out.
+    //
+    if (curRow->fMapCount == curRow->fMapCapacity)
+        expandMap(curRow);
+
+    //
+    //  And now add a new element for this prefix. Watch for the special case
+    //  of xmlns=="", and force it to ""=[globalid]
+    //
+    curRow->fMap[curRow->fMapCount].fPrefId = prefId;
+    if ((prefId == fGlobalPoolId) && (uriId == fEmptyNamespaceId))
+        curRow->fMap[curRow->fMapCount].fURIId = fGlobalNamespaceId;
+    else
+        curRow->fMap[curRow->fMapCount].fURIId = uriId;
+
+    // Bump the map count now
+    curRow->fMapCount++;
+}
+
+
+unsigned int ElemStack::mapPrefixToURI( const   XMLCh* const    prefixToMap
+                                        , const MapModes        mode
+                                        ,       bool&           unknown) const
+{
+    // Assume we find it
+    unknown = false;
+
+    //
+    //  Map the prefix to its unique id, from the prefix string pool. If its
+    //  not a valid prefix, then its a failure.
+    //
+    unsigned int prefixId = fPrefixPool.getId(prefixToMap);
+    if (!prefixId)
+    {
+        unknown = true;
+        return fUnknownNamespaceId;
+    }
+
+    //
+    //  If the prefix is empty, and we are in attribute mode, then we assign
+    //  it to the global namespace because the default namespace does not
+    //  apply to attributes.
+    //
+    if (!*prefixToMap && (mode == Mode_Attribute))
+        return fGlobalNamespaceId;
+
+    //
+    //  Check for the special prefixes 'xml' and 'xmlns' since they cannot
+    //  be overridden.
+    //
+    if (prefixId == fXMLPoolId)
+        return fXMLNamespaceId;
+    else if (prefixId == fXMLNSPoolId)
+        return fXMLNSNamespaceId;
+
+    //
+    //  Start at the stack top and work backwards until we come to some
+    //  element that mapped this prefix. We start down one further if the
+    //  mapping mode is for an attribute name.
+    //
+    int startAt = (int)(fStackTop - 1);
+    if (mode  == Mode_Attribute)
+        startAt--;
+    for (int index = startAt; index >= 0; index--)
+    {
+        // Get a convenience pointer to the current element
+        StackElem* curRow = fStack[index];
+
+        // If no prefixes mapped at this level, then go the next one
+        if (!curRow->fMapCount)
+            continue;
+
+        // Search the map at this level for the passed prefix
+        for (unsigned int mapIndex = 0; mapIndex < curRow->fMapCount; mapIndex++)
+        {
+            if (curRow->fMap[mapIndex].fPrefId == prefixId)
+                return curRow->fMap[mapIndex].fURIId;
+        }
+    }
+
+    //
+    //  If the prefix is an empty string, then we will return the special
+    //  global namespace id. This can be overridden, but no one has or we
+    //  would have not gotten here.
+    //
+    if (!*prefixToMap)
+        return fGlobalNamespaceId;
+
+    // Oh well, don't have a clue so return the unknown id
+    unknown = true;
+    return fUnknownNamespaceId;
+}
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Miscellaneous methods
+// ---------------------------------------------------------------------------
+void ElemStack::reset(  const   unsigned int    emptyId
+                        , const unsigned int    globalId
+                        , const unsigned int    unknownId
+                        , const unsigned int    xmlId
+                        , const unsigned int    xmlNSId)
+{
+    // Flush the prefix pool and put back in the standard prefixes
+    fPrefixPool.flushAll();
+    fGlobalPoolId = fPrefixPool.addOrFind(XMLUni::fgZeroLenString);
+    fXMLPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLString);
+    fXMLNSPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLNSString);
+
+    // Reset the stack top to clear the stack
+    fStackTop = 0;
+
+    // And store the new special URI ids
+    fEmptyNamespaceId = emptyId;
+    fGlobalNamespaceId = globalId;
+    fUnknownNamespaceId = unknownId;
+    fXMLNamespaceId = xmlId;
+    fXMLNSNamespaceId = xmlNSId;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Debug only stuff
+// ---------------------------------------------------------------------------
+#if defined(XML4C_DEBUG)
+
+void ElemStack::dumpStacks(TextOutputStream& target, const XMLValidator& srcPools)
+{
+    // Display a simple header
+    target  << "\nElement stack dump:\n"
+            << "-------------------------------------------\n\n";
+
+    //
+    //  Display the stack by nested elements, and the associated namespace
+    //  map for each level. Note that we are only ever tracing a single
+    //  path down through the content, so we don't even bother actually
+    //  indenting them (because the nesting is implicit.)
+    //
+    if (!fStack)
+    {
+        target << "<<Stack is empty>>\n";
+        return;
+    }
+
+    for (int index = fStackTop - 1; index > 0; index--)
+    {
+        // Get the next stack element up the chain
+        const StackElem* curElem = fStack[index];
+
+        target  << "ELEMENT: " << curElem->fThisElement->getFullName() << "\n";
+
+        target  << "    CHILDREN: \n";
+        for (unsigned int childInd = 0; childInd < curElem->fChildCount; childInd++)
+        {
+            // Get the elem decl for this child
+            const XMLElementDecl* child
+                            = srcPools.getElemDecl(curElem->fChildIds[childInd]);
+            target  << "       " << child->getFullName() << "\n";
+        }
+
+        target  << "END ELEMENT\n";
+    }
+
+    target << EndLn;
+}
+
+#endif
+
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Private helpers
+// ---------------------------------------------------------------------------
+void ElemStack::expandMap(StackElem* const toExpand)
+{
+    // For convenience get the old map size
+    const unsigned int oldCap = toExpand->fMapCapacity;
+
+    //
+    //  Expand the capacity by 25%, or initialize it to 16 if its currently
+    //  empty. Then allocate a new temp buffer.
+    //
+    const unsigned int newCapacity = oldCap ?
+                                     (unsigned int)(oldCap * 1.25) : 16;
+    PrefMapElem* newMap = new PrefMapElem[newCapacity];
+
+    //
+    //  Copy over the old stuff. We DON'T have to zero out the new stuff
+    //  since this is a by value map and the current map index controls what
+    //  is relevant.
+    //
+    memcpy(newMap, toExpand->fMap, oldCap * sizeof(PrefMapElem));
+
+    // Delete the old map and store the new stuff
+    delete [] toExpand->fMap;
+    toExpand->fMap = newMap;
+    toExpand->fMapCapacity = newCapacity;
+}
+
+void ElemStack::expandStack()
+{
+    // Expand the capacity by 25% and allocate a new buffer
+    const unsigned int newCapacity = (unsigned int)(fStackCapacity * 1.25);
+    StackElem** newStack = new StackElem*[newCapacity];
+
+    // Copy over the old stuff
+    memcpy(newStack, fStack, fStackCapacity * sizeof(StackElem*));
+
+    //
+    //  And zero out the new stuff. Though we use a stack top, we reuse old
+    //  stack contents so we need to know if elements have been initially
+    //  allocated or not as we push new stuff onto the stack.
+    //
+    memset
+    (
+        &newStack[fStackCapacity]
+        , 0
+        , (newCapacity - fStackCapacity) * sizeof(StackElem*)
+    );
+
+    // Delete the old array and update our members
+    delete [] fStack;
+    fStack = newStack;
+    fStackCapacity = newCapacity;
+}
diff --git a/src/internal/ElemStack.hpp b/src/internal/ElemStack.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..607c457e666e776b1cba680dcc81220f6732102b
--- /dev/null
+++ b/src/internal/ElemStack.hpp
@@ -0,0 +1,310 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:06  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:42  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(ELEMSTACK_HPP)
+#define ELEMSTACK_HPP
+
+#include <util/XML4CDefs.hpp>
+#include <util/StringPool.hpp>
+
+#if defined(XML4C_DEBUG)
+class TextOutputStream;
+class XMLValidator;
+#endif
+
+class XMLElementDecl;
+
+//
+//  During the scan of content, we have to keep up with the nesting of
+//  elements (for validation and wellformedness purposes) and we have to
+//  have places to remember namespace (prefix to URI) mappings.
+//
+//  We only have to keep a stack of the current path down through the tree
+//  that we are currently scanning, and keep track of any children of any
+//  elements along that path.
+//
+//  So, this data structure is a stack, which represents the current path
+//  through the tree that we've worked our way down to. For each node in
+//  the stack, there is an array of element ids that represent the ids of
+//  the child elements scanned so far. Upon exit from that element, its
+//  array of child elements is validated.
+//
+//  Since we have the actual XMLElementDecl in the stack nodes, when its time
+//  to validate, we just extract the content model from that element decl
+//  and validate. All the required data falls easily to hand. Note that we
+//  actually have some derivative of XMLElementDecl, which is specific to
+//  the validator used, but the abstract API is sufficient for the needs of
+//  the scanner.
+//
+//  Since the namespace support also requires the storage of information on
+//  a nested element basis, this structure also holds the namespace info. For
+//  each level, the prefixes defined at that level (and the namespaces that
+//  they map to) are stored.
+//
+class XMLPARSER_EXPORT ElemStack
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Class specific data types
+    //
+    //  These really should be private, but some of the compilers we have to
+    //  support are too dumb to deal with that.
+    //
+    //  PrefMapElem
+    //      fURIId is the id of the URI from the validator's URI map. The
+    //      fPrefId is the id of the prefix from our own prefix pool. The
+    //      namespace stack consists of these elements.
+    //
+    //  StackElem
+    //      fThisElement is the basic element decl for the current element.
+    //      The fRowCapacity is how large fChildIds has grown so far.
+    //      fChildCount is how many of them are valid right now.
+    //
+    //      The fMapCapacity is how large fMap has grown so far. fMapCount
+    //      is how many of them are valid right now.
+    //
+    //      Note that we store the reader number we were in when we found the
+    //      start tag. We'll use this at the end tag to test for unbalanced
+    //      markup in entities.
+    //
+    //  MapModes
+    //      When a prefix is mapped to a namespace id, it matters whether the
+    //      QName being mapped is an attribute or name. Attributes are not
+    //      affected by an sibling xmlns attributes, whereas elements are
+    //      affected by its own xmlns attributes.
+    // -----------------------------------------------------------------------
+    struct PrefMapElem
+    {
+        unsigned int        fPrefId;
+        unsigned int        fURIId;
+    };
+
+    struct StackElem
+    {
+        XMLElementDecl*     fThisElement;
+        unsigned int        fReaderNum;
+
+        unsigned int        fChildCapacity;
+        unsigned int        fChildCount;
+        unsigned int*       fChildIds;
+
+        PrefMapElem*        fMap;
+        unsigned int        fMapCapacity;
+        unsigned int        fMapCount;
+    };
+
+    enum MapModes
+    {
+        Mode_Attribute
+        , Mode_Element
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    ElemStack();
+    ~ElemStack();
+
+
+    // -----------------------------------------------------------------------
+    //  Stack access
+    // -----------------------------------------------------------------------
+    unsigned int addLevel();
+    unsigned int addLevel(XMLElementDecl* const toSet, const unsigned int readerNum);
+    XMLElementDecl& elemAt(const unsigned int index);
+    const XMLElementDecl& elemAt(const unsigned int index) const;
+    const StackElem* popTop();
+
+
+    // -----------------------------------------------------------------------
+    //  Stack top access
+    // -----------------------------------------------------------------------
+    unsigned int addChild(const unsigned int childId, const bool toParent);
+    const StackElem* topElement() const;
+    void setElement(XMLElementDecl* const toSet, const unsigned int readerNum);
+
+
+    // -----------------------------------------------------------------------
+    //  Prefix map methods
+    // -----------------------------------------------------------------------
+    void addPrefix
+    (
+        const   XMLCh* const    prefixToAdd
+        , const unsigned int    uriId
+    );
+    unsigned int mapPrefixToURI
+    (
+        const   XMLCh* const    prefixToMap
+        , const MapModes        mode
+        ,       bool&           unknown
+    )   const;
+
+
+    // -----------------------------------------------------------------------
+    //  Miscellaneous methods
+    // -----------------------------------------------------------------------
+    bool isEmpty() const;
+    void reset
+    (
+        const   unsigned int    emptyId
+        , const unsigned int    globalId
+        , const unsigned int    unknownId
+        , const unsigned int    xmlId
+        , const unsigned int    xmlNSId
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Debug only stuff
+    // -----------------------------------------------------------------------
+    #if defined(XML4C_DEBUG)
+    void dumpStacks
+    (
+                TextOutputStream&   target
+        , const XMLValidator&       srcPools
+    );
+    #endif
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    ElemStack(const ElemStack&);
+    void operator=(const ElemStack&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+    void expandMap(StackElem* const toExpand);
+    void expandStack();
+
+
+    // -----------------------------------------------------------------------
+    //  Data members
+    //
+    //  fEmptyNamespaceId
+    //      This is the special URI id for the "" namespace, which is magic
+    //      because of the xmlns="" operation.
+    //
+    //  fGlobalNamespaceId
+    //  fGlobalPoolId
+    //      This is a special URI id that is returned when the namespace
+    //      prefix is "" and no one has explicitly mapped that prefix to an
+    //      explicit URI (or when they explicitly clear any such mapping,
+    //      which they can also do.) And also its prefix pool id, which is
+    //      stored here for fast access.
+    //
+    //  fPrefixPool
+    //      This is the prefix pool where prefixes are hashed and given unique
+    //      ids. These ids are used to track prefixes in the element stack.
+    //
+    //  fStack
+    //  fStackCapacity
+    //  fStackTop
+    //      This the stack array. Its an array of pointers to StackElem
+    //      structures. The capacity is the current high water mark of the
+    //      stack. The top is the current top of stack (i.e. the part of it
+    //      being used.)
+    //
+    //  fUnknownNamespaceId
+    //      This is the URI id for the special URI that is assigned to any
+    //      prefix which has not been mapped. This lets us keep going after
+    //      issuing the error.
+    //
+    //  fXMLNamespaceId
+    //  fXMLPoolId
+    //  fXMLNSNamespaceId
+    //  fXMLNSPoolId
+    //      These are the URI ids for the special URIs that are assigned to
+    //      the 'xml' and 'xmlns' namespaces. And also its prefix pool id,
+    //      which is stored here for fast access.
+    // -----------------------------------------------------------------------
+    unsigned int    fEmptyNamespaceId;
+    unsigned int    fGlobalNamespaceId;
+    unsigned int    fGlobalPoolId;
+    XMLStringPool   fPrefixPool;
+    StackElem**     fStack;
+    unsigned int    fStackCapacity;
+    unsigned int    fStackTop;
+    unsigned int    fUnknownNamespaceId;
+    unsigned int    fXMLNamespaceId;
+    unsigned int    fXMLPoolId;
+    unsigned int    fXMLNSNamespaceId;
+    unsigned int    fXMLNSPoolId;
+};
+
+
+// ---------------------------------------------------------------------------
+//  ElemStack: Miscellaneous methods
+// ---------------------------------------------------------------------------
+inline bool ElemStack::isEmpty() const
+{
+    return (fStackTop == 0);
+}
+
+#endif
diff --git a/src/internal/EndOfEntityException.hpp b/src/internal/EndOfEntityException.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..6dc585f014569ea575aa44dbe37bfb334167c438
--- /dev/null
+++ b/src/internal/EndOfEntityException.hpp
@@ -0,0 +1,151 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:07  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:42  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(ENDOFENTITYEXCEPTION_HPP)
+#define ENDOFENTITYEXCEPTION_HPP
+
+class XMLEntityDecl;
+
+//
+//  This class is only used internally. Its thrown by the ReaderMgr class,
+//  when an entity ends, and is caught in the scanner. This tells the scanner
+//  that an entity has ended, and allows it to do the right thing according
+//  to what was going on when the entity ended.
+//
+//  Since its internal, it does not bother implementing XMLException.
+//
+class XMLPARSER_EXPORT EndOfEntityException
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    EndOfEntityException(       XMLEntityDecl*  entityThatEnded
+                        , const unsigned int    readerNum) :
+
+        fEntity(entityThatEnded)
+        , fReaderNum(readerNum)
+    {
+    }
+
+    EndOfEntityException(const EndOfEntityException& toCopy) :
+
+        fEntity(toCopy.fEntity)
+        , fReaderNum(toCopy.fReaderNum)
+    {
+    }
+
+    ~EndOfEntityException()
+    {
+    }
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    XMLEntityDecl& getEntity();
+    const XMLEntityDecl& getEntity() const;
+    unsigned int getReaderNum() const;
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fEntity
+    //      This is a reference to the entity that ended, causing this
+    //      exception.
+    //
+    //  fReaderNum
+    //      The unique reader number of the reader that was handling this
+    //      entity. This is used to know whether a particular entity has
+    //      ended.
+    // -----------------------------------------------------------------------
+    XMLEntityDecl*  fEntity;
+    unsigned int    fReaderNum;
+};
+
+
+// ---------------------------------------------------------------------------
+//  EndOfEntityException: Getter methods
+// ---------------------------------------------------------------------------
+inline XMLEntityDecl& EndOfEntityException::getEntity()
+{
+    return *fEntity;
+}
+
+inline const XMLEntityDecl& EndOfEntityException::getEntity() const
+{
+    return *fEntity;
+}
+
+inline unsigned int EndOfEntityException::getReaderNum() const
+{
+    return fReaderNum;
+}
+
+#endif
diff --git a/src/internal/Makefile.in b/src/internal/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..936be949b443128e42a2fb4e8f99139fba2d58e8
--- /dev/null
+++ b/src/internal/Makefile.in
@@ -0,0 +1,145 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:08:09  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:44:42  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#:
+#
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+LDFLAGS = @ldflags@
+LIBS = @libs@
+OSVER = @osver@
+USELIBWWW = @uselibwww@
+MESSAGELOADER = @messageloader@
+TRANSCODER = @transcoder@
+
+include ../Makefile.incl
+
+MODULE = internal
+
+INTERNAL_CPP_PUBHEADERS = \
+	CharTypeTables.hpp \
+	ElemStack.hpp \
+	EndOfEntityException.hpp \
+	MemBufInputSource.hpp \
+	ReaderMgr.hpp \
+	StdInInputSource.hpp \
+	URLInputSource.hpp \
+	VecAttrListImpl.hpp \
+	XMLReader.hpp \
+	XMLScanner.hpp
+
+INTERNAL_CPP_PRIVHEADERS = 
+
+INTERNAL_C_FILES = 
+
+INTERNAL_CPP_OBJECTS = \
+	ElemStack.o \
+	MemBufInputSource.o \
+	ReaderMgr.o \
+	StdInInputSource.o \
+	URLInputSource.o \
+	VecAttrListImpl.o \
+	XMLReader.o \
+	XMLScanner.o \
+	XMLScanner2.o
+
+all:	includes $(INTERNAL_CPP_OBJECTS) publish
+
+includes:	pubheaders $(INTERNAL_C_FILES)
+
+pubheaders:
+	-mkdir -p $(XML_INC_DIR)/$(MODULE)
+	$(CP) $(INTERNAL_CPP_PUBHEADERS) $(INTERNAL_C_FILES) $(XML_INC_DIR)/$(MODULE)
+
+publish:
+	-mkdir -p ${ALL_OBJECTS_DIR}
+	$(CP) $(INTERNAL_CPP_OBJECTS) $(ALL_OBJECTS_DIR)
+
+# this may generate unnecessary dependencies, but it makes life easier
+depend: includes
+	$(MAKE_DEPEND) $(XML_INCL) *.cpp > $(DEPFILE)
+
+clean:
+	@echo "Making clean in $(MODULE) ..."
+	$(RM) $(INTERNAL_CPP_OBJECTS)
+
+distclean:	clean
+	$(RM) Makefile $(DEPFILE)
+	@echo "Removing all $(MODULE) header files ..."
+	@for file in $(INTERNAL_CPP_PUBHEADERS); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@for file in $(INTERNAL_C_FILES); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@echo "Removing all $(MODULE) object files ..."
+	@for file in $(INTERNAL_CPP_OBJECTS); do \
+	rm -f $(ALL_OBJECTS_DIR)/$$file; \
+	done
+
+install:
+	-mkdir -p $(PREFIX)/$(MODULE)
+	$(CP) $(INTERNAL_CPP_PUBHEADERS) $(INTERNAL_C_FILES) $(PREFIX)/$(MODULE)
diff --git a/src/internal/MemBufInputSource.cpp b/src/internal/MemBufInputSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a3b6aafbc78035c227baa3e37f7b7bf208b5ebab
--- /dev/null
+++ b/src/internal/MemBufInputSource.cpp
@@ -0,0 +1,125 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:10  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:42  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <internal/MemBufInputSource.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  MemBufInputSource: Constructors and Destructor
+// ---------------------------------------------------------------------------
+MemBufInputSource::MemBufInputSource(   const   XMLByte* const  srcDocBytes
+                                        , const unsigned int    byteCount
+                                        , const XMLCh* const    bufId
+                                        , const bool            adoptBuffer) :
+    InputSource(bufId)
+    , fAdopted(adoptBuffer)
+    , fByteCount(byteCount)
+    , fCopyBufToStream(true)
+    , fSrcBytes(srcDocBytes)
+{
+}
+
+MemBufInputSource::MemBufInputSource(   const   XMLByte* const  srcDocBytes
+                                        , const unsigned int    byteCount
+                                        , const char* const     bufId
+                                        , const bool            adoptBuffer) :
+    InputSource(bufId)
+    , fAdopted(adoptBuffer)
+    , fByteCount(byteCount)
+    , fCopyBufToStream(true)
+    , fSrcBytes(srcDocBytes)
+{
+}
+
+MemBufInputSource::~MemBufInputSource()
+{
+    if (fAdopted)
+        delete [] (XMLByte*)fSrcBytes;
+}
+
+
+// ---------------------------------------------------------------------------
+//  MemBufInputSource: InputSource interface implementation
+// ---------------------------------------------------------------------------
+BinInputStream* MemBufInputSource::makeStream() const
+{
+    //
+    //  Create a memory input stream over our buffer. According to our
+    //  fCopyBufToStream flag, we either tell it to copy the buffer or to
+    //  just reference it.
+    //
+    return new BinMemInputStream
+    (
+        fSrcBytes
+        , fByteCount
+        , fCopyBufToStream ? BinMemInputStream::BufOpt_Copy
+                           : BinMemInputStream::BufOpt_Reference
+    );
+}
diff --git a/src/internal/MemBufInputSource.hpp b/src/internal/MemBufInputSource.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..91eb8cbb0b977ddc095dd3891d95904b1f7c3aec
--- /dev/null
+++ b/src/internal/MemBufInputSource.hpp
@@ -0,0 +1,147 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:10  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:43  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(MEMBUFINPUTSOURCE_HPP)
+#define MEMBUFINPUTSOURCE_HPP
+
+#include <sax/InputSource.hpp>
+#include <util/BinMemInputStream.hpp>
+
+
+class XMLPARSER_EXPORT MemBufInputSource : public InputSource
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    MemBufInputSource
+    (
+        const   XMLByte* const  srcDocBytes
+        , const unsigned int    byteCount
+        , const XMLCh* const    bufId
+        , const bool            adoptBuffer = false
+    );
+
+    MemBufInputSource
+    (
+        const   XMLByte* const  srcDocBytes
+        , const unsigned int    byteCount
+        , const char* const     bufId
+        , const bool            adoptBuffer = false
+    );
+
+    ~MemBufInputSource();
+
+
+    // -----------------------------------------------------------------------
+    //  Virtual input source interface
+    // -----------------------------------------------------------------------
+    BinInputStream* makeStream() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setCopyBufToStream(const bool newState);
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fAdopted
+    //      Indicates whether the buffer is adopted or not. If so, then it
+    //      is destroyed when the input source is destroyed.
+    //
+    //  fByteCount
+    //      The size of the source document.
+    //
+    //  fCopyBufToStream
+    //      This defaults to true (the safe option), which causes it to
+    //      give a copy of the buffer to any streams it creates. If you set
+    //      it to false, it will allow the streams to just reference the
+    //      buffer (in which case this input source must stay alive as long
+    //      as the buffer is in use by the stream.)
+    //
+    //  fSrcBytes
+    //      The source memory buffer that is being spooled from. Whether it
+    //      belongs to the this input source or not is controlled by the
+    //      fAdopted flag.
+    // -----------------------------------------------------------------------
+    bool            fAdopted;
+    unsigned int    fByteCount;
+    bool            fCopyBufToStream;
+    const XMLByte*  fSrcBytes;
+};
+
+
+inline void MemBufInputSource::setCopyBufToStream(const bool newState)
+{
+    fCopyBufToStream = newState;
+}
+
+#endif
diff --git a/src/internal/ReaderMgr.cpp b/src/internal/ReaderMgr.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1b4c06c02b4d65f62b41cb765b15acee5d06807a
--- /dev/null
+++ b/src/internal/ReaderMgr.cpp
@@ -0,0 +1,936 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:11  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:56:54  droddey
+ * If the main xml entity does not exist, we need to get the error handling for that
+ * inside the main XMLScanner::scanDocument() try block so that it gets reported
+ * in the normal way. We have to add a little extra safety code because, when this
+ * happens, there is no reader on the reader stack to get position ino from.
+ *
+ * Revision 1.3  1999/11/08 20:44:43  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/BinMemInputStream.hpp>
+#include <util/Janitor.hpp>
+#include <util/PlatformUtils.hpp>
+#include <util/RuntimeException.hpp>
+#include <util/UnexpectedEOFException.hpp>
+#include <util/URL.hpp>
+#include <util/XMLUni.hpp>
+#include <sax/InputSource.hpp>
+#include <framework/XMLBuffer.hpp>
+#include <framework/XMLDocumentHandler.hpp>
+#include <framework/XMLEntityDecl.hpp>
+#include <framework/XMLEntityHandler.hpp>
+#include <internal/EndOfEntityException.hpp>
+#include <internal/ReaderMgr.hpp>
+#include <internal/URLInputSource.hpp>
+
+
+
+// ---------------------------------------------------------------------------
+//  ReaderMgr: Constructors and Destructor
+// ---------------------------------------------------------------------------
+ReaderMgr::ReaderMgr() :
+
+    fBasePath(0)
+    , fCurEntity(0)
+    , fCurReader(0)
+    , fEntityHandler(0)
+    , fEntityStack(0)
+    , fNextReaderNum(1)
+    , fReaderStack(0)
+    , fThrowEOE(false)
+{
+}
+
+ReaderMgr::~ReaderMgr()
+{
+    //
+    //  Clean up the reader and entity stacks. Note that we don't own the
+    //  entities, so we don't delete the current entity (and the entity stack
+    //  does not own its elements either, so deleting it will not delete the
+    //  entities it still references!)
+    //
+    delete [] fBasePath;
+    delete fCurReader;
+    delete fReaderStack;
+    delete fEntityStack;
+}
+
+
+// ---------------------------------------------------------------------------
+//  ReaderMgr: Getter methods
+// ---------------------------------------------------------------------------
+bool ReaderMgr::isEmpty() const
+{
+    return fReaderStack->empty();
+}
+
+
+// ---------------------------------------------------------------------------
+//  ReaderMgr: Scanning APIs
+// ---------------------------------------------------------------------------
+XMLCh ReaderMgr::getCharData(XMLBuffer&     toFill
+                            , XMLScanner&   owningScanner
+                            , bool&         gotLeadingSurrogate)
+{
+    //
+    //  NOTE:   We DO NOT reset the buffer here. This is an accumulation
+    //          method that will be called multiple times in some cases to
+    //          get all the contiguous char data.
+    //
+    //  Ok, so enter the loop and get char data until we can't go no more.
+    //
+    XMLCh breakCh = chNull;
+    while (true)
+    {
+        //
+        //  Ask the current reader for all he's got. He will return the
+        //  break character that caused him to break out. If its null, then
+        //  it just means he has no more data, so we can pop a reader and
+        //  keep going. Otherwise, we return with that break char.
+        //
+        breakCh = fCurReader->getCharData(toFill, owningScanner, gotLeadingSurrogate);
+        if (breakCh)
+            break;
+
+        // If we cannot pop a reader, then just break out with the null char
+        if (!popReader())
+            break;
+    }
+    return breakCh;
+}
+
+
+XMLCh ReaderMgr::getNextChar()
+{
+    XMLCh chRet;
+    if (fCurReader->getNextChar(chRet))
+        return chRet;
+
+    //
+    //  Didn't get anything back so this reader is hosed. So lets move to
+    //  the next reader on the stack. If this fails, it will be because
+    //  its the end of the original file, and we just return zero.
+    //
+    //  If its the end of an entity and fThrowEOE is set, it will throw out
+    //  of here. Otherwise, it will take us down to the next reader and
+    //  we'll have more chars.
+    //
+    if (!popReader())
+        return XMLCh(0);
+
+    // Else try again and return the new character
+    fCurReader->getNextChar(chRet);
+    return chRet;
+}
+
+
+void ReaderMgr::getSpaces(XMLBuffer& toFill)
+{
+    // Reset the buffer before we start
+    toFill.reset();
+
+    while (true)
+    {
+        //
+        //  Get all the spaces from the current reader. If it returns true,
+        //  it hit a non-space and we are done. Else we have to pop a reader
+        //  and keep going.
+        //
+        if (fCurReader->getSpaces(toFill))
+            break;
+
+        // We wore that one out, so lets pop a reader and try again
+        if (!popReader())
+            break;
+    }
+}
+
+
+void ReaderMgr::getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck)
+{
+    // Reset the target buffer before we start
+    toFill.reset();
+
+    //
+    //  Ok, enter a loop where we ask the current reader to get chars until
+    //  it meets the criteria. It returns false if it came back due to eating
+    //  up all of its data. Else it returned because something matched, and
+    //  we are done.
+    //
+    while (true)
+    {
+        if (fCurReader->getUpToCharOrWS(toFill, toCheck))
+            break;
+
+        // We ate that one up, lets try to pop another. If not, break out
+        if (!popReader())
+            break;
+    }
+}
+
+
+XMLCh ReaderMgr::peekNextChar()
+{
+    XMLCh chRet;
+    if (fCurReader->peekNextChar(chRet))
+        return chRet;
+
+    //
+    //  Didn't get anything back so this reader is hosed. So lets move to
+    //  the next reader on the stack. If this fails, it will be because
+    //  its the end of the original file, and we just return zero.
+    //
+    if (!popReader())
+        return XMLCh(0);
+
+    // Else peek again and return the character
+    fCurReader->peekNextChar(chRet);
+    return chRet;
+}
+
+
+bool ReaderMgr::skippedChar(const XMLCh toCheck)
+{
+    while (true)
+    {
+        // If we get it, then just return true now
+        if (fCurReader->skippedChar(toCheck))
+            return true;
+
+        //
+        //  Check to see if we hit end of input on this reader. If so, then
+        //  lets pop and try again. Else, we failed. If we cannot pop another
+        //  then we failed.
+        //
+        if (!fCurReader->getNoMoreFlag())
+            break;
+
+        if (!popReader())
+            break;
+    }
+    return false;
+}
+
+
+bool ReaderMgr::skippedSpace()
+{
+    while (true)
+    {
+        // If we get it, then just return true now
+        if (fCurReader->skippedSpace())
+            return true;
+
+        //
+        //  Check to see if we hit end of input on this reader. If so, then
+        //  lets pop and try again. Else, we failed. If we cannot pop another
+        //  then we failed.
+        //
+        if (!fCurReader->getNoMoreFlag())
+            break;
+
+        if (!popReader())
+            break;
+    }
+    return false;
+}
+
+
+bool ReaderMgr::skipIfQuote(XMLCh& chGotten)
+{
+    while (true)
+    {
+        // If we get it, then just return true now
+        if (fCurReader->skipIfQuote(chGotten))
+            return true;
+
+        //
+        //  Check to see if we hit end of input on this reader. If so, then
+        //  lets pop and try again. Else, we failed. If we cannot pop another
+        //  then we failed.
+        //
+        if (!fCurReader->getNoMoreFlag())
+            break;
+
+        if (!popReader())
+            break;
+    }
+    return false;
+}
+
+
+bool ReaderMgr::skipPastSpaces()
+{
+    bool skippedSomething = false;
+    bool tmpFlag;
+    while (true)
+    {
+        //
+        //  Skip all the spaces in the current reader. If it returned because
+        //  it hit a non-space, break out. Else we have to pop another entity
+        //  and keep going.
+        //
+        if (fCurReader->skipSpaces(tmpFlag))
+            break;
+
+        if (tmpFlag)
+            skippedSomething = true;
+
+        // Try to pop another enitity. If we can't then we are done
+        if (!popReader())
+            break;
+    }
+    return (tmpFlag || skippedSomething);
+}
+
+
+void ReaderMgr::skipQuotedString(const XMLCh quoteCh)
+{
+    XMLCh nextCh;
+    while (true)
+    {
+        nextCh = getNextChar();
+
+        // If we get an end of file char, then return
+        if (!nextCh)
+            break;
+
+        // If we get the quote char, then break out
+        if (nextCh == quoteCh)
+            break;
+    }
+}
+
+
+XMLCh ReaderMgr::skipUntilIn(const XMLCh* const listToSkip)
+{
+    XMLCh nextCh;
+    while (true)
+    {
+        nextCh = peekNextChar();
+
+        if (!nextCh)
+            break;
+
+        if (XMLString::indexOf(listToSkip, nextCh) != -1)
+            break;
+
+        // Its one of ours so eat it
+        getNextChar();
+    }
+    return nextCh;
+}
+
+
+XMLCh ReaderMgr::skipUntilInOrWS(const XMLCh* const listToSkip)
+{
+    XMLCh nextCh;
+    while (true)
+    {
+        nextCh = peekNextChar();
+
+        if (!nextCh)
+            break;
+
+        if (XMLReader::isWhitespace(nextCh))
+            break;
+
+        if (XMLString::indexOf(listToSkip, nextCh) != -1)
+            break;
+
+        // Its one of ours, so eat it
+        getNextChar();
+    }
+    return nextCh;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  ReaderMgr: Control methods
+// ---------------------------------------------------------------------------
+
+//
+//  If the reader stack is empty, then there is only the original main XML
+//  entity left. If its empty, then we have no more input.
+//
+bool ReaderMgr::atEOF() const
+{
+    return fReaderStack->empty() && fCurReader->getNoMoreFlag();
+}
+
+
+//
+//  This method is called in the case of errors to clean up the stack when
+//  entities have been incorrectly left on the stack due to syntax errors.
+//  It just cleans back the stack, and sends no entity events.
+//
+void ReaderMgr::cleanStackBackTo(const unsigned int readerNum)
+{
+    //
+    //  Just start popping readers until we find the one with the indicated
+    //  reader number.
+    //
+    while (true)
+    {
+        if (fCurReader->getReaderNum() == readerNum)
+            break;
+
+        if (fReaderStack->empty())
+            ThrowXML(RuntimeException, XML4CExcepts::RdrMgr_ReaderIdNotFound);
+
+        delete fCurReader;
+        fCurReader = fReaderStack->pop();
+        fCurEntity = fEntityStack->pop();
+    }
+}
+
+
+XMLReader* ReaderMgr::createReader( const   InputSource&        src
+                                    , const bool                xmlDecl
+                                    , const XMLReader::RefFrom  refFrom
+                                    , const XMLReader::Types    type
+                                    , const XMLReader::Sources  source)
+{
+    //
+    //  Ask the input source to create us an input stream. The particular
+    //  type of input source will know what kind to create.
+    //
+    BinInputStream* newStream = src.makeStream();
+    if (!newStream)
+        return 0;
+
+    //
+    //  Create a new reader and return it. If the source has an encoding that
+    //  it wants to force, then we call the constructor that does that.
+    //  Otherwise, we just call the one that provides the provisional encoding
+    //  to be possibly updated later by the encoding="" setting.
+    //
+    XMLReader* retVal = 0;
+    if (src.getEncoding())
+    {
+        retVal = new XMLReader
+        (
+            src.getPublicId()
+            , src.getSystemId()
+            , newStream
+            , src.getEncoding()
+            , refFrom
+            , type
+            , source
+        );
+    }
+     else
+    {
+        retVal = new XMLReader
+        (
+            src.getPublicId()
+            , src.getSystemId()
+            , newStream
+            , refFrom
+            , type
+            , source
+        );
+    }
+
+    // Set the next available reader number on this reader
+    retVal->setReaderNum(fNextReaderNum++);
+    return retVal;
+}
+
+
+XMLReader* ReaderMgr::createReader( const   XMLCh* const        sysId
+                                    , const XMLCh* const        pubId
+                                    , const bool                xmlDecl
+                                    , const XMLReader::RefFrom  refFrom
+                                    , const XMLReader::Types    type
+                                    , const XMLReader::Sources  source
+                                    ,       InputSource*&       srcToFill)
+{
+    // Create a buffer for expanding the system id
+    XMLBuffer expSysId;
+
+    //
+    //  Allow the entity handler to expand the system id. If we don't
+    //  have one, or they don't do anything, then just use it as is.
+    //
+    if (fEntityHandler)
+    {
+        if (!fEntityHandler->expandSystemId(sysId, expSysId))
+            expSysId.set(sysId);
+    }
+     else
+    {
+        //
+        //  Try to parse it as a URL. If it succeeds, it must be a
+        //  fully qualified path. Otherwise, its just a file name and
+        //  could be partial so check and append it to the base path
+        //  if so.
+        //
+        URL tmpURL;
+        try
+        {
+            tmpURL.setURL(sysId);
+            expSysId.set(tmpURL.getPath());
+        }
+
+        catch(const MalformedURLException&)
+        {
+            // Its just a file path
+            if (XMLPlatformUtils::isRelative(sysId))
+            {
+                // Its relative so first store the base directory, if any
+                if (fBasePath)
+                    expSysId.set(fBasePath);
+
+                // And then append the relative path
+                expSysId.append(sysId);
+            }
+             else
+            {
+                // The path is not relative, so just set it directly
+                expSysId.set(sysId);
+            }
+        }
+    }
+
+    // Call the entity resolver interface to get an input source
+    srcToFill = 0;
+    if (fEntityHandler)
+    {
+        srcToFill = fEntityHandler->resolveEntity
+        (
+            pubId
+            , expSysId.getRawBuffer()
+        );
+    }
+
+    // If they didn't give us anything, then make up a URL input source
+    if (!srcToFill)
+        srcToFill = new URLInputSource(expSysId.getRawBuffer());
+
+    // Put a janitor on the input source
+    Janitor<InputSource> janSrc(srcToFill);
+
+    //
+    //  Now call the other version with the input source that we have, and
+    //  return the resulting reader.
+    //
+    XMLReader* retVal = createReader
+    (
+        *srcToFill
+        , xmlDecl
+        , refFrom
+        , type
+        , source
+    );
+
+    // Either way, we can release the input source now
+    janSrc.orphan();
+
+    // If it failed for any reason, then return zero.
+    if (!retVal)
+        return 0;
+
+    //
+    //  Give this reader the next available reader number. And let the input
+    //  source live to be returned to the caller.
+    //
+    retVal->setReaderNum(fNextReaderNum++);
+    return retVal;
+}
+
+
+XMLReader*
+ReaderMgr::createIntEntReader(  const   XMLCh* const        sysId
+                                , const XMLReader::RefFrom  refFrom
+                                , const XMLReader::Types    type
+                                , const XMLCh* const        dataBuf
+                                , const unsigned int        dataLen
+                                , const bool                copyBuf)
+{
+    //
+    //  This one is easy, we just create an input stream for the data and
+    //  provide a few extra goodies.
+    //
+    XMLReader* retVal = new XMLReader
+    (
+        sysId
+        , 0
+        , new BinMemInputStream
+          (
+            (const XMLByte*)dataBuf
+            , dataLen * sizeof(XMLCh)
+            , copyBuf ? BinMemInputStream::BufOpt_Copy
+                        : BinMemInputStream::BufOpt_Reference
+          )
+        , XMLRecognizer::nameForEncoding(XMLRecognizer::Def_UTF16)
+        , refFrom
+        , type
+        , XMLReader::Source_Internal
+    );
+
+    // Set the reader number to the next available number
+    retVal->setReaderNum(fNextReaderNum++);
+    return retVal;
+}
+
+
+const XMLCh* ReaderMgr::getCurrentEncodingStr() const
+{
+    const XMLEntityDecl*    theEntity;
+    const XMLReader*        theReader = getLastExtEntity(theEntity);
+
+    return theReader->getEncodingStr();
+}
+
+
+const XMLEntityDecl* ReaderMgr::getCurrentEntity() const
+{
+    return fCurEntity;
+}
+
+
+XMLEntityDecl* ReaderMgr::getCurrentEntity()
+{
+    return fCurEntity;
+}
+
+
+const XMLReader* ReaderMgr::getCurrentReader() const
+{
+    return fCurReader;
+}
+
+
+XMLReader* ReaderMgr::getCurrentReader()
+{
+    return fCurReader;
+}
+
+
+void ReaderMgr::getLastExtEntityInfo(LastExtEntityInfo& lastInfo) const
+{
+    //
+    //  If the reader stack never got created, then we can't give this
+    //  information.
+    //
+    if (!fReaderStack && !fCurReader)
+    {
+        lastInfo.systemId = XMLString::replicate(XMLUni::fgZeroLenString);
+        lastInfo.publicId = XMLString::replicate(XMLUni::fgZeroLenString);
+        lastInfo.lineNumber = 0;
+        lastInfo.colNumber = 0;
+        return;
+    }
+
+    // We have at least one entity so get the data
+    const XMLEntityDecl*    theEntity;
+    const XMLReader*        theReader = getLastExtEntity(theEntity);
+
+    // Fill in the info structure with the reader we found
+    lastInfo.systemId = theReader->getSystemId();
+    lastInfo.publicId = theReader->getPublicId();
+    lastInfo.lineNumber = theReader->getLineNumber();
+    lastInfo.colNumber = theReader->getColumnNumber();
+}
+
+
+bool ReaderMgr::isScanningPERefOutOfLiteral() const
+{
+    // If the current reader is not for an entity, then definitely not
+    if (!fCurEntity)
+        return false;
+
+    //
+    //  If this is a PE entity, and its not being expanded in a literal
+    //  then its true.
+    //
+    if ((fCurReader->getType() == XMLReader::Type_PE)
+    &&  (fCurReader->getRefFrom() == XMLReader::RefFrom_NonLiteral))
+    {
+        return true;
+    }
+    return false;
+}
+
+
+bool ReaderMgr::pushReader(         XMLReader* const        reader
+                            ,       XMLEntityDecl* const    entity)
+{
+    //
+    //  First, if an entity was passed, we have to confirm that this entity
+    //  is not already on the entity stack. If so, then this is a recursive
+    //  entity expansion, so we issue an error and refuse to put the reader
+    //  on the stack.
+    //
+    //  If there is no entity passed, then its not an entity being pushed, so
+    //  nothing to do. If there is no entity stack yet, then of coures it
+    //  cannot already be there.
+    //
+    if (entity && fEntityStack)
+    {
+        const unsigned int count = fEntityStack->size();
+        const XMLCh* const theName = entity->getName();
+        for (unsigned int index = 0; index < count; index++)
+        {
+            const XMLEntityDecl* curDecl = fEntityStack->elementAt(index);
+            if (curDecl)
+            {
+                if (!XMLString::compareString(theName, curDecl->getName()))
+                {
+                    // Oops, already there so delete reader and return
+                    delete reader;
+                    return false;
+                }
+            }
+        }
+    }
+
+    //
+    //  Fault in the reader stack. Give it an initial capacity of 16, and
+    //  tell it it does own its elements.
+    //
+    if (!fReaderStack)
+        fReaderStack = new RefStackOf<XMLReader>(16, true);
+
+    // And the entity stack, which does not own its elements
+    if (!fEntityStack)
+        fEntityStack = new RefStackOf<XMLEntityDecl>(16, false);
+
+    //
+    //  Push the current reader and entity onto their respective stacks.
+    //  Note that the the current entity can be null if the current reader
+    //  is not for an entity.
+    //
+    if (fCurReader)
+    {
+        fReaderStack->push(fCurReader);
+        fEntityStack->push(fCurEntity);
+    }
+
+    //
+    //  Make the passed reader and entity the current top of stack. The
+    //  passed entity can (and often is) null.
+    //
+    fCurReader = reader;
+    fCurEntity = entity;
+
+    return true;
+}
+
+
+void ReaderMgr::reset()
+{
+    // Reset all of the flags
+    fThrowEOE = false;
+
+    // Delete the base path, which has to be reset each time
+    delete [] fBasePath;
+    fBasePath = 0;
+
+    // Delete the current reader and flush the reader stack
+    delete fCurReader;
+    fCurReader = 0;
+    if (fReaderStack)
+        fReaderStack->removeAllElements();
+
+    //
+    //  And do the same for the entity stack, but don't delete the current
+    //  entity (if any) since we don't own them.
+    //
+    fCurEntity = 0;
+    if (fEntityStack)
+        fEntityStack->removeAllElements();
+}
+
+
+// ---------------------------------------------------------------------------
+//  ReaderMgr: Private helper methods
+// ---------------------------------------------------------------------------
+const XMLReader*
+ReaderMgr::getLastExtEntity(const XMLEntityDecl*& itsEntity) const
+{
+    //
+    //  Scan down the reader stack until we find a reader for an entity that
+    //  is external. First check that there is anything in the stack at all,
+    //  in which case the current reader is the main file and that's the one
+    //  that we want.
+    //
+    const XMLReader* theReader = fCurReader;
+
+    //
+    //  If there is a current entity and it is not an external entity, then
+    //  search the stack; else, keep the reader that we've got since its
+    //  either an external entity reader or the main file reader.
+    //
+    const XMLEntityDecl* curEntity = fCurEntity;
+    if (curEntity && !curEntity->isExternal())
+    {
+        unsigned int index = fReaderStack->size();
+        if (index)
+        {
+            while (true)
+            {
+                // Move down to the previous element and get a pointer to it
+                index--;
+                curEntity = fEntityStack->elementAt(index);
+
+                //
+                //  If its null or its an external entity, then this reader
+                //  is what we want, so break out with that one.
+                //
+                if (!curEntity)
+                {
+                    theReader = fReaderStack->elementAt(index);
+                    break;
+                }
+                 else if (curEntity->isExternal())
+                {
+                    theReader = fReaderStack->elementAt(index);
+                    break;
+                }
+
+                // We hit the end, so leave the main file reader as the one
+                if (!index)
+                    break;
+            }
+        }
+    }
+
+    itsEntity = curEntity;
+    return theReader;
+}
+
+
+bool ReaderMgr::popReader()
+{
+    //
+    //  We didn't get any more, so try to pop off a reader. If the reader
+    //  stack is empty, then we are at the end, so return false.
+    //
+    if (fReaderStack->empty())
+        return false;
+
+    //
+    //  Remember the current entity, before we pop off a new one. We might
+    //  need this to throw the end of entity exception at the end.
+    //
+    XMLEntityDecl* prevEntity = fCurEntity;
+    const bool prevReaderThrowAtEnd = fCurReader->getThrowAtEnd();
+    const unsigned int readerNum = fCurReader->getReaderNum();
+
+    //
+    //  Delete the current reader and pop a new reader and entity off
+    //  the stacks.
+    //
+    delete fCurReader;
+    fCurReader = fReaderStack->pop();
+    fCurEntity = fEntityStack->pop();
+
+    //
+    //  If there was a previous entity, and either the fThrowEOE flag is set
+    //  or reader was marked as such, then throw an end of entity.
+    //
+    if (prevEntity && fThrowEOE || prevReaderThrowAtEnd)
+        throw EndOfEntityException(prevEntity, readerNum);
+
+    while (true)
+    {
+        //
+        //  They don't want us to throw, so lets just return with a new
+        //  reader. Here we have to do a loop because we might have multiple
+        //  readers on these stack that are empty (i.e. the last char in them
+        //  was the ';' at the end of the entity ref that caused the next
+        //  entity to be pushed.
+        //
+        //  So we loop until we find a non-empty reader, or hit the main
+        //  file entity. If we find one with some chars available, then break
+        //  out and take that one.
+        //
+        if (fCurReader->charsLeftInBuffer())
+            break;
+
+        fCurReader->refreshCharBuffer();
+        if (fCurReader->charsLeftInBuffer())
+            break;
+
+        //
+        //  The current one is hosed. So, if the reader stack is empty we
+        //  are dead meat and can give up now.
+        //
+        if (fReaderStack->empty())
+            return false;
+
+        // Else pop again and try it one more time
+        delete fCurReader;
+        fCurReader = fReaderStack->pop();
+        fCurEntity = fEntityStack->pop();
+    }
+    return true;
+}
diff --git a/src/internal/ReaderMgr.hpp b/src/internal/ReaderMgr.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e224d381cc3cffd933f6a0545fd9bb75476c3938
--- /dev/null
+++ b/src/internal/ReaderMgr.hpp
@@ -0,0 +1,401 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:13  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:56:54  droddey
+ * If the main xml entity does not exist, we need to get the error handling for that
+ * inside the main XMLScanner::scanDocument() try block so that it gets reported
+ * in the normal way. We have to add a little extra safety code because, when this
+ * happens, there is no reader on the reader stack to get position ino from.
+ *
+ * Revision 1.3  1999/11/08 20:44:43  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(READERMGR_HPP)
+#define READERMGR_HPP
+
+#include <framework/XMLBuffer.hpp>
+#include <util/RefStackOf.hpp>
+#include <util/XMLString.hpp>
+#include <internal/XMLReader.hpp>
+
+class XMLBuffer;
+class XMLEntityDecl;
+class XMLEntityHandler;
+class XMLDocumentHandler;
+class XMLScanner;
+
+
+// ---------------------------------------------------------------------------
+//  This class is used by the scanner. The scanner must deal with expansion
+//  of entities, some of which are totally different files (external parsed
+//  entities.) It does so by pushing readers onto a stack. The top reader is
+//  the one it wants to read out of, but that one must be popped when it is
+//  empty. To keep that logic from being all over the place, the scanner
+//  talks to the reader manager, which handles the stack and popping off
+//  used up readers.
+// ---------------------------------------------------------------------------
+class XMLPARSER_EXPORT ReaderMgr
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Class specific types
+    // -----------------------------------------------------------------------
+    struct LastExtEntityInfo
+    {
+        const   XMLCh*          systemId;
+        const   XMLCh*          publicId;
+                unsigned int    lineNumber;
+                unsigned int    colNumber;
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    ReaderMgr();
+    ~ReaderMgr();
+
+
+    // -----------------------------------------------------------------------
+    //  Convenience scanning methods
+    //
+    //  This are all convenience methods that work in terms of the core
+    //  character spooling methods.
+    // -----------------------------------------------------------------------
+    bool atEOF() const;
+    XMLCh getCharData
+    (
+        XMLBuffer&      toFill
+        , XMLScanner&   owningScanner
+        , bool&         gotLeadingSurrogate
+    );
+    bool getName(XMLBuffer& toFill);
+    bool getNameToken(XMLBuffer& toFill);
+    XMLCh getNextChar();
+    void getSpaces(XMLBuffer& toFill);
+    void getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck);
+    bool isEmpty() const;
+    bool lookingAtChar(const XMLCh toCheck);
+    bool lookingAtSpace();
+    XMLCh peekNextChar();
+    bool skipIfQuote(XMLCh& chGotten);
+    void skipPastChar(const XMLCh toSkip);
+    bool skipPastSpaces();
+    void skipToChar(const XMLCh toSkipTo);
+    bool skippedChar(const XMLCh toSkip);
+    bool skippedSpace();
+    bool skippedString(const XMLCh* const toSkip);
+    void skipQuotedString(const XMLCh quoteCh);
+    XMLCh skipUntilIn(const XMLCh* const listToSkip);
+    XMLCh skipUntilInOrWS(const XMLCh* const listToSkip);
+
+
+    // -----------------------------------------------------------------------
+    //  Control methods
+    // -----------------------------------------------------------------------
+    void cleanStackBackTo(const unsigned int readerNum);
+    XMLReader* createReader
+    (
+        const   InputSource&        src
+        , const bool                xmlDecl
+        , const XMLReader::RefFrom  refFrom
+        , const XMLReader::Types    type
+        , const XMLReader::Sources  source
+    );
+    XMLReader* createReader
+    (
+        const   XMLCh* const        sysId
+        , const XMLCh* const        pubId
+        , const bool                xmlDecl
+        , const XMLReader::RefFrom  refFrom
+        , const XMLReader::Types    type
+        , const XMLReader::Sources  source
+        ,       InputSource*&       srcToFill
+    );
+    XMLReader* createIntEntReader
+    (
+        const   XMLCh* const        sysId
+        , const XMLReader::RefFrom  refFrom
+        , const XMLReader::Types    type
+        , const XMLCh* const        dataBuf
+        , const unsigned int        dataLen
+        , const bool                copyBuf
+    );
+    bool isScanningPERefOutOfLiteral() const;
+    bool pushReader
+    (
+                XMLReader* const        reader
+        ,       XMLEntityDecl* const    entity
+    );
+    void reset();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const XMLCh* getCurrentEncodingStr() const;
+    const XMLEntityDecl* getCurrentEntity() const;
+    XMLEntityDecl* getCurrentEntity();
+    const XMLReader* getCurrentReader() const;
+    XMLReader* getCurrentReader();
+    unsigned int getCurrentReaderNum() const;
+    void getLastExtEntityInfo(LastExtEntityInfo& lastInfo) const;
+    bool getThrowEOE() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setBasePath(const XMLCh* const path);
+    void setEntityHandler(XMLEntityHandler* const newHandler);
+    void setThrowEOE(const bool newValue);
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+    const XMLReader* getLastExtEntity(const XMLEntityDecl*& itsEntity) const;
+    bool popReader();
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fBasePath
+    //      This is the base path from which all other relative references
+    //      are based. Its passed on to us from the scanner.
+    //
+    //  fCurEntity
+    //      This is the current top of stack entity. We pull it off the stack
+    //      and store it here for efficiency.
+    //
+    //  fCurReader
+    //      This is the current top of stack reader. We pull it off the
+    //      stack and store it here for efficiency.
+    //
+    //  fEntityHandler
+    //      This is the installed entity handler. Its installed via the
+    //      scanner but he passes it on to us since we need it the most, in
+    //      process of creating external entity readers.
+    //
+    //  fEntityStack
+    //      We need to keep up with which of the pushed readers are pushed
+    //      entity values that are being spooled. This is done to avoid the
+    //      problem of recursive definitions. This stack consists of refs to
+    //      EntityDecl objects for the pushed entities.
+    //
+    //  fNextReaderNum
+    //      This is the reader serial number value. Each new reader that is
+    //      created from this reader is given a successive number. This lets
+    //      us catch things like partial markup errors and such.
+    //
+    //  fReaderStack
+    //      This is the stack of reader references. We own all the readers
+    //      and destroy them when they are used up.
+    //
+    //  fThrowEOE
+    //      This flag controls whether we throw an exception when we hit an
+    //      end of entity. The scanner doesn't really need to know about ends
+    //      of entities in the int/ext subsets, so it will turn this flag off
+    //      until it gets into the content usually.
+    // -----------------------------------------------------------------------
+    XMLCh*                      fBasePath;
+    XMLEntityDecl*              fCurEntity;
+    XMLReader*                  fCurReader;
+    XMLEntityHandler*           fEntityHandler;
+    RefStackOf<XMLEntityDecl>*  fEntityStack;
+    unsigned int                fNextReaderNum;
+    RefStackOf<XMLReader>*      fReaderStack;
+    bool                        fThrowEOE;
+};
+
+
+
+// ---------------------------------------------------------------------------
+//  ReaderMgr: Inlined methods
+//
+//  NOTE: We cannot put these in alphabetical and type order as we usually
+//  do because some of the compilers we have to support are too stupid to
+//  understand out of order inlines!
+// ---------------------------------------------------------------------------
+inline unsigned int ReaderMgr::getCurrentReaderNum() const
+{
+    return fCurReader->getReaderNum();
+}
+
+inline bool ReaderMgr::getName(XMLBuffer& toFill)
+{
+    toFill.reset();
+    return fCurReader->getName(toFill, false);
+}
+
+inline bool ReaderMgr::getNameToken(XMLBuffer& toFill)
+{
+    toFill.reset();
+    return fCurReader->getName(toFill, true);
+}
+
+inline bool ReaderMgr::getThrowEOE() const
+{
+    return fThrowEOE;
+}
+
+inline bool ReaderMgr::lookingAtChar(const XMLCh chToCheck)
+{
+    return (chToCheck == peekNextChar());
+}
+
+inline bool ReaderMgr::lookingAtSpace()
+{
+    return XMLReader::isWhitespace(peekNextChar());
+}
+
+inline void ReaderMgr::setThrowEOE(const bool newValue)
+{
+    fThrowEOE = newValue;
+}
+
+inline bool ReaderMgr::skippedString(const XMLCh* const toSkip)
+{
+    return fCurReader->skippedString(toSkip);
+}
+
+inline void ReaderMgr::skipToChar(const XMLCh toSkipTo)
+{
+    while (true)
+    {
+        // Get chars until we find the one to skip
+        const XMLCh nextCh = getNextChar();
+
+        // Break out at end of input or the char to skip
+        if ((nextCh == toSkipTo) || !nextCh)
+            break;
+    }
+}
+
+inline void ReaderMgr::skipPastChar(const XMLCh toSkipPast)
+{
+    while (true)
+    {
+        // Get chars until we find the one to skip
+        const XMLCh nextCh = getNextChar();
+
+        if ((nextCh == toSkipPast) || !nextCh)
+            break;
+    }
+}
+
+inline void ReaderMgr::setBasePath(const XMLCh* const path)
+{
+    delete [] fBasePath;
+    fBasePath = XMLString::replicate(path);
+}
+
+inline void ReaderMgr::setEntityHandler(XMLEntityHandler* const newHandler)
+{
+    fEntityHandler = newHandler;
+}
+
+
+//
+//  This is a simple class to temporarily change the 'throw at end of entity'
+//  flag of the reader manager. There are some places where we need to
+//  turn this on and off on a scoped basis.
+//
+class XMLPARSER_EXPORT ThrowEOEJanitor
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and destructor
+    // -----------------------------------------------------------------------
+    ThrowEOEJanitor(ReaderMgr* mgrTarget, const bool newValue) :
+
+        fMgr(mgrTarget)
+        , fOld(mgrTarget->getThrowEOE())
+    {
+        mgrTarget->setThrowEOE(newValue);
+    }
+
+    ~ThrowEOEJanitor()
+    {
+        fMgr->setThrowEOE(fOld);
+    };
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fOld
+    //      The previous value of the flag, which we replaced during ctor,
+    //      and will replace during dtor.
+    //
+    //  fMgr
+    //      A pointer to the reader manager we are going to set/reset the
+    //      flag on.
+    // -----------------------------------------------------------------------
+    bool        fOld;
+    ReaderMgr*  fMgr;
+};
+
+#endif
diff --git a/src/internal/StdInInputSource.cpp b/src/internal/StdInInputSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..52da33d539b303548f5c30f10109f9cae47e0e5f
--- /dev/null
+++ b/src/internal/StdInInputSource.cpp
@@ -0,0 +1,93 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:15  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:44  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/BinFileInputStream.hpp>
+#include <util/PlatformUtils.hpp>
+#include <internal/StdInInputSource.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  StdInInputSource: Implementation of the input source interface
+// ---------------------------------------------------------------------------
+BinInputStream* StdInInputSource::makeStream() const
+{
+    // Open a binary file stream for the standard input file handle
+    BinFileInputStream* retStream = new BinFileInputStream
+    (
+        XMLPlatformUtils::openStdInHandle()
+    );
+
+    if (!retStream->getIsOpen())
+    {
+        delete retStream;
+        return 0;
+    }
+    return retStream;
+}
diff --git a/src/internal/StdInInputSource.hpp b/src/internal/StdInInputSource.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..ee2a366c005dae78d456264fd36d0395ebf8e698
--- /dev/null
+++ b/src/internal/StdInInputSource.hpp
@@ -0,0 +1,101 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:17  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:44  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+#if !defined(STDININPUTSOURCE_HPP)
+#define STDININPUTSOURCE_HPP
+
+#include <sax/InputSource.hpp>
+
+
+class XMLPARSER_EXPORT StdInInputSource : public InputSource
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    StdInInputSource();
+    ~StdInInputSource();
+
+
+    // -----------------------------------------------------------------------
+    //  Virtual input source interface
+    // -----------------------------------------------------------------------
+    BinInputStream* makeStream() const;
+};
+
+inline StdInInputSource::StdInInputSource() :
+
+    InputSource("stdin")
+{
+}
+
+inline StdInInputSource::~StdInInputSource()
+{
+}
+
+#endif
diff --git a/src/internal/URLInputSource.cpp b/src/internal/URLInputSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..723c3244448e1510d9ab630ded20053a9fbe9c3d
--- /dev/null
+++ b/src/internal/URLInputSource.cpp
@@ -0,0 +1,110 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:18  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:44  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/BinFileInputStream.hpp>
+#include <util/URL.hpp>
+#include <internal/URLInputSource.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  URLInputSource: Constructors and Destructor
+// ---------------------------------------------------------------------------
+URLInputSource::~URLInputSource()
+{
+}
+
+
+// ---------------------------------------------------------------------------
+//  URLInputSource: Implementation of the input source interface
+// ---------------------------------------------------------------------------
+BinInputStream* URLInputSource::makeStream() const
+{
+    // Create a URL for the system id of this input source
+    URL tmpURL;
+    try
+    {
+        tmpURL.setURL(getSystemId());
+    }
+
+    catch(const MalformedURLException&)
+    {
+        // Its not a URL so try a file
+        BinFileInputStream* retStrm = new BinFileInputStream(getSystemId());
+        if (!retStrm->getIsOpen())
+        {
+            delete retStrm;
+            return 0;
+        }
+        return retStrm;
+    }
+
+    // Ask the URL to create us an appropriate input stream
+    return tmpURL.makeNewStream();
+}
diff --git a/src/internal/URLInputSource.hpp b/src/internal/URLInputSource.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..0c9d3f44eb726160461c7409a7e6c2428ccff7cd
--- /dev/null
+++ b/src/internal/URLInputSource.hpp
@@ -0,0 +1,126 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:18  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:44  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+#if !defined(URLINPUTSOURCE_HPP)
+#define URLINPUTSOURCE_HPP
+
+#include <sax/InputSource.hpp>
+
+
+class XMLPARSER_EXPORT URLInputSource : public InputSource
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    URLInputSource(const XMLCh* const systemId);
+    URLInputSource
+    (
+        const   XMLCh* const    systemId
+        , const XMLCh* const    publicId
+    );
+    URLInputSource(const char* const systemId);
+    URLInputSource
+    (
+        const   char* const    systemId
+        , const char* const    publicId
+    );
+    ~URLInputSource();
+
+
+    // -----------------------------------------------------------------------
+    //  Virtual input source interface
+    // -----------------------------------------------------------------------
+    BinInputStream* makeStream() const;
+};
+
+inline URLInputSource::URLInputSource(const XMLCh* const systemId) :
+
+    InputSource(systemId)
+{
+}
+
+inline URLInputSource::URLInputSource(  const   XMLCh* const systemId
+                                        , const XMLCh* const publicId) :
+    InputSource(systemId, publicId)
+{
+}
+
+inline URLInputSource::URLInputSource(const char* const systemId) :
+
+    InputSource(systemId)
+{
+}
+
+inline URLInputSource::URLInputSource(  const   char* const    systemId
+                                        , const char* const    publicId) :
+    InputSource(systemId, publicId)
+{
+}
+
+#endif
diff --git a/src/internal/VecAttrListImpl.cpp b/src/internal/VecAttrListImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..29fca3e2dff992b6e1831b22944e1aabf0bf5f05
--- /dev/null
+++ b/src/internal/VecAttrListImpl.cpp
@@ -0,0 +1,176 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:19  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:44  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <internal/VecAttrListImpl.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  Constructors and Destructor
+// ---------------------------------------------------------------------------
+VecAttrListImpl::VecAttrListImpl() :
+
+    fAdopt(false)
+    , fCount(0)
+    , fVector(0)
+{
+}
+
+VecAttrListImpl::~VecAttrListImpl()
+{
+    //
+    //  Note that some compilers can't deal with the fact that the pointer
+    //  is to a const object, so we have to cast off the const'ness here!
+    //
+    if (fAdopt)
+        delete (RefVectorOf<XMLAttr>*)fVector;
+}
+
+
+// ---------------------------------------------------------------------------
+//  Implementation of the attribute list interface
+// ---------------------------------------------------------------------------
+unsigned int VecAttrListImpl::getLength() const
+{
+    return fCount;
+}
+
+const XMLCh* VecAttrListImpl::getName(const unsigned int index) const
+{
+    if (index >= fCount)
+        ThrowXML(ArrayIndexOutOfBoundsException, XML4CExcepts::AttrList_BadIndex);
+    return fVector->elementAt(index)->getName();
+}
+
+const XMLCh* VecAttrListImpl::getType(const unsigned int index) const
+{
+    if (index >= fCount)
+        ThrowXML(ArrayIndexOutOfBoundsException, XML4CExcepts::AttrList_BadIndex);
+    return XMLAttDef::getAttTypeString(fVector->elementAt(index)->getType());
+}
+
+const XMLCh* VecAttrListImpl::getValue(const unsigned int index) const
+{
+    if (index >= fCount)
+        ThrowXML(ArrayIndexOutOfBoundsException, XML4CExcepts::AttrList_BadIndex);
+    return fVector->elementAt(index)->getValue();
+}
+
+const XMLCh* VecAttrListImpl::getType(const XMLCh* const name) const
+{
+    //
+    //  Search the vector for the attribute with the given name and return
+    //  its type.
+    //
+    for (unsigned int index = 0; index < fCount; index++)
+    {
+        const XMLAttr* curElem = fVector->elementAt(index);
+
+        if (!XMLString::compareString(curElem->getName(), name))
+            return XMLAttDef::getAttTypeString(curElem->getType());
+    }
+    return 0;
+}
+
+const XMLCh* VecAttrListImpl::getValue(const XMLCh* const name) const
+{
+    //
+    //  Search the vector for the attribute with the given name and return
+    //  its type.
+    //
+    for (unsigned int index = 0; index < fCount; index++)
+    {
+        const XMLAttr* curElem = fVector->elementAt(index);
+
+        if (!XMLString::compareString(curElem->getName(), name))
+            return curElem->getValue();
+    }
+    return 0;
+}
+
+
+// ---------------------------------------------------------------------------
+//  Setter methods
+// ---------------------------------------------------------------------------
+void VecAttrListImpl::setVector(const   RefVectorOf<XMLAttr>* const srcVec
+                                , const unsigned int                count
+                                , const bool                        adopt)
+{
+    //
+    //  Delete the previous vector (if any) if we are adopting. Note that some
+    //  compilers can't deal with the fact that the pointer is to a const
+    //  object, so we have to cast off the const'ness here!
+    //
+    if (fAdopt)
+        delete (RefVectorOf<XMLAttr>*)fVector;
+
+    fAdopt = fAdopt;
+    fCount = count;
+    fVector = srcVec;
+}
diff --git a/src/internal/VecAttrListImpl.hpp b/src/internal/VecAttrListImpl.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..ab0579f2f296073a7f7fa150b1c7395e641352f5
--- /dev/null
+++ b/src/internal/VecAttrListImpl.hpp
@@ -0,0 +1,137 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:19  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:45  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(VECATTRLISTIMPL_HPP)
+#define VECATTRLISTIMPL_HPP
+
+#include <sax/AttributeList.hpp>
+#include <framework/XMLAttr.hpp>
+#include <util/RefVectorOf.hpp>
+
+class XMLPARSER_EXPORT VecAttrListImpl : public AttributeList
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    VecAttrListImpl();
+    ~VecAttrListImpl();
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the attribute list interface
+    // -----------------------------------------------------------------------
+    virtual unsigned int getLength() const;
+    virtual const XMLCh* getName(const unsigned int index) const;
+    virtual const XMLCh* getType(const unsigned int index) const;
+    virtual const XMLCh* getValue(const unsigned int index) const;
+    virtual const XMLCh* getType(const XMLCh* const name) const;
+    virtual const XMLCh* getValue(const XMLCh* const name) const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setVector
+    (
+        const   RefVectorOf<XMLAttr>* const srcVec
+        , const unsigned int                count
+        , const bool                        adopt = false
+    );
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    VecAttrListImpl(const VecAttrListImpl&);
+    void operator=(const VecAttrListImpl&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fAdopt
+    //      Indicates whether the passed vector is to be adopted or not. If
+    //      so, we destroy it when we are destroyed (and when a new vector is
+    //      set!)
+    //
+    //  fCount
+    //      The count of elements in the vector that should be considered
+    //      valid. This is an optimization to allow vector elements to be
+    //      reused over and over but a different count of them be valid for
+    //      each use.
+    //
+    //  fVector
+    //      The vector that provides the backing for the list.
+    // -----------------------------------------------------------------------
+    bool                        fAdopt;
+    unsigned int                fCount;
+    const RefVectorOf<XMLAttr>* fVector;
+};
+
+#endif
diff --git a/src/internal/XMLReader.cpp b/src/internal/XMLReader.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e653dba6ef4651320ac83778f3d3e1fbacce6a07
--- /dev/null
+++ b/src/internal/XMLReader.cpp
@@ -0,0 +1,6342 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:20  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:44:45  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/BitOps.hpp>
+#include <util/BinInputStream.hpp>
+#include <util/PlatformUtils.hpp>
+#include <util/RuntimeException.hpp>
+#include <util/TranscodingException.hpp>
+#include <util/TransService.hpp>
+#include <util/UTFDataFormatException.hpp>
+#include <util/XMLString.hpp>
+#include <util/XMLUni.hpp>
+#include <sax/InputSource.hpp>
+#include <internal/CharTypeTables.hpp>
+#include <internal/XMLReader.hpp>
+#include <internal/XMLScanner.hpp>
+#include <framework/XMLBuffer.hpp>
+#include "memory.h"
+
+
+
+// ---------------------------------------------------------------------------
+//  Local const data
+//
+//  gXXXPre
+//      These are binary representations of the ways that '<?xml ' can look
+//      in our base encodings. They are used in the initial decode step below.
+// ---------------------------------------------------------------------------
+static const XMLByte    gEBCDICPre[]    = { 0x4C, 0x6F, 0xA7, 0x94, 0x93, 0x40, 0x20 };
+static const XMLByte    gUCS4BPre[]     = { 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x20 };
+static const XMLByte    gUCS4LPre[]     = { 0x3C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00 };
+static const XMLByte    gUTF16BPre[]    = { 0x00, 0x3C, 0x00, 0x3F, 0x00, 0x78, 0x00, 0x6D, 0x00, 0x6C, 0x00, 0x20 };
+static const XMLByte    gUTF16LPre[]    = { 0x3C, 0x00, 0x3F, 0x00, 0x78, 0x00, 0x6D, 0x00, 0x6C, 0x00, 0x20, 0x00 };
+static const char       gXMLDecl_ASCII[]= { 0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20 };
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Public, static methods
+// ---------------------------------------------------------------------------
+
+//
+//  Checks whether all of the chars in the passed buffer are whitespace or
+//  not. Breaks out on the first non-whitespace.
+//
+bool XMLReader::isAllSpaces(const   XMLCh* const    toCheck
+                            , const unsigned int    count)
+{
+    const XMLCh* curCh = toCheck;
+    const XMLCh* endPtr = toCheck + count;
+    while (curCh < endPtr)
+    {
+        if (!(fgCharCharsTable[*curCh++] & gWhitespaceCharMask))
+            return false;
+    }
+    return true;
+}
+
+
+//
+//  This one is not called terribly often, so its done manually in order
+//  give up more bits in the character characteristics table for more often
+//  used characteristics.
+//
+bool XMLReader::isPublicIdChar(const XMLCh toCheck)
+{
+    return checkTable(gPublicIdChars, toCheck);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Constructors and Destructor
+// ---------------------------------------------------------------------------
+XMLReader::XMLReader(const  XMLCh* const                pubId
+                    , const XMLCh* const                sysId
+                    ,       BinInputStream* const       streamToAdopt
+                    , const RefFrom                     from
+                    , const Types                       type
+                    , const Sources                     source
+                    , const bool                        throwAtEnd) :
+    fCharIndex(0)
+    , fCharsAvail(0)
+    , fCurCol(1)
+    , fCurLine(1)
+    , fEncodingStr(0)
+    , fForcedEncoding(false)
+    , fNoMore(false)
+    , fPublicId(XMLString::replicate(pubId))
+    , fRawBufIndex(0)
+    , fRawBytesAvail(0)
+    , fReaderNum(0xFFFFFFFF)
+    , fRefFrom(from)
+    , fSentTrailingSpace(false)
+    , fSource(source)
+    , fSpareCh(0)
+    , fStream(streamToAdopt)
+    , fSystemId(XMLString::replicate(sysId))
+    , fSwapped(false)
+    , fThrowAtEnd(throwAtEnd)
+    , fTranscoder(0)
+    , fType(type)
+{
+    // Do an initial load of raw bytes
+    refreshRawBuffer();
+
+    //
+    //  Use the recognizer class to get a basic sense of what family of
+    //  encodings this file is in. We'll start off with a reader of that
+    //  type, and update it later if needed when we read the XMLDecl line.
+    //
+    fEncoding = XMLRecognizer::basicEncodingProbe(fRawByteBuf, fRawBytesAvail);
+
+    #if defined(XML4C_DEBUG)
+    if ((fEncoding < XMLRecognizer::Encodings_Min)
+    ||  (fEncoding > XMLRecognizer::Encodings_Max))
+    {
+        ThrowXML(RuntimeException, XML4CExcepts::Reader_BadAutoEncoding);
+    }
+    #endif
+
+    // Check whether the fSwapped flag should be set or not
+    checkForSwapped();
+
+    //
+    //  If the encoding is EBCDIC, then we have to do some special
+    //  preliminary work to create a converter and to do an initial
+    //  trancoding of the first line. We create a default EBCDIC transcoder
+    //  that should get us through the first line at least.
+    //
+    if (fEncoding == XMLRecognizer::EBCDIC)
+    {
+        //
+        //  Set the encoding string provisionally to the default EBCDIC
+        //  encoding string. This might have to be updated later when/if the
+        //  setEncoding() method gets called.
+        //
+        fEncodingStr = XMLString::replicate(XMLUni::fgDefaultEBCDICEncodingString);
+
+        XMLTransService::Codes failReason;
+        fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor
+        (
+            fEncodingStr
+            , failReason
+            , kCharBufSize
+        );
+
+        if (!fTranscoder)
+            ThrowXML1(RuntimeException, XML4CExcepts::Reader_CantCreateCvtrFor, fEncodingStr);
+    }
+     else
+    {
+        //
+        //  Set the encoding string provisionally to the auto-sense encoding
+        //  that we we given. This might have to be updated later when/if the
+        //  setEncoding() method gets called.
+        //
+        fEncodingStr = XMLString::replicate
+        (
+            XMLRecognizer::nameForEncoding(fEncoding)
+        );
+    }
+
+    //
+    //  This will check to see if the first line is an XMLDecl and if
+    //  so decode that first line manually one character at a time. This
+    //  leave enough characters in the buffer that the high level code
+    //  can get through the Decl and call us back with the real encoding.
+    //
+    doInitDecode();
+}
+
+
+XMLReader::XMLReader(const  XMLCh* const            pubId
+                    , const XMLCh* const            sysId
+                    ,       BinInputStream* const   streamToAdopt
+                    , const XMLCh* const            encodingStr
+                    , const RefFrom                 from
+                    , const Types                   type
+                    , const Sources                 source
+                    , const bool                    throwAtEnd) :
+    fCharIndex(0)
+    , fCharsAvail(0)
+    , fCurCol(1)
+    , fCurLine(1)
+    , fEncoding(XMLRecognizer::UTF_8)
+    , fEncodingStr(0)
+    , fForcedEncoding(true)
+    , fNoMore(false)
+    , fPublicId(XMLString::replicate(pubId))
+    , fRawBufIndex(0)
+    , fRawBytesAvail(0)
+    , fReaderNum(0xFFFFFFFF)
+    , fRefFrom(from)
+    , fSentTrailingSpace(false)
+    , fSource(source)
+    , fSpareCh(0)
+    , fStream(streamToAdopt)
+    , fSystemId(XMLString::replicate(sysId))
+    , fSwapped(false)
+    , fThrowAtEnd(throwAtEnd)
+    , fTranscoder(0)
+    , fType(type)
+{
+    // Copy the encoding string to our member
+    fEncodingStr = XMLString::replicate(encodingStr);
+
+    //
+    //  Map the passed encoding name to one of our enums. If it does not
+    //  match one of the intrinsic encodings, it will come back 'other',
+    //  which tells us to create a transcoder based reader.
+    //
+    fEncoding = XMLRecognizer::encodingForName(fEncodingStr);
+    if (fEncoding == XMLRecognizer::OtherEncoding)
+    {
+        XMLTransService::Codes failReason;
+        fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor
+        (
+            fEncodingStr
+            , failReason
+            , kCharBufSize
+        );
+
+        if (!fTranscoder)
+            ThrowXML1(RuntimeException, XML4CExcepts::Reader_CantCreateCvtrFor, fEncodingStr);
+    }
+     else
+    {
+        // Check whether the fSwapped flag should be set or not
+        checkForSwapped();
+    }
+
+    // Do an initial load of raw bytes
+    refreshRawBuffer();
+
+    //
+    //  Note that, unlike above, we do not do an initial decode of the
+    //  first line. We take the caller's word that the encoding is correct
+    //  and just assume that the first bulk decode (kicked off by the first
+    //  get of a character) will work.
+    //
+    //  So we do here the slipping in of the leading space if required.
+    //
+    if ((fType == Type_PE) && (fRefFrom == RefFrom_NonLiteral))
+        fCharBuf[fCharsAvail++] = chSpace;
+}
+
+
+XMLReader::~XMLReader()
+{
+    delete [] fEncodingStr;
+    delete [] fPublicId;
+    delete [] fSystemId;
+    delete fStream;
+    delete fTranscoder;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Character buffer management methods
+// ---------------------------------------------------------------------------
+bool XMLReader::refreshCharBuffer()
+{
+    // If the no more flag is set, then don't both doing anything
+    if (fNoMore)
+        return false;
+
+    // See if we have any existing chars.
+    const unsigned int spareChars = fCharsAvail - fCharIndex;
+
+    // If we are full, then don't do anything.
+    if (spareChars == kCharBufSize)
+        return false;
+
+    // If there are spare chars, then move then down to the bottom
+    unsigned int startInd = 0;
+    if (spareChars)
+    {
+        for (unsigned int index = fCharIndex; index < fCharsAvail; index++)
+            fCharBuf[startInd++] = fCharBuf[index];
+    }
+
+    //
+    //  And then get more chars, starting after any spare chars that were
+    //  left over from the last time.
+    //
+    fCharsAvail = xcodeMoreChars(&fCharBuf[startInd], kCharBufSize - spareChars);
+
+    // Add back in the spare chars
+    fCharsAvail += spareChars;
+
+    // Reset the buffer index to zero, so we start from the 0th char again
+    fCharIndex = 0;
+
+    //
+    //  If no chars available, then we have to check for one last thing. If
+    //  this is reader for a PE and its not being expanded inside a literal,
+    //  then unget a trailing space. We use a boolean to avoid triggering
+    //  this more than once.
+    //
+    if (!fCharsAvail
+    &&  (fType == Type_PE)
+    &&  (fRefFrom == RefFrom_NonLiteral)
+    &&  !fSentTrailingSpace)
+    {
+        fCharBuf[0] = chSpace;
+        fCharsAvail = 1;
+        fSentTrailingSpace = true;
+    }
+
+    //
+    //  If we are on our first block of chars and the encoding is one of the
+    //  UTF-16 formats, then check the first char for the BOM and skip over
+    //  it manually.
+    //
+    if ((fCurLine == 1) && (fCurCol == 1))
+    {
+        if (((fEncoding == XMLRecognizer::UTF_16L)
+        ||   (fEncoding == XMLRecognizer::UTF_16B))
+        &&  !startInd
+        &&  fCharsAvail)
+        {
+            if ((fCharBuf[startInd] == chUnicodeMarker)
+            ||  (fCharBuf[startInd] == chSwappedUnicodeMarker))
+            {
+                XMLCh chTmp;
+                getNextChar(chTmp);
+            }
+        }
+    }
+
+    //
+    //  If we get here with no more chars, then set the fNoMore flag which
+    //  lets us optimize and know without checking that no more chars are
+    //  available.
+    //
+    if (!fCharsAvail)
+        fNoMore = true;
+
+    return (fCharsAvail != 0);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Scanning methods
+// ---------------------------------------------------------------------------
+XMLCh XMLReader::getCharData(   XMLBuffer&      toFill
+                                , XMLScanner&   owningScanner
+                                , bool&         gotLeadingSurrogate)
+{
+    //
+    //  Ok, lets loop through the chars in the buffer until we eat them up
+    //  and then reload and try again.
+    //
+    while (true)
+    {
+        while (fCharIndex < fCharsAvail)
+        {
+            // Peek the next char from the buffer, but don't eat it yet
+            XMLCh nextCh = fCharBuf[fCharIndex];
+
+            //
+            //  Ok, lets check whether its a special character data char.
+            //  If not, then we handle it here. Else we break out and let
+            //  the caller handle it.
+            //
+            if (!XMLReader::isSpecialCharDataChar(nextCh))
+            {
+                // Eat this one
+                fCharIndex++;
+
+                // Deal with surrogate pairs
+                if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF))
+                {
+                    //
+                    //  Its a leading surrogate. If we already got one, then
+                    //  issue an error, else set leading flag to make sure that
+                    //  we look for a trailing next time.
+                    //
+                    if (gotLeadingSurrogate)
+                        owningScanner.emitError(XML4CErrs::Expected2ndSurrogateChar);
+                    else
+                        gotLeadingSurrogate = true;
+                }
+                 else
+                {
+                    //
+                    //  If its a trailing surrogate, make sure that we are
+                    //  prepared for that. Else, its just a regular char so make
+                    //  sure that we were not expected a trailing surrogate.
+                    //
+                    if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF))
+                    {
+                        // Its trailing, so make sure we were expecting it
+                        if (!gotLeadingSurrogate)
+                            owningScanner.emitError(XML4CErrs::Unexpected2ndSurrogateChar);
+                    }
+                     else
+                    {
+                        //
+                        //  Its just a char, so make sure we were not expecting a
+                        //  trailing surrogate.
+                        //
+                        if (gotLeadingSurrogate)
+                            owningScanner.emitError(XML4CErrs::Expected2ndSurrogateChar);
+
+                        // Check for valid characters here
+                        if (!XMLReader::isXMLChar(nextCh))
+                            owningScanner.emitError(XML4CErrs::InvalidCharacter);
+                    }
+                    gotLeadingSurrogate = false;
+                }
+
+                //
+                //  Keep the line and column info up to date and do new
+                //  line normalization.
+                //
+                if (nextCh == chCR)
+                {
+                    fCurLine++;
+                    fCurCol = 1;
+
+                    if (fSource == Source_External)
+                    {
+                        if (fCharIndex < fCharsAvail)
+                        {
+                            if (fCharBuf[fCharIndex] == chLF)
+                                fCharIndex++;
+                        }
+                         else
+                        {
+                            if (refreshCharBuffer())
+                            {
+                                if (fCharBuf[fCharIndex] == chLF)
+                                    fCharIndex++;
+                            }
+                        }
+                        nextCh = chLF;
+                    }
+                }
+                 else if (nextCh == chLF)
+                {
+                    fCurLine++;
+                    fCurCol = 1;
+                }
+                 else
+                {
+                    fCurCol++;
+                }
+
+                // Add the (possibly normalized) char to the buffer and go again
+                toFill.append(nextCh);
+            }
+             else
+            {
+                return nextCh;
+            }
+        }
+
+        // We've used up the current buffer so try to get more
+        if (!refreshCharBuffer())
+            break;
+    }
+
+    // We ate up all this reader's data
+    return chNull;
+}
+
+
+bool XMLReader::getName(XMLBuffer& toFill, const bool token)
+{
+    //
+    //  Ok, first lets see if we have chars in the buffer. If not, then lets
+    //  reload.
+    //
+    if (fCharIndex == fCharsAvail)
+    {
+        if (!refreshCharBuffer())
+            return false;
+    }
+
+    //
+    //  Lets check the first char for being a first name char. If not, then
+    //  what's the point in living mannnn? Just give up now. We only do this
+    //  if its a name and not a name token that they want.
+    //
+    if (!token)
+    {
+        if (!XMLReader::isFirstNameChar(fCharBuf[fCharIndex]))
+            return false;
+
+        // Looks ok, so lets eat it and put it in our buffer. Update column also!
+        toFill.append(fCharBuf[fCharIndex++]);
+        fCurCol++;
+    }
+
+    //
+    //  And now we loop until we run out of data in this reader or we hit
+    //  a non-name char.
+    //
+    bool moreChars = true;
+    while (moreChars)
+    {
+        while (fCharIndex < fCharsAvail)
+        {
+            const XMLCh curCh = fCharBuf[fCharIndex];
+
+            //
+            //  Check the current char and take it if its a name char. Else
+            //  break out.
+            //
+            if (!XMLReader::isNameChar(curCh))
+            {
+                moreChars = false;
+                return !toFill.isEmpty();
+            }
+
+            toFill.append(curCh);
+            fCurCol++;
+            fCharIndex++;
+        }
+
+        // If we don't get no more, then break out.
+        if (!refreshCharBuffer())
+            break;
+    }
+    return !toFill.isEmpty();
+}
+
+bool XMLReader::getNextChar(XMLCh& chGotten)
+{
+    //
+    //  See if there is at least a char in the buffer. Else, do the buffer
+    //  reload logic.
+    //
+    if (fCharIndex < fCharsAvail)
+    {
+        chGotten = fCharBuf[fCharIndex++];
+    }
+     else
+    {
+        // If fNoMore is set, then we have nothing else to give
+        if (fNoMore)
+        {
+            chGotten = XMLCh(0);
+            return false;
+        }
+
+        // If the buffer is empty, then try to refresh
+        if (fCharIndex == fCharsAvail)
+        {
+            if (!refreshCharBuffer())
+            {
+                // <TBD> removed the space after PE logic here, do somethign
+
+                // If still empty, then return a zero char
+                if (fCharIndex == fCharsAvail)
+                {
+                    chGotten = XMLCh(0);
+                    return false;
+                }
+            }
+        }
+
+        chGotten = fCharBuf[fCharIndex++];
+    }
+
+    // Handle end of line normalization and line/col member maintenance.
+    if (chGotten == chCR)
+    {
+        //
+        //  Do the normalization. We return chLF regardless of which was
+        //  found. We also eat a chCR followed by an chLF.
+        //
+        //  We only do this if the content being spooled is not already
+        //  internalized.
+        //
+        if (fSource == Source_External)
+        {
+            //
+            //  See if we have another char left. If not, don't bother.
+            //  Else, see if its an chLF to eat. If it is, bump the
+            //  index again.
+            //
+            if (fCharIndex < fCharsAvail)
+            {
+                if (fCharBuf[fCharIndex] == chLF)
+                    fCharIndex++;
+            }
+             else
+            {
+                if (refreshCharBuffer())
+                {
+                    if (fCharBuf[fCharIndex] == chLF)
+                        fCharIndex++;
+                }
+            }
+
+            // And return just an chLF
+            chGotten = chLF;
+        }
+
+        // And handle the line/col stuff
+        fCurCol = 1;
+        fCurLine++;
+    }
+     else if (chGotten == chLF)
+    {
+        fCurLine++;
+        fCurCol = 1;
+    }
+     else if (chGotten)
+    {
+        //
+        //  Only do this is not a null char. Null chars are not part of the
+        //  real content. They are just marker characters inserted into
+        //  the stream.
+        //
+        fCurCol++;
+    }
+    return true;
+}
+
+
+bool XMLReader::getSpaces(XMLBuffer& toFill)
+{
+    //
+    //  We just loop until we either hit a non-space or the end of this
+    //  entity. We return true if we returned because of a non-space and
+    //  false if because of end of entity.
+    //
+    //  NOTE:   We have to maintain line/col info here and we have to do
+    //          whitespace normalization if we are not already internalized.
+    //
+    while (true)
+    {
+        // Loop through the current chars in the buffer
+        while (fCharIndex < fCharsAvail)
+        {
+            // Get the current char out of the buffer
+            XMLCh curCh = fCharBuf[fCharIndex];
+
+            //
+            //  See if its a white space char. If so, then process it. Else
+            //  we've hit a non-space and need to return.
+            //
+            if (XMLReader::isWhitespace(curCh))
+            {
+                // Eat this char
+                fCharIndex++;
+
+                //
+                //  Ok, we've got some whitespace here. So we have to store
+                //  it. But we have to normalize it and update the line and
+                //  column info along the way.
+                //
+                if (curCh == chCR)
+                {
+                    fCurCol = 1;
+                    fCurLine++;
+
+                    //
+                    //  If not already internalized, then convert it to an
+                    //  LF and eat any following LF.
+                    //
+                    if (fSource == Source_External)
+                    {
+                        if (fCharIndex < fCharsAvail)
+                        {
+                            if (fCharBuf[fCharIndex] == chLF)
+                                fCharIndex++;
+                        }
+                         else
+                        {
+                            if (refreshCharBuffer())
+                            {
+                                if (fCharBuf[fCharIndex] == chLF)
+                                    fCharIndex++;
+                            }
+                        }
+                        curCh = chLF;
+                    }
+                }
+                 else if (curCh == chLF)
+                {
+                    fCurCol = 1;
+                    fCurLine++;
+                }
+                 else
+                {
+                    fCurCol++;
+                }
+
+                // Ok we can add this guy to our buffer
+                toFill.append(curCh);
+            }
+             else
+            {
+                // Return true to indicate we broke out due to a whitespace
+                return true;
+            }
+        }
+
+        //
+        //  We've eaten up the current buffer, so lets try to reload it. If
+        //  we don't get anything new, then break out. If we do, then we go
+        //  back to the top to keep getting spaces.
+        //
+        if (!refreshCharBuffer())
+            break;
+    }
+    return false;
+}
+
+
+bool XMLReader::getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck)
+{
+    while (true)
+    {
+        // Loop through the current chars in the buffer
+        while (fCharIndex < fCharsAvail)
+        {
+            // Get the current char out of the buffer
+            XMLCh curCh = fCharBuf[fCharIndex];
+
+            //
+            //  See if its not a white space or our target char, then process
+            //  it. Else, we need to return.
+            //
+            if (!XMLReader::isWhitespace(curCh) && (curCh != toCheck))
+            {
+                // Eat this char
+                fCharIndex++;
+
+                //
+                //  Ok, we've got some whitespace here. So we have to store
+                //  it. But we have to normalize it and update the line and
+                //  column info along the way.
+                //
+                if (curCh == chCR)
+                {
+                    fCurCol = 1;
+                    fCurLine++;
+
+                    //
+                    //  If not already internalized, then convert it to an
+                    //  LF and eat any following LF.
+                    //
+                    if (fSource == Source_External)
+                    {
+                        if (fCharIndex < fCharsAvail)
+                        {
+                            if (fCharBuf[fCharIndex] == chLF)
+                                fCharIndex++;
+                        }
+                         else
+                        {
+                            if (refreshCharBuffer())
+                            {
+                                if (fCharBuf[fCharIndex] == chLF)
+                                    fCharIndex++;
+                            }
+                        }
+                        curCh = chLF;
+                    }
+                }
+                 else if (curCh == chLF)
+                {
+                    fCurCol = 1;
+                    fCurLine++;
+                }
+                 else
+                {
+                    fCurCol++;
+                }
+
+                // Add it to our buffer
+                toFill.append(curCh);
+            }
+             else
+            {
+                return true;
+            }
+        }
+
+        //
+        //  We've eaten up the current buffer, so lets try to reload it. If
+        //  we don't get anything new, then break out. If we do, then we go
+        //  back to the top to keep getting spaces.
+        //
+        if (!refreshCharBuffer())
+            break;
+    }
+
+    // We never hit any non-space and ate up the whole reader
+    return false;
+    
+}
+
+
+bool XMLReader::peekNextChar(XMLCh& chGotten)
+{
+    //
+    //  If there is something still in the buffer, get it. Else do the reload
+    //  scenario.
+    //
+    if (fCharIndex < fCharsAvail)
+    {
+        chGotten = fCharBuf[fCharIndex];
+    }
+     else
+    {
+        // Try to refresh the buffer
+        if (!refreshCharBuffer())
+        {
+            chGotten = chNull;
+            return false;
+        }
+        chGotten = fCharBuf[fCharIndex];
+    }
+
+    //
+    //  Even though we are only peeking, we have to act the same as the
+    //  normal char get method in regards to newline normalization, though
+    //  its not as complicated as the actual character getting method's.
+    //
+    if ((fSource == Source_External) && (chGotten == chCR))
+        chGotten = chLF;
+
+    return true;
+}
+
+
+bool XMLReader::skipIfQuote(XMLCh& chGotten)
+{
+    if (fCharIndex == fCharsAvail)
+    {
+        if (!refreshCharBuffer())
+            return false;
+    }
+
+    const XMLCh curCh = fCharBuf[fCharIndex];
+    if ((curCh == chDoubleQuote) || (curCh == chSingleQuote))
+    {
+        chGotten = curCh;
+        fCharIndex++;
+        fCurCol++;
+        return true;
+    }
+    return false;
+}
+
+
+bool XMLReader::skipSpaces(bool& skippedSomething)
+{
+    // Remember the current line and column
+    unsigned int    orgLine = fCurLine;
+    unsigned int    orgCol  = fCurCol;
+
+    //
+    //  We enter a loop where we skip over spaces until we hit the end of
+    //  this reader or a non-space value. The return indicates whether we
+    //  hit the non-space (true) or the end (false).
+    //
+    while (true)
+    {
+        // Loop through the current chars in the buffer
+        while (fCharIndex < fCharsAvail)
+        {
+            // Get the current char out of the buffer
+            XMLCh curCh = fCharBuf[fCharIndex];
+
+            //
+            //  See if its a white space char. If so, then process it. Else
+            //  we've hit a non-space and need to return.
+            //
+            if (XMLReader::isWhitespace(curCh))
+            {
+                // Eat this char
+                fCharIndex++;
+
+                //
+                //  Ok, we've got some whitespace here. So we have to store
+                //  it. But we have to normalize it and update the line and
+                //  column info along the way.
+                //
+                if (curCh == chCR)
+                {
+                    fCurCol = 1;
+                    fCurLine++;
+
+                    //
+                    //  If not already internalized, then convert it to an
+                    //  LF and eat any following LF.
+                    //
+                    if (fSource == Source_External)
+                    {
+                        if (fCharIndex < fCharsAvail)
+                        {
+                            if (fCharBuf[fCharIndex] == chLF)
+                                fCharIndex++;
+                        }
+                         else
+                        {
+                            if (refreshCharBuffer())
+                            {
+                                if (fCharBuf[fCharIndex] == chLF)
+                                    fCharIndex++;
+                            }
+                        }
+                        curCh = chLF;
+                    }
+                }
+                 else if (curCh == chLF)
+                {
+                    fCurCol = 1;
+                    fCurLine++;
+                }
+                 else
+                {
+                    fCurCol++;
+                }
+            }
+             else
+            {
+                skippedSomething = (orgLine != fCurLine) || (orgCol != fCurCol);
+                return true;
+            }
+        }
+
+        //
+        //  We've eaten up the current buffer, so lets try to reload it. If
+        //  we don't get anything new, then break out. If we do, then we go
+        //  back to the top to keep getting spaces.
+        //
+        if (!refreshCharBuffer())
+            break;
+    }
+
+    // We never hit any non-space and ate up the whole reader
+    skippedSomething = (orgLine != fCurLine) || (orgCol != fCurCol);
+    return false;
+}
+
+
+bool XMLReader::skippedChar(const XMLCh toSkip)
+{
+    //
+    //  If the buffer is empty, then try to reload it. If we still get
+    //  nothing, then return false.
+    //
+    if (fCharIndex == fCharsAvail)
+    {
+        if (!refreshCharBuffer())
+            return false;
+    }
+
+    //
+    //  See if the current char is the one we want. If so, then we need
+    //  to eat it and return true.
+    //
+    if (fCharBuf[fCharIndex] == toSkip)
+    {
+        fCharIndex++;
+        fCurCol++;
+        return true;
+    }
+    return false;
+}
+
+
+bool XMLReader::skippedSpace()
+{
+    //
+    //  If the buffer is empty, then try to reload it. If we still get
+    //  nothing, then return false.
+    //
+    if (fCharIndex == fCharsAvail)
+    {
+        if (!refreshCharBuffer())
+            return false;
+    }
+
+    //
+    //  See if the current char is a whitespace. If so, then we need to eat
+    //  it and return true.
+    //
+    const XMLCh curCh = fCharBuf[fCharIndex];
+    if (XMLReader::isWhitespace(curCh))
+    {
+        // Eat the character
+        fCharIndex++;
+
+        if (curCh == chCR)
+        {
+            fCurLine++;
+            fCurCol = 1;
+
+            if (fSource == Source_External)
+            {
+                if (fCharIndex < fCharsAvail)
+                {
+                    if (fCharBuf[fCharIndex] == chLF)
+                        fCharIndex++;
+                }
+                 else
+                {
+                    if (refreshCharBuffer())
+                    {
+                        if (fCharBuf[fCharIndex] == chLF)
+                            fCharIndex++;
+                    }
+                }
+            }
+        }
+         else if (curCh == chLF)
+        {
+            fCurLine++;
+            fCurCol = 1;
+        }
+         else
+        {
+            fCurCol++;
+        }
+        return true;
+    }
+    return false;
+}
+
+
+bool XMLReader::skippedString(const XMLCh* const toSkip)
+{
+    // Get the length of the string to skip
+    const unsigned int srcLen = XMLString::stringLen(toSkip);
+
+    //
+    //  See if the current reader has enough chars to test against this
+    //  string. If not, then ask it to reload its buffer. If that does not
+    //  get us enough, then it cannot match.
+    //
+    //  NOTE: This works because strings never have to cross a reader! And
+    //  a string to skip will never have a new line in it, so we will never
+    //  miss adjusting the current line.
+    //
+    if (charsLeftInBuffer() < srcLen)
+    {
+        refreshCharBuffer();
+
+        // Did we get enough chars to handle it yet?
+        if (charsLeftInBuffer() < srcLen)
+            return false;
+    }
+
+    //
+    //  Ok, now we now that the current reader has enough chars in its
+    //  buffer and that its index is back at zero. So we can do a quick and
+    //  dirty comparison straight to its buffer with no requirement to unget
+    //  if it fails.
+    //
+    if (XMLString::compareNString(&fCharBuf[fCharIndex], toSkip, srcLen))
+        return false;
+
+    // Add the source length to the current column to get it back right
+    fCurCol += srcLen;
+
+    //
+    //  And get the character buffer index back right by just adding the
+    //  source len to it.
+    //
+    fCharIndex += srcLen;
+
+    return true;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Setter methods (most are inlined)
+// ---------------------------------------------------------------------------
+bool XMLReader::setEncoding(const XMLCh* const newEncoding)
+{
+    //
+    //  If the encoding was forced, then we ignore the new value and just
+    //  return with success. If it was forced, then we are to use that
+    //  encoding without question.
+    //
+    if (fForcedEncoding)
+        return true;
+
+    // Store the new encoding string, getting rid of the old one
+    delete [] fEncodingStr;
+    fEncodingStr = XMLString::replicate(newEncoding);
+
+    //
+    //  Try to map the string to one of our standard encodings. If its not
+    //  one of them, then it has to be one of the transcoder based encodings.
+    //  So we just create a transcoder (cleaning up any existing one) and
+    //  return success.
+    //
+    const XMLRecognizer::Encodings theEncoding = XMLRecognizer::encodingForName
+    (
+        fEncodingStr
+    );
+
+    //
+    //  If it comes back 'other', then we need to check a couple of special
+    //  cases.
+    //
+    if (theEncoding == XMLRecognizer::OtherEncoding)
+    {
+        //
+        //  Check for non-endian specific UTF-16 or UCS-2. If so, and if we
+        //  are already in one of the UTF-16 encodings, then just keep it
+        //  and go on. Otherwise, its not valid.
+        //
+        //  <TBD> Check for USC-2 here as well!
+        //
+        if (!XMLString::compareIString(fEncodingStr, XMLUni::fgUTF16EncodingString))
+        {
+            if ((fEncoding != XMLRecognizer::UTF_16L)
+            &&  (fEncoding != XMLRecognizer::UTF_16B))
+            {
+                return false;
+            }
+            return true;
+        }
+         else if (!XMLString::compareIString(fEncodingStr, XMLUni::fgUCS4EncodingString))
+        {
+            if ((fEncoding != XMLRecognizer::UCS_4L)
+            &&  (fEncoding != XMLRecognizer::UCS_4B))
+            {
+                return false;
+            }
+            return true;
+        }
+    }
+
+    //
+    //  If the encoding is some non-intrinsic one, then we need to create
+    //  a transcoder, getting rid of any previous one we had. If its not
+    //  'other', then we have to make sure that its a legal transition.
+    //
+    if (theEncoding == XMLRecognizer::OtherEncoding)
+    {
+        if (fTranscoder)
+        {
+            delete fTranscoder;
+            fTranscoder = 0;
+        }
+
+        XMLTransService::Codes failReason;
+        fTranscoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor
+        (
+            fEncodingStr
+            , failReason
+            , kCharBufSize
+        );
+
+        if (!fTranscoder)
+            ThrowXML1(RuntimeException, XML4CExcepts::Reader_CantCreateCvtrFor, fEncodingStr);
+
+        // Store the new encoding and return success
+        fEncoding = theEncoding;
+        return true;
+    }
+
+    //
+    //  We handled the special case of moving from an intrinsic initial
+    //  autosensed encoding to a transoder based one, or form one transcoder
+    //  based one to another. Now, lets handle any reasonable moves within
+    //  the intrinsic ones, of which there are few.
+    //
+    if ((fEncoding == XMLRecognizer::UTF_8)
+    &&  (theEncoding == XMLRecognizer::US_ASCII))
+    {
+        //
+        //  It is legal for us to move to US-ASCII from UTF-8, since UTF-8
+        //  was what we would have auto-sensed. This will make us use the
+        //  more efficient transcoding loop.
+        //
+        fEncoding = XMLRecognizer::US_ASCII;
+    }
+     else if (fEncoding != theEncoding)
+    {
+        //
+        //  If the new encoding we got is not the same as what we
+        //  auto-sensed then its an error at this point, because this cannot
+        //  happen. It has to be an an incorrect encoding string in the file,
+        //  which does not match what the file is actually in.
+        //
+        return false;
+    }
+
+    // Otherwise, just return success
+    return true;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Private static init methods
+// ---------------------------------------------------------------------------
+bool XMLReader::checkTable( const   XMLCh* const    theTable
+                            , const XMLCh           toCheck)
+{
+    const XMLCh* curTable = theTable;
+
+    // Check the ranges
+    while (*curTable)
+    {
+        //
+        //  If the test char is less than the low range, then its never
+        //  going to match any other range, so break out. But we have to
+        //  run up to the range terminator first.
+        //
+        if (toCheck < *curTable++)
+        {
+            while (*curTable++)
+            {
+                // Purposefully empty, we are just running up the pointer
+            }
+            break;
+        }
+
+        // If its less than or equal to the top of the range, then a match
+        if (toCheck <= *curTable++)
+            return true;
+    }
+
+    // And now test against singles
+    while (*curTable)
+    {
+        if (toCheck == *curTable++)
+            return true;
+    }
+    return false;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Private helper methods
+// ---------------------------------------------------------------------------
+
+//
+//  This is called when the encoding flag is set and just sets the fSwapped
+//  flag appropriately.
+//
+void XMLReader::checkForSwapped()
+{
+    // Assume not swapped
+    fSwapped = false;
+
+    #if defined(ENDIANMODE_LITTLE)
+
+        if ((fEncoding == XMLRecognizer::UTF_16B)
+        ||  (fEncoding == XMLRecognizer::UCS_4B))
+        {
+            fSwapped = true;
+        }
+
+    #elif defined(ENDIANMODE_BIG)
+
+        if ((fEncoding == XMLRecognizer::UTF_16L)
+        ||  (fEncoding == XMLRecognizer::UCS_4L))
+        {
+            fSwapped = true;
+        }
+
+    #endif
+}
+
+
+void XMLReader::doInitDecode()
+{
+    switch(fEncoding)
+    {
+        case XMLRecognizer::UCS_4B :
+        case XMLRecognizer::UCS_4L :
+        {
+            //
+            //  If there is a decl here, we just truncate back the characters
+            //  as we go. No surrogate creation would be allowed here in legal
+            //  XML, so we consider it a transoding error if we find one.
+            //
+            //  First check that there are enough raw bytes for there to even
+            //  be a decl indentifier. If not, then nothing to do.
+            //
+            if (fRawBytesAvail < sizeof(gUCS4BPre))
+                break;
+
+            //
+            //  See we get a match on the prefix. If not, then just break out
+            //  since we don't have a Decl.
+            //
+            if (fEncoding == XMLRecognizer::UCS_4B)
+            {
+                if (memcmp(fRawByteBuf, gUCS4BPre, sizeof(gUCS4BPre)))
+                    break;
+            }
+             else
+            {
+                if (memcmp(fRawByteBuf, gUCS4LPre, sizeof(gUCS4LPre)))
+                    break;
+            }
+
+            // Look at the raw buffer as UCS4 chars
+            const UCS4Ch* asUCS = (const UCS4Ch*)fRawByteBuf;
+
+            while (fRawBufIndex < fRawBytesAvail)
+            {
+                // Get out the current 4 byte value and inc our raw buf index
+                UCS4Ch curVal = *asUCS++;
+                fRawBufIndex += sizeof(UCS4Ch);
+
+                // Swap if that is required for this machine
+                if (fSwapped)
+                    curVal = BitOps::swapBytes(curVal);
+
+                // Make sure its at least semi legal. If not, undo and throw
+                if (curVal > 0xFFFF)
+                {
+                    fCharsAvail = 0;
+                    fRawBufIndex = 0;
+                    ThrowXML1
+                    (
+                        TranscodingException
+                        , XML4CExcepts::Reader_CouldNotDecodeFirstLine
+                        , fSystemId
+                    );
+                }
+
+                // Convert the value to an XML char and store it
+                fCharBuf[fCharsAvail++] = XMLCh(curVal);
+
+                // Break out on the > character
+                if (curVal == chCloseAngle)
+                    break;
+            }
+            break;
+        }
+
+        case XMLRecognizer::US_ASCII :
+        case XMLRecognizer::UTF_8 :
+        {
+            // Look at the raw buffer as short chars
+            const char* asChars = (const char*)fRawByteBuf;
+
+            //
+            //  First check that there are enough bytes to even see the
+            //  decl indentifier. If not, get out now with no action since
+            //  there is no decl.
+            //
+            if (fRawBytesAvail < sizeof(gXMLDecl_ASCII))
+                break;
+
+            // Check for the opening sequence. If not, then no decl
+            if (XMLString::compareNString(asChars, gXMLDecl_ASCII, sizeof(gXMLDecl_ASCII)))
+                break;
+
+            while (fRawBufIndex < fRawBytesAvail)
+            {
+                const char curCh = *asChars++;
+                fRawBufIndex++;
+
+                // Looks ok, so store it
+                fCharBuf[fCharsAvail++] = XMLCh(curCh);
+
+                // Break out on a > character
+                if (curCh == chCloseAngle)
+                    break;
+
+                //
+                //  A char greater than 0x7F is not allowed in this case. If
+                //  so, undo and throw.
+                //
+                if (curCh > 0x7F)
+                {
+                    fCharsAvail = 0;
+                    fRawBufIndex = 0;
+                    ThrowXML1
+                    (
+                        TranscodingException
+                        , XML4CExcepts::Reader_CouldNotDecodeFirstLine
+                        , fSystemId
+                    );
+                }
+            }
+            break;
+        }
+
+        case XMLRecognizer::UTF_16B :
+        case XMLRecognizer::UTF_16L :
+        {
+            //
+            //  If there is a decl here, we just truncate back the characters
+            //  as we go. No surrogate creation would be allowed here in legal
+            //  XML, so we consider it a transoding error if we find one.
+            //
+            if (fRawBytesAvail < 2)
+                break;
+
+            const UTF16Ch* asUTF16 = (const UTF16Ch*)&fRawByteBuf[fRawBufIndex];
+            if ((*asUTF16 == chUnicodeMarker) || (*asUTF16 == chSwappedUnicodeMarker))
+            {
+                fRawBufIndex += sizeof(UTF16Ch);
+                asUTF16++;
+            }
+
+            //  First check that there are enough raw bytes for there to even
+            //  be a decl indentifier. If not, then nothing to do. 
+            //
+            if (fRawBytesAvail - fRawBufIndex < sizeof(gUTF16BPre))
+            {
+                fRawBufIndex = 0;
+                break;
+            }
+
+            //
+            //  See we get a match on the prefix. If not, then reset and
+            //  break out.
+            //
+            if (fEncoding == XMLRecognizer::UTF_16B)
+            {
+                if (memcmp(asUTF16, gUTF16BPre, sizeof(gUTF16BPre)))
+                {
+                    fRawBufIndex = 0;
+                    break;
+                }
+            }
+             else
+            {
+                if (memcmp(asUTF16, gUTF16LPre, sizeof(gUTF16LPre)))
+                {
+                    fRawBufIndex = 0;
+                    break;
+                }
+            }
+
+            while (fRawBufIndex < fRawBytesAvail)
+            {
+                // Get out the current 2 byte value
+                UTF16Ch curVal = *asUTF16++;
+                fRawBufIndex += sizeof(UTF16Ch);
+
+                // Swap if that is required for this machine
+                if (fSwapped)
+                    curVal = BitOps::swapBytes(curVal);
+
+                //
+                //  Store it and bump the target index, implicitly converting
+                //  if UTF16Ch and XMLCh are not the same size.
+                //
+                fCharBuf[fCharsAvail++] = curVal;
+
+                // Break out on a > char
+                if (curVal == chCloseAngle)
+                    break;
+            }
+            break;
+        }
+
+        default :
+        {
+            // If not enough bytes to even check for decl, then done
+            if (fRawBytesAvail < sizeof(gEBCDICPre))
+                break;
+
+            // If not the EBCDIC prefix, then done
+            if (memcmp(fRawByteBuf, gEBCDICPre, sizeof(gEBCDICPre)))
+                break;
+
+            //
+            //  Ok, looks reasonable, so lets use the transcoder to get through
+            //  to the first > character or end of input.
+            //
+            unsigned int    bytesEaten;
+            unsigned int    count = 0;
+            const char*     asChars = (const char*)fRawByteBuf;
+            while (1)
+            {
+                // Convert the next char
+                const XMLCh chCur = fTranscoder->transcodeOne
+                (
+                    asChars++
+                    , fRawBytesAvail - count
+                    , bytesEaten
+                );
+
+                //
+                //  Any failure here is fatal as far as we are concerned
+                //  because it means we cannot even get through the first
+                //  line.
+                //
+                if (!chCur)
+                {
+                    fCharsAvail = 0;
+                    fRawBufIndex = 0;
+                    ThrowXML1
+                    (
+                        TranscodingException
+                        , XML4CExcepts::Reader_CouldNotDecodeFirstLine
+                        , fSystemId
+                    );
+                }
+
+                //
+                //  And put it into the character buffer. This stuff has to
+                //  look like it was normally transcoded.
+                //
+                fCharBuf[fCharsAvail++] = chCur;
+                count += bytesEaten;
+
+                // If its a > char, then break out
+                if (chCur == chCloseAngle)
+                    break;
+
+                // Watch for using up all input and get out
+                if (count == fRawBytesAvail)
+                    break;
+            }
+
+            //
+            //  Update the raw byte index by what we ended up converting
+            //  to get this far.
+            //
+            fRawBufIndex = count;
+            break;
+        }
+    }
+
+    //
+    //  Ok, by the time we get here, if its a legal XML file we have eaten
+    //  the XML/TextDecl. So, if we are a PE and are being referenced from
+    //  outside a literal, then we need to throw in an arbitrary space that
+    //  is required by XML.
+    //
+    if ((fType == Type_PE) && (fRefFrom == RefFrom_NonLiteral))
+        fCharBuf[fCharsAvail++] = chSpace;
+}
+
+
+//
+//  This method spools out bytes from the raw byte buffer and handles
+//  reloading it if required.
+//
+XMLByte XMLReader::getNextRawByte(const bool eoiOk)
+{
+    if (fRawBufIndex == fRawBytesAvail)
+    {
+        refreshRawBuffer();
+        fRawBufIndex = 0;
+
+        //
+        //  If EOF is valid here, then just return zero. Otherwise, throw
+        //  a UTF format exception.
+        //
+        if (!fRawBytesAvail)
+        {
+            if (eoiOk)
+                return XMLByte(0);
+            ThrowXML(UTFDataFormatException, XML4CExcepts::Reader_EOIInMultiSeq);
+        }
+    }
+    return fRawByteBuf[fRawBufIndex++];
+}
+
+
+//
+//  This method is called internally when we run out of bytes in the raw
+//  buffer. We just read as many bytes as we can into the raw buffer again
+//  and store the number of bytes we got.
+//
+void XMLReader::refreshRawBuffer()
+{
+    //
+    //  If there are any bytes left, move them down to the start. There
+    //  should only ever be (max bytes per char - 1) at the most. If not,
+    //  optimize and do the fast op and get out.
+    //
+    const unsigned int bytesLeft = fRawBytesAvail - fRawBufIndex;
+    if (!bytesLeft)
+    {
+        // Its empty so do the optimized version
+        fRawBytesAvail = fStream->readBytes(fRawByteBuf, kRawBufSize);
+        return;
+    }
+
+    // Move the existing ones down
+    for (unsigned int index = 0; index < bytesLeft; index++)
+        fRawByteBuf[index] = fRawByteBuf[fRawBufIndex + index];
+
+    //
+    //  And then read into the buffer past the existing bytes. Add back in
+    //  that many to the bytes read, and subtract that many from the bytes
+    //  requested.
+    //
+    fRawBytesAvail = fStream->readBytes
+    (
+        &fRawByteBuf[fRawBufIndex]
+        , kRawBufSize - bytesLeft
+    ) + bytesLeft;
+
+    //
+    //  We need to reset the buffer index back to the start in all cases,
+    //  since any trailing data will be copied down to the start.
+    //
+    fRawBufIndex = 0;
+}
+
+
+//
+//  This method is called internally when we run out of characters in the
+//  trancoded character buffer. We transcode up to another maxChars chars
+//  from the 
+//
+unsigned int
+XMLReader::xcodeMoreChars(          XMLCh* const            bufToFill
+                            , const unsigned int            maxChars)
+{
+    // If we are plain tuckered out, then return zero now
+    if (!fRawBytesAvail)
+        return 0;
+
+    // If our raw buffer is empty, then lets read another now
+    if (fRawBufIndex == fRawBytesAvail)
+    {
+        refreshRawBuffer();
+        fRawBufIndex = 0;
+
+        // If we didn't get anything more just return a zero now
+        if (!fRawBytesAvail)
+            return 0;
+    }
+
+    //
+    //  According to the stored encoding enum, we need to either do one of
+    //  our own internal conversions, or do the conversion via ICU.
+    //
+    //  NOTE: We don't have to pass the charSizes buffer to all of them.
+    //  The ones with fixed char size encodings can assume that the prefilled
+    //  buffer is already correct.
+    //
+    unsigned int charsDone = 0;
+    switch(fEncoding)
+    {
+        case XMLRecognizer::UCS_4B :
+        case XMLRecognizer::UCS_4L :
+            charsDone = xcodeUCS(bufToFill, maxChars);
+            break;
+
+        case XMLRecognizer::US_ASCII :
+        case XMLRecognizer::UTF_8 :
+            charsDone = xcodeUTF8(bufToFill, maxChars);
+            break;
+
+        case XMLRecognizer::UTF_16B :
+        case XMLRecognizer::UTF_16L :
+            charsDone = xcodeUTF16(bufToFill, maxChars);
+            break;
+
+        default :
+            //
+            //  If its not one of the ones above, it must be a transcoder
+            //  based one. If in debug mode, insure that we do have a
+            //  transcoder here.
+            //
+            #if defined(XML4C_DEBUG)
+            if (!fTranscoder)
+                ThrowXML1(RuntimeException, XML4CExcepts::Reader_EncodingNeedsCvtr, fEncodingStr);
+            #endif
+            charsDone = xcodeOther(bufToFill, maxChars);
+            break;
+    }
+    return charsDone;
+}
+
+
+unsigned int
+XMLReader::xcodeUCS(XMLCh* const bufToFill, const unsigned int maxChars)
+{
+    unsigned int charsRead = 0;
+
+    //
+    //  Calculate how many UCS-4 characters could possibly be pulled out
+    //  of the raw buffer right now. If none, return zero. Shouldn't happen
+    //  unless an odd number of bytes is in the buffer, since an empty
+    //  buffer would have been refilled before we were called.
+    //
+    const unsigned int charsAvail = (fRawBytesAvail - fRawBufIndex) / sizeof(UCS4Ch);
+    if (!charsAvail)
+        return 0;
+
+    //
+    //  Calculate the maximum chars we can do. Its the lesser of the chars
+    //  requested and the UCS-4 chars available in the buffer.
+    //
+    const unsigned int charsToDo = (maxChars < charsAvail) ?
+                                    maxChars : charsAvail;
+
+    //
+    //  If there is a spare character, then we have to take that one first
+    //  being sure to bump the chars read.
+    //
+    if (fSpareCh)
+    {
+        bufToFill[charsRead++] = fSpareCh;
+        fSpareCh = chNull;
+    }
+
+    // Just loop until we get the max chars we need.
+    const UCS4Ch* asUCS4 = (const UCS4Ch*)&fRawByteBuf[fRawBufIndex];
+    while (charsRead < charsToDo)
+    {
+        // Get the next int out of the buffer
+        UCS4Ch nextVal = *asUCS4++;
+        fRawBufIndex += sizeof(UCS4Ch);
+
+        // If it needs to be swapped, then do it
+        if (fSwapped)
+            nextVal = BitOps::swapBytes(nextVal);
+
+        // Handle a surrogate pair if needed
+        if (nextVal & 0xFFFF0000)
+        {
+            //
+            //  Get the two surrogate values out into separate XML chars
+            //  before we try to store them.
+            //
+            const XMLCh ch1 = XMLCh(((nextVal - 0x10000) >> 10) + 0xD800);
+            const XMLCh ch2 = XMLCh(((nextVal - 0x10000) & 0x3FF) + 0xDC00);
+
+            //
+            //  If we have room for two chars, then put them both in and bump
+            //  the chars read by two. Otherwise, put one in and store the
+            //  other in the spare char for the next round.
+            //
+            if (charsRead + 1 == maxChars)
+            {
+                bufToFill[charsRead++] = ch1;
+                fSpareCh = ch2;
+            }
+             else
+            {
+                bufToFill[charsRead++] = ch1;
+                bufToFill[charsRead++] = ch2;
+            }
+        }
+         else
+        {
+            // No surrogate, so just store it and bump the count
+            bufToFill[charsRead++] = XMLCh(nextVal);
+        }
+    }
+    return charsRead;
+}
+
+
+unsigned int
+XMLReader::xcodeUTF8(XMLCh* const bufToFill, const unsigned int maxChars)
+{
+    unsigned int charsRead = 0;
+
+    // If there is a spare char from the last time, put it in up front.
+    if (fSpareCh)
+    {
+        bufToFill[charsRead++] = fSpareCh;
+        fSpareCh = 0;
+    }
+
+    //
+    //  Precalculate the maximum chars we can return, for the cases where
+    //  we have a single byte per char encoding. Its the smaller of the
+    //  bytes left in the buffer and the max chars.
+    //
+    const unsigned int charCount = (maxChars < (fRawBytesAvail - fRawBufIndex)) ?
+                                    maxChars :
+                                    fRawBytesAvail - fRawBufIndex;
+
+    // A temp pointer to the raw buffer, which we can run upwards below
+    const XMLByte* rawBufPtr = &fRawByteBuf[fRawBufIndex];
+
+    //
+    //  We have two cases here, either US-ASCII or UTF-8. For UTF-8 we try
+    //  to optimize it on the assumptions that most UTF-8 is really ASCII.
+    //
+    if (fEncoding == XMLRecognizer::US_ASCII)
+    {
+        //
+        //  This one is simple, just run up for the precalculated number of
+        //  chars and convert each one. I've tried a lot of other fancier
+        //  loops but nothing gains over this simple and stupid one.
+        //
+        for (; charsRead < charCount; charsRead++)
+            bufToFill[charsRead] = XMLCh(*rawBufPtr++);
+        fRawBufIndex += charCount;
+    }
+     else
+    {
+        //
+        //  A list of counts of trailing bytes for each initial byte
+        //  in the input.
+        //
+        static const XMLByte UTFBytes[256] =
+        {
+                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+            ,   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+            ,   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+            ,   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
+            ,   3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5
+        };
+
+        //
+        //  A list of values to offset each result char type, according
+        //  to how many source bytes when into making it.
+        //
+        static const XMLUInt32 UTFOffsets[6] =
+        {
+            0, 0x3080, 0xE2080, 0x3C82080, 0xFA082080, 0x82022080
+        };
+
+        //
+        //  For the UTF-8 loop we have to loop until we either run out of
+        //  source buffer, and cannot reload any more, or we get them as
+        //  many as asked for.
+        //
+        while (charsRead < maxChars)
+        {
+            //
+            //  Refresh the raw buffer is required, then get the next
+            //  byte of the sequence.
+            //
+            if (fRawBufIndex == fRawBytesAvail)
+            {
+                refreshRawBuffer();
+                fRawBufIndex = 0;
+
+                // If no more, then we are done
+                if (!fRawBytesAvail)
+                    break;
+            }
+            const XMLByte byteOne = fRawByteBuf[fRawBufIndex];
+
+            // And see how many bytes this is going to require
+            const unsigned int encodedBytes = UTFBytes[byteOne];
+
+            //
+            //  See if there are enough bytes left in the raw buffer to
+            //  do this one. If not, then reload.
+            //
+            if (fRawBufIndex + encodedBytes > fRawBytesAvail)
+            {
+                refreshRawBuffer();
+                fRawBufIndex = 0;
+
+                // If we still don't have enough, then its a bad UTF seq
+                if (fRawBufIndex + encodedBytes > fRawBytesAvail)
+                {
+                    ThrowXML
+                    (
+                        UTFDataFormatException
+                        , XML4CExcepts::Reader_EOIInMultiSeq
+                    );
+                }
+            }
+
+            // Looks ok, so lets build up the value
+            XMLUInt32 tmpVal = 0;
+            switch(encodedBytes)
+            {
+                case 5 : tmpVal += fRawByteBuf[fRawBufIndex++]; tmpVal <<= 6;
+                case 4 : tmpVal += fRawByteBuf[fRawBufIndex++]; tmpVal <<= 6;
+                case 3 : tmpVal += fRawByteBuf[fRawBufIndex++]; tmpVal <<= 6;
+                case 2 : tmpVal += fRawByteBuf[fRawBufIndex++]; tmpVal <<= 6;
+                case 1 : tmpVal += fRawByteBuf[fRawBufIndex++]; tmpVal <<= 6;
+                case 0 : tmpVal += fRawByteBuf[fRawBufIndex++];
+            }
+            tmpVal -= UTFOffsets[encodedBytes];
+
+            //
+            //  If it will fit into a single char, then put it in. Otherwise
+            //  encode it as a surrogate pair. If its not valid, use the
+            //  replacement char.
+            //
+            if (!(tmpVal & 0xFFFF0000))
+            {
+                bufToFill[charsRead++] = XMLCh(tmpVal);
+            }
+             else if (tmpVal > 0x10FFFF)
+            {
+                //
+                //  If we've gotten any chars so far, then just break out for
+                //  now and lets process those. When we come back in here
+                //  again, we'll get no chars and throw an exception. This
+                //  way, the error will have a line and col number closer to
+                //  the real problem area.
+                //
+                if (charsRead)
+                {
+                    fRawBufIndex -= (encodedBytes + 1);
+                    break;
+                }
+                ThrowXML(UTFDataFormatException, XML4CExcepts::Reader_BadUTF8Seq);
+            }
+             else
+            {
+                // Store the leading surrogate char
+                tmpVal -= 0x10000;
+                bufToFill[charsRead++] = XMLCh((tmpVal >> 10) + 0xD800);
+
+                //
+                //  If we don't have room for the trailing one, then store
+                //  it in the spare chars. Else store it in the buffer.
+                //
+                if (charsRead >= maxChars)
+                    fSpareCh = XMLCh(tmpVal & 0x3FF) + 0xDC00;
+                else 
+                    bufToFill[charsRead++] = XMLCh(tmpVal & 0x3FF) + 0xDC00;
+            }
+        }
+    }
+    return charsRead;
+}
+
+
+unsigned int
+XMLReader::xcodeUTF16(          XMLCh* const    bufToFill
+                        , const unsigned int    maxChars)
+{
+    // See how many complete UTF-16 chars we can get from the raw buffer
+    const unsigned int charsAvail = (fRawBytesAvail - fRawBufIndex) / sizeof(UTF16Ch);
+
+    // If non, then return none
+    if (!charsAvail)
+        return 0;
+
+    //
+    //  Calculate the maximum chars we can do. Its the lesser of the chars
+    //  requested and the UTF=16 chars available in the buffer.
+    //
+    const unsigned int charsRead = (maxChars < charsAvail) ?
+                                    maxChars : charsAvail;
+
+    //
+    //  No transcoding required for this reader, so just bulk copy, being
+    //  sure to convert the toRead count to bytes! If its swapped we have
+    //  to use a loop.
+    //
+    //  Look at the byte buffer as 16 bit values chars, starting at the current
+    //  index into it.
+    //
+    const UTF16Ch* asUTF16 = (const UTF16Ch*)&fRawByteBuf[fRawBufIndex];
+    if (fSwapped)
+    {
+        //
+        //  And then do the swapping loop for the count we precalculated. Note
+        //  that this also handles size conversion as well if XMLCh is not the
+        //  same size as UTF16Char.
+        //
+        for (unsigned int index = 0; index < charsRead; index++)
+            bufToFill[index] = BitOps::swapBytes(*asUTF16++);
+    }
+     else
+    {
+        //
+        //  If the XMLCh type is the same size as a UTF16 value on this
+        //  platform, then we can do just a buffer copy straight to the target
+        //  buffer since our source chars are UTF-16 chars. If its not, then
+        //  we still have to do a loop and assign each one, in order to
+        //  implicitly convert.
+        //
+        if (sizeof(XMLCh) == sizeof(UTF16Ch))
+        {
+            //  Notice we convert char count to byte count here!!!
+            memcpy(bufToFill, &fRawByteBuf[fRawBufIndex], charsRead * sizeof(UTF16Ch));
+        }
+         else
+        {
+            for (unsigned int index = 0; index < charsRead; index++)
+                bufToFill[index] = *asUTF16++;
+        }
+    }
+
+    // Adjust the raw buffer index, accounting for bytes vs UTF-16 chars
+    fRawBufIndex += charsRead * sizeof(UTF16Ch);
+
+    return charsRead;
+}
+
+
+unsigned int
+XMLReader::xcodeOther(          XMLCh* const            bufToFill
+                        , const unsigned int            maxChars)
+{
+    unsigned int bytesEaten;
+    unsigned int retVal = fTranscoder->transcodeXML
+    (
+        (const char*)&fRawByteBuf[fRawBufIndex]
+        , fRawBytesAvail - fRawBufIndex
+        , bufToFill
+        , maxChars
+        , bytesEaten
+    );
+
+    // Update our offset into the raw buffer by bytes eaten
+    fRawBufIndex += bytesEaten;
+    return retVal;
+}
+
+
+
+
+// ---------------------------------------------------------------------------
+//  Conditional methods for building the table
+// ---------------------------------------------------------------------------
+
+//
+//  This code will set up the character flags table. Its defined out since
+//  this table is now written out and hard coded (at the bottom of this
+//  file) into the code itself. This code is retained in case there is
+//  any need to recreate it later.
+//
+#if defined(NEED_TO_GEN_TABLE)
+
+#include <stdio.h>
+
+static XMLCh gTmpCharTable[0xFFFF];
+
+static void initOneTable(const  XMLCh* const    theTable
+                        , const XMLByte         theMask)
+{
+    const XMLCh* pchCur = theTable;
+
+    // Do the ranges first
+    while (*pchCur)
+    {
+        XMLCh chIndex;
+
+        const XMLCh chLow = *pchCur++;
+        const XMLCh chHigh = *pchCur++;
+
+        for (chIndex = chLow; chIndex <= chHigh; chIndex++)
+            gTmpCharTable[chIndex] |= theMask;
+    }
+
+    // Skip the range terminator
+    pchCur++;
+
+    // And then the singles until we hit its terminator
+    while (*pchCur)
+        gTmpCharTable[*pchCur++] |= theMask;
+}
+
+
+
+static void initCharFlagTable()
+{
+    memset(gTmpCharTable, 0, sizeof(gTmpCharTable));
+
+    // Do the init for each table. Do the non-special case ones first
+    initOneTable(gBaseChars, gBaseCharMask);
+    initOneTable(gLetterChars, gLetterCharMask);
+    initOneTable(gXMLChars, gXMLCharMask);
+    initOneTable(gWhitespaceChars, gWhitespaceCharMask);
+
+    //
+    //  Name characters are special. A name is made up of a number of
+    //  different tables and some special case characters.
+    //
+    initOneTable(gBaseChars, gNameCharMask);
+    initOneTable(gCombiningChars, gNameCharMask);
+    initOneTable(gExtenderChars, gNameCharMask);
+    initOneTable(gIdeographicChars, gNameCharMask);
+    initOneTable(gDigitChars, gNameCharMask);
+    gTmpCharTable[chDash] |= gNameCharMask;
+    gTmpCharTable[chPeriod] |= gNameCharMask;
+    gTmpCharTable[chColon] |= gNameCharMask;
+    gTmpCharTable[chUnderscore] |= gNameCharMask;
+
+    //
+    //  And now do the very special case ones. These are bits that are
+    //  designed to sense special case characters in the most important
+    //  processing loops of the parser. They allow us to do a quick
+    //  check for a special case and get to the common case with minimal
+    //  overhead when its not. Since the special case chars are a tiny
+    //  fraction of the chars, this is a good optimization.
+    //
+    //  First we do the chars that are special case when scanning
+    //  character data (the bulk of most files.) It includes some special
+    //  case single chars.
+    //
+    gTmpCharTable[chNull] |= gSpecialCharDataMask;
+    gTmpCharTable[chCloseAngle] |= gSpecialCharDataMask;
+    gTmpCharTable[chCloseSquare] |= gSpecialCharDataMask;
+    gTmpCharTable[chOpenAngle] |= gSpecialCharDataMask;
+    gTmpCharTable[chAmpersand] |= gSpecialCharDataMask;
+
+    //
+    //  Next we do the special chars for the start tag processing, which
+    //  needs to look for things that indicate the end of the tag, quote
+    //  chars, etc...
+    //
+    gTmpCharTable[chNull] |= gSpecialStartTagCharMask;
+    gTmpCharTable[chForwardSlash] |= gSpecialStartTagCharMask;
+    gTmpCharTable[chCloseAngle] |= gSpecialStartTagCharMask;
+    gTmpCharTable[chOpenAngle] |= gSpecialStartTagCharMask;
+    gTmpCharTable[chSingleQuote] |= gSpecialStartTagCharMask;
+    gTmpCharTable[chDoubleQuote] |= gSpecialStartTagCharMask;
+    initOneTable(gWhitespaceChars, gSpecialStartTagCharMask);
+
+    //
+    //  And finally do the token sense character. These are used by the
+    //  top level content method that probes for the next thing in the
+    //  token stream.
+    //
+    gTmpCharTable[chNull] |= gSpecialTokenSenseCharMask;
+    gTmpCharTable[chAmpersand] |= gSpecialTokenSenseCharMask;
+    gTmpCharTable[chOpenAngle] |= gSpecialTokenSenseCharMask;
+
+    //
+    //  Write it out to a temp file to be read back into this source later.
+    //
+    FILE* outFl = fopen("table.out", "wt+");
+    fprintf(outFl, "XMLByte XMLReader::gTmpCharTable[0xFFFF] =\n{    ");
+    for (unsigned int index = 0; index <= 0xFFFF; index += 16)
+    {
+        fprintf(outFl
+                , "    , 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X\n"
+                , (unsigned int)gTmpCharTable[index]
+                , (unsigned int)gTmpCharTable[index+1]
+                , (unsigned int)gTmpCharTable[index+2]
+                , (unsigned int)gTmpCharTable[index+3]
+                , (unsigned int)gTmpCharTable[index+4]
+                , (unsigned int)gTmpCharTable[index+5]
+                , (unsigned int)gTmpCharTable[index+6]
+                , (unsigned int)gTmpCharTable[index+7]
+                , (unsigned int)gTmpCharTable[index+8]
+                , (unsigned int)gTmpCharTable[index+9]
+                , (unsigned int)gTmpCharTable[index+10]
+                , (unsigned int)gTmpCharTable[index+11]
+                , (unsigned int)gTmpCharTable[index+12]
+                , (unsigned int)gTmpCharTable[index+13]
+                , (unsigned int)gTmpCharTable[index+14]
+                , (unsigned int)gTmpCharTable[index+15]);
+    }
+    fprintf(outFl, "};\n");
+
+    fclose(outFl);
+}
+
+
+class CharFlagKicker
+{
+public :
+    CharFlagKicker()
+    {
+        initCharFlagTable();
+    }
+};
+
+static CharFlagKicker gKicker;
+
+#endif
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Static data
+// ---------------------------------------------------------------------------
+const XMLByte XMLReader::fgCharCharsTable[0x10000] =
+{
+      0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xD0, 0x00, 0x00, 0xD0, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0xD0, 0x40, 0x50, 0x40, 0x40, 0x40, 0x4A, 0x50, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x50
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x5A, 0x40, 0x52, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x42, 0x40, 0x44
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x44, 0x45, 0x45, 0x45, 0x40, 0x45, 0x40, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x45, 0x40, 0x45, 0x40, 0x45, 0x40
+    , 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x40, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x40, 0x44, 0x40, 0x44
+    , 0x40, 0x44, 0x44, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x44, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x45, 0x45, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x44, 0x45, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45
+    , 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x44, 0x40, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x45
+    , 0x45, 0x45, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x44, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x45
+    , 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x45, 0x40, 0x45, 0x45, 0x40, 0x45, 0x45, 0x40, 0x40, 0x44, 0x40, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x40, 0x45
+    , 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x44, 0x45, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45
+    , 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x44, 0x45, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x45
+    , 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x45, 0x40, 0x45, 0x45
+    , 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40
+    , 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x44, 0x44, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45
+    , 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40
+    , 0x45, 0x44, 0x45, 0x45, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x45, 0x45, 0x40, 0x45, 0x40, 0x40, 0x45, 0x45, 0x40, 0x45, 0x40, 0x40, 0x45, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x40, 0x45, 0x45, 0x45, 0x40, 0x45, 0x40, 0x45, 0x40, 0x40, 0x45, 0x45, 0x40, 0x45, 0x45, 0x40
+    , 0x45, 0x44, 0x45, 0x45, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x45, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x40, 0x44, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40
+    , 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x40, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x40, 0x45, 0x40, 0x45, 0x45, 0x40, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40, 0x45, 0x40
+    , 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40, 0x45, 0x40
+    , 0x45, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x40, 0x40, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45
+    , 0x45, 0x45, 0x40, 0x45, 0x40, 0x45, 0x40, 0x45, 0x40, 0x45, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40
+    , 0x40, 0x40, 0x45, 0x45, 0x40, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40, 0x40, 0x45, 0x40, 0x40, 0x45, 0x45
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x40, 0x45, 0x40, 0x45, 0x40, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x45, 0x40
+    , 0x40, 0x40, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x45, 0x45, 0x45, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40
+    , 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x40, 0x40, 0x40, 0x45, 0x45, 0x40, 0x40, 0x45, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x40, 0x64, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
+    , 0x40, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x40, 0x40, 0x44, 0x44, 0x40
+    , 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x44, 0x44, 0x44, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+    , 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45
+    , 0x45, 0x45, 0x45, 0x45, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+    , 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00
+};
+
diff --git a/src/internal/XMLReader.hpp b/src/internal/XMLReader.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..315baf94cd577522ac2fcdf5a5528b32b21eac89
--- /dev/null
+++ b/src/internal/XMLReader.hpp
@@ -0,0 +1,608 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:22  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:47  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(XMLREADER_HPP)
+#define XMLREADER_HPP
+
+#include <framework/XMLRecognizer.hpp>
+
+class InputSource;
+class BinInputStream;
+class ReaderMgr;
+class XMLBuffer;
+class XMLScanner;
+class XMLTranscoder;
+
+
+// Masks for the fgCharCharsTable array
+const XMLByte   gBaseCharMask               = 0x1;
+const XMLByte   gSpecialCharDataMask        = 0x2;
+const XMLByte   gNameCharMask               = 0x4;
+const XMLByte   gSpecialTokenSenseCharMask  = 0x8;
+const XMLByte   gSpecialStartTagCharMask    = 0x10;
+const XMLByte   gLetterCharMask             = 0x20;
+const XMLByte   gXMLCharMask                = 0x40;
+const XMLByte   gWhitespaceCharMask         = 0x80;
+
+
+
+// ---------------------------------------------------------------------------
+//  Instances of this class are used to manage the content of entities. The
+//  scanner maintains a stack of these, one for each entity (this means entity
+//  in the sense of any parsed file or internal entity) currently being
+//  scanned. This class, given a binary input stream will handle reading in
+//  the data and decoding it from its external decoding into the internal
+//  Unicode format. Once internallized, this class provides the access
+//  methods to read in the data in various ways, maintains line and column
+//  information, and provides high performance character attribute checking
+//  methods.
+//
+//  This is NOT to be derived from.
+// ---------------------------------------------------------------------------
+class XMLPARSER_EXPORT XMLReader
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Public types
+    // -----------------------------------------------------------------------
+    enum Types
+    {
+        Type_PE
+        , Type_General
+    };
+
+    enum Sources
+    {
+        Source_Internal
+        , Source_External
+    };
+
+    enum RefFrom
+    {
+        RefFrom_Literal
+        , RefFrom_NonLiteral
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Public, static methods
+    // -----------------------------------------------------------------------
+    static bool isAllSpaces
+    (
+        const   XMLCh* const    toCheck
+        , const unsigned int    count
+    );
+    static bool isBaseChar(const XMLCh toCheck);
+    static bool isFirstNameChar(const XMLCh toCheck);
+    static bool isNameChar(const XMLCh toCheck);
+    static bool isPublicIdChar(const XMLCh toCheck);
+    static bool isSpecialCharDataChar(const XMLCh toCheck);
+    static bool isSpecialStartTagChar(const XMLCh toCheck);
+    static bool isSpecialTokenSenseChar(const XMLCh toCheck);
+    static bool isXMLLetter(const XMLCh toCheck);
+    static bool isXMLChar(const XMLCh toCheck);
+    static bool isWhitespace(const XMLCh toCheck);
+
+
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLReader
+    (
+        const   XMLCh* const                pubId
+        , const XMLCh* const                sysId
+        ,       BinInputStream* const       streamToAdopt
+        , const RefFrom                     from
+        , const Types                       type
+        , const Sources                     source
+        , const bool                        throwAtEnd = false
+    );
+
+    XMLReader
+    (
+        const   XMLCh* const                pubId
+        , const XMLCh* const                sysId
+        ,       BinInputStream* const       streamToAdopt
+        , const XMLCh* const                encodingStr
+        , const RefFrom                     from
+        , const Types                       type
+        , const Sources                     source
+        , const bool                        throwAtEnd = false
+    );
+
+    ~XMLReader();
+
+
+    // -----------------------------------------------------------------------
+    //  Character buffer management methods
+    // -----------------------------------------------------------------------
+    unsigned long charsLeftInBuffer() const;
+    bool refreshCharBuffer();
+
+
+    // -----------------------------------------------------------------------
+    //  Scanning methods
+    // -----------------------------------------------------------------------
+    XMLCh getCharData
+    (
+        XMLBuffer&      toFill
+        , XMLScanner&   owningScanner
+        , bool&         gotLeadingSurrogate
+    );
+    bool getName(XMLBuffer& toFill, const bool token);
+    bool getNextChar(XMLCh& chGotten);
+    bool getSpaces(XMLBuffer& toFill);
+    bool getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck);
+    bool peekNextChar(XMLCh& chGotten);
+    bool skipIfQuote(XMLCh& chGotten);
+    bool skipSpaces(bool& skippedSomething);
+    bool skippedChar(const XMLCh toSkip);
+    bool skippedSpace();
+    bool skippedString(const XMLCh* const toSkip);
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    unsigned int getColumnNumber() const;
+    const XMLCh* getEncodingStr() const;
+    unsigned int getLineNumber() const;
+    bool getNoMoreFlag() const;
+    const XMLCh* getPublicId() const;
+    unsigned int getReaderNum() const;
+    RefFrom getRefFrom() const;
+    Sources getSource() const;
+    const XMLCh* getSystemId() const;
+    bool getThrowAtEnd() const;
+    Types getType() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    bool setEncoding
+    (
+        const   XMLCh* const    newEncoding
+    );
+    void setReaderNum(const unsigned int newNum);
+    void setThrowAtEnd(const bool newValue);
+
+
+private:
+    // ---------------------------------------------------------------------------
+    //  Class Constants
+    //
+    //  kCharBufSize
+    //      The size of the character spool buffer that we use. Its not terribly
+    //      large because its just getting filled with data from a raw byte
+    //      buffer as we go along. We don't want to decode all the text at
+    //      once before we find out that there is an error.
+    //
+    //      NOTE: This is a size in characters, not bytes.
+    //
+    //  kRawBufSize
+    //      The size of the raw buffer from which raw bytes are spooled out
+    //      as we transcode chunks of data. As it is emptied, it is filled back
+    //      in again from the source stream.
+    // ---------------------------------------------------------------------------
+    enum Constants
+    {
+        kCharBufSize        = 16 * 1024
+        , kRawBufSize       = 48 * 1024
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Private static methods
+    // -----------------------------------------------------------------------
+    static bool checkTable
+    (
+        const   XMLCh* const    theTable
+        , const XMLCh           toCheck
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+    void checkForSwapped();
+
+    void doInitCharSizeChecks();
+
+    void doInitDecode();
+
+    XMLByte getNextRawByte
+    (
+        const   bool            eoiOk
+    );
+
+    void refreshRawBuffer();
+
+    unsigned int xcodeMoreChars
+    (
+                XMLCh* const            bufToFill
+        , const unsigned int            maxChars
+    );
+
+    unsigned int xcodeUCS
+    (
+                XMLCh* const            bufToFill
+        , const unsigned int            maxChars
+    );
+
+    unsigned int xcodeUTF8
+    (
+                XMLCh* const            bufToFill
+        , const unsigned int            maxChars
+    );
+
+    unsigned int xcodeUTF16
+    (
+                XMLCh* const            bufToFill
+        , const unsigned int            maxChars
+    );
+
+    unsigned int xcodeOther
+    (
+                XMLCh* const            bufToFill
+        , const unsigned int            maxChars
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Data members
+    //
+    //  fCharIndex
+    //      The index into the character buffer. When this hits fCharsAvail
+    //      then its time to refill.
+    //
+    //  fCharBuf
+    //      A buffer that the reader manager fills up with transcoded
+    //      characters a small amount at a time.
+    //
+    //  fCharsAvail
+    //      The characters currently available in the character buffer.
+    //
+    //  fCurCol
+    //  fCurLine
+    //      The current line and column that we are in within this reader's
+    //      text.
+    //
+    //  fEncoding
+    //      This is the rough encoding setting. This enum is set during
+    //      construction and just tells us the rough family of encoding that
+    //      we are doing.
+    //
+    //  fEncodingStr
+    //      This is the name of the encoding we are using. It will be
+    //      provisionally set during construction, from the auto-sensed
+    //      encoding. But it might be overridden when the XMLDecl is finally
+    //      seen by the scanner. It can also be forced to a particular
+    //      encoding, in which case fForcedEncoding is set.
+    //
+    //  fForcedEncoding
+    //      If the encoding if forced then this is set and all other
+    //      information will be ignored. This encoding will be taken as
+    //      gospel. This is done by calling an alternate constructor.
+    //
+    //  fNoMore
+    //      This is set when the source text is exhausted. It lets us know
+    //      quickly that no more text is available.
+    //
+    //  fRawBufIndex
+    //      The current index into the raw byte buffer. When its equal to
+    //      fRawBytesAvail then we need to read another buffer.
+    //
+    //  fRawByteBuf
+    //      This is the raw byte buffer that is used to spool out bytes
+    //      from into the fCharBuf buffer, as we transcode in blocks.
+    //
+    //  fRawBytesAvail
+    //      The number of bytes currently available in the raw buffer. This
+    //      helps deal with the last buffer's worth, which will usually not
+    //      be a full one.
+    //
+    //  fReaderNum
+    //      Each reader from a particular reader manager (which means from a
+    //      particular document) is given a unique number. The reader manager
+    //      sets these numbers. They are used to catch things like partial
+    //      markup errors.
+    //
+    //  fRefFrom
+    //      This flag is provided in the ctor, and tells us if we represent
+    //      some entity being expanded inside a literal. Sometimes things
+    //      happen differently inside and outside literals.
+    //
+    //  fPublicId
+    //  fSystemId
+    //      These are the system and public ids of the source that this
+    //      reader is reading.
+    //
+    //  fSentTrailingSpace
+    //      If we are a PE entity being read and we not referenced from a
+    //      literal, then a leading and trailing space must be faked into the
+    //      data. This lets us know we've done the trailing space already (so
+    //      we don't just keep doing it again and again.)
+    //
+    //  fSource
+    //      Indicates whether the content this reader is spooling as already
+    //      been internalized. This will prevent multiple processing of
+    //      whitespace when an already internalized entity is being spooled
+    //      out.
+    //
+    //  fSpareChar
+    //      Some encodings can create two chars in an atomic way, e.g.
+    //      surrogate pairs. We might not be able to store both, so we store
+    //      it here until the next buffer transcoding operation.
+    //
+    //  fStream
+    //      This is the input stream that provides the data for the reader.
+    //      Its always treated as a raw byte stream. The derived class will
+    //      ask for buffers of text from it and will handle making some
+    //      sense of it.
+    //
+    //  fSwapped
+    //      If the encoding is one of the ones we do intrinsically, and its
+    //      in a different byte order from our native order, then this is
+    //      set to remind us to byte swap it during transcoding.
+    //
+    //  fThrowAtEnd
+    //      Indicates whether the reader manager should throw an end of entity
+    //      exception at the end of this reader instance. This is usually
+    //      set for top level external entity references. It overrides the
+    //      reader manager's global flag that controls throwing at the end
+    //      of entities. Defaults to false.
+    //
+    //  fTranscoder
+    //      If the encoding is not one that we handle intrinsically, then
+    //      we use an an external transcoder to do it. This class is an
+    //      abstraction that allows us to use pluggable external transcoding
+    //      services (via XMLTransService in util.)
+    //
+    //  fType
+    //      Indicates whether this reader represents a PE or not. If this
+    //      flag is true and the fInLiteral flag is false, then we will put
+    //      out an extra space at the end.
+    // -----------------------------------------------------------------------
+    unsigned int                fCharIndex;
+    XMLCh                       fCharBuf[kCharBufSize];
+    unsigned int                fCharsAvail;
+    unsigned int                fCurCol;
+    unsigned int                fCurLine;
+    XMLRecognizer::Encodings    fEncoding;
+    XMLCh*                      fEncodingStr;
+    bool                        fForcedEncoding;
+    bool                        fNoMore;
+    XMLCh*                      fPublicId;
+    unsigned int                fRawBufIndex;
+    XMLByte                     fRawByteBuf[kRawBufSize];
+    unsigned int                fRawBytesAvail;
+    unsigned int                fReaderNum;
+    RefFrom                     fRefFrom;
+    bool                        fSentTrailingSpace;
+    Sources                     fSource;
+    XMLCh                       fSpareCh;
+    XMLCh*                      fSystemId;
+    BinInputStream*             fStream;
+    bool                        fSwapped;
+    bool                        fThrowAtEnd;
+    XMLTranscoder*              fTranscoder;
+    Types                       fType;
+
+
+    // -----------------------------------------------------------------------
+    //  Static data members
+    //
+    //  fgCharCharsTables
+    //      The character characteristics table. Bits in each byte, represent
+    //      the characteristics of each character. This one is static since
+    //      it only has to be created once and is read-only after that.
+    // -----------------------------------------------------------------------
+    static const XMLByte    fgCharCharsTable[0x10000];
+};
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Public, static methods
+// ---------------------------------------------------------------------------
+inline bool XMLReader::isBaseChar(const XMLCh toCheck)
+{
+    return (fgCharCharsTable[toCheck] & gBaseCharMask) != 0;
+}
+
+inline bool XMLReader::isFirstNameChar(const XMLCh toCheck)
+{
+    static const XMLByte ourMask = gBaseCharMask | gLetterCharMask;
+    if ((fgCharCharsTable[toCheck] & ourMask) != 0)
+        return true;
+
+    // Check the two special case name start chars
+    if ((toCheck == '_') || (toCheck == ':'))
+        return true;
+
+    return false;
+}
+
+inline bool XMLReader::isNameChar(const XMLCh toCheck)
+{
+    return (fgCharCharsTable[toCheck] & gNameCharMask) != 0;
+}
+
+inline bool XMLReader::isSpecialCharDataChar(const XMLCh toCheck)
+{
+    return ((fgCharCharsTable[toCheck] & gSpecialCharDataMask) != 0);
+}
+
+inline bool XMLReader::isSpecialStartTagChar(const XMLCh toCheck)
+{
+    return ((fgCharCharsTable[toCheck] & gSpecialStartTagCharMask) != 0);
+}
+
+inline bool XMLReader::isSpecialTokenSenseChar(const XMLCh toCheck)
+{
+    return ((fgCharCharsTable[toCheck] & gSpecialTokenSenseCharMask) != 0);
+}
+
+inline bool XMLReader::isXMLChar(const XMLCh toCheck)
+{
+    return ((fgCharCharsTable[toCheck] & gXMLCharMask) != 0);
+}
+
+inline bool XMLReader::isXMLLetter(const XMLCh toCheck)
+{
+    static const XMLByte ourMask = gBaseCharMask | gLetterCharMask;
+    return ((fgCharCharsTable[toCheck] & ourMask) != 0);
+}
+
+inline bool XMLReader::isWhitespace(const XMLCh toCheck)
+{
+    return ((fgCharCharsTable[toCheck] & gWhitespaceCharMask) != 0);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Buffer management methods
+// ---------------------------------------------------------------------------
+inline unsigned long XMLReader::charsLeftInBuffer() const
+{
+    return fCharsAvail - fCharIndex;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Getter methods
+// ---------------------------------------------------------------------------
+inline unsigned int XMLReader::getColumnNumber() const
+{
+    return fCurCol;
+}
+
+inline const XMLCh* XMLReader::getEncodingStr() const
+{
+    return fEncodingStr;
+}
+
+inline unsigned int XMLReader::getLineNumber() const
+{
+    return fCurLine;
+}
+
+inline bool XMLReader::getNoMoreFlag() const
+{
+    return fNoMore;
+}
+
+inline const XMLCh* XMLReader::getPublicId() const
+{
+    return fPublicId;
+}
+
+inline unsigned int XMLReader::getReaderNum() const
+{
+    return fReaderNum;
+}
+
+inline XMLReader::RefFrom XMLReader::getRefFrom() const
+{
+    return fRefFrom;
+}
+
+inline XMLReader::Sources XMLReader::getSource() const
+{
+    return fSource;
+}
+
+inline const XMLCh* XMLReader::getSystemId() const
+{
+    return fSystemId;
+}
+
+inline bool XMLReader::getThrowAtEnd() const
+{
+    return fThrowAtEnd;
+}
+
+inline XMLReader::Types XMLReader::getType() const
+{
+    return fType;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLReader: Setter methods
+// ---------------------------------------------------------------------------
+inline void XMLReader::setReaderNum(const unsigned int newNum)
+{
+    fReaderNum = newNum;
+}
+
+inline void XMLReader::setThrowAtEnd(const bool newValue)
+{
+    fThrowAtEnd = newValue;
+}
+
+#endif
diff --git a/src/internal/XMLScanner.cpp b/src/internal/XMLScanner.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5b28b690f4b981351c2b5388de0f20e92c8d0dc8
--- /dev/null
+++ b/src/internal/XMLScanner.cpp
@@ -0,0 +1,2653 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:22  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:56:54  droddey
+ * If the main xml entity does not exist, we need to get the error handling for that
+ * inside the main XMLScanner::scanDocument() try block so that it gets reported
+ * in the normal way. We have to add a little extra safety code because, when this
+ * happens, there is no reader on the reader stack to get position ino from.
+ *
+ * Revision 1.6  1999/11/08 20:44:51  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/Mutexes.hpp>
+#include <util/PlatformUtils.hpp>
+#include <util/RefVectorOf.hpp>
+#include <util/RuntimeException.hpp>
+#include <util/UnexpectedEOFException.hpp>
+#include <util/URL.hpp>
+#include <util/XMLMsgLoader.hpp>
+#include <util/XMLUni.hpp>
+#include <sax/InputSource.hpp>
+#include <sax/SAXException.hpp>
+#include <framework/XMLDocumentHandler.hpp>
+#include <framework/XMLElementDecl.hpp>
+#include <framework/XMLErrorReporter.hpp>
+#include <framework/XMLEntityDecl.hpp>
+#include <framework/XMLEntityHandler.hpp>
+#include <framework/XMLPScanToken.hpp>
+#include <framework/XMLValidator.hpp>
+#include <framework/XMLValidityCodes.hpp>
+#include <internal/XMLScanner.hpp>
+#include <internal/EndOfEntityException.hpp>
+
+#if defined(XML4C_DEBUG)
+#include <util/StdOut.hpp>
+#endif
+
+
+
+// ---------------------------------------------------------------------------
+//  Local static data
+// ---------------------------------------------------------------------------
+static XMLUInt32       gScannerId;
+static XMLMutex        gScannerMutex;
+static XMLMsgLoader*   gMsgLoader;
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Constructors and Destructor
+// ---------------------------------------------------------------------------
+XMLScanner::XMLScanner(XMLValidator* const validator) :
+
+    fAttrList(0)
+    , fDocHandler(0)
+    , fDoNamespaces(false)
+    , fDoValidation(false)
+    , fEntityHandler(0)
+    , fErrorReporter(0)
+    , fExitOnFirstFatal(true)
+    , fIDRefList(0)
+    , fInException(false)
+    , fRawAttrList(0)
+    , fReuseValidator(false)
+    , fScannerId(0)
+    , fSequenceId(0xFFFFFFFF)
+    , fStandalone(false)
+    , fValidator(validator)
+{
+    commonInit();
+}
+
+XMLScanner::XMLScanner( XMLDocumentHandler* const   docHandler
+                        , XMLEntityHandler* const   entityHandler
+                        , XMLErrorReporter* const   errHandler
+                        , XMLValidator* const       validator) :
+
+    fAttrList(0)
+    , fDocHandler(docHandler)
+    , fDoNamespaces(false)
+    , fDoValidation(false)
+    , fEntityHandler(entityHandler)
+    , fErrorReporter(errHandler)
+    , fExitOnFirstFatal(true)
+    , fIDRefList(0)
+    , fInException(false)
+    , fRawAttrList(0)
+    , fReuseValidator(false)
+    , fScannerId(0)
+    , fSequenceId(0xFFFFFFFF)
+    , fStandalone(false)
+    , fValidator(validator)
+{
+    commonInit();
+}
+
+XMLScanner::~XMLScanner()
+{
+    delete fAttrList;
+    delete fIDRefList;
+    delete fRawAttrList;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Main entry point to scan a document
+// ---------------------------------------------------------------------------
+void XMLScanner::scanDocument(const InputSource& src, const bool reuseValidator)
+{
+    //
+    //  Bump up the sequence id for this parser instance. This will invalidate
+    //  any previous progressive scan tokens.
+    //
+    fSequenceId++;
+
+    // Store the reuse validator flag
+    fReuseValidator = reuseValidator;
+
+    try
+    {
+        //
+        //  Reset the scanner and its plugged in stuff for a new run. This
+        //  resets all the data structures, creates the initial reader and
+        //  pushes it on the stack, and sets up the base document path.
+        //
+        scanReset(src);
+
+        // If we have a document handler, then call the start document
+        if (fDocHandler)
+            fDocHandler->startDocument();
+
+        //
+        //  Scan the prolog part, which is everything before the root element
+        //  including the DTD subsets.
+        //
+        scanProlog();
+
+        //
+        //  At this point, we know which type of validation we are going to
+        //  use (if the plugged in validator handles either DTD or Schemas)
+        //  since we will have seen the DOCTYPE or PI that set it up. So lets
+        //  ask the validator whether it requires namespaces or not. If it
+        //  does, we have to override the namespace enablement flag.
+        //
+        if (fValidator->requiresNamespaces() && !fDoNamespaces)
+            fDoNamespaces = true;
+
+        //
+        //  If we got to the end of input, then its not a valid XML file.
+        //  Else, go on to scan the content.
+        //
+        if (fReaderMgr.atEOF())
+        {
+            emitError(XML4CErrs::EmptyMainEntity);
+        }
+         else
+        {
+            // Scan content, and tell it its not an external entity
+            if (scanContent(false))
+            {
+                // Do post-parse validation if required
+                if (fDoValidation)
+                {
+                    //
+                    //  We handle ID reference semantics at this level since
+                    //  its required by XML 1.0.
+                    //
+                    checkIDRefs();
+
+                    // Then allow the validator to do any extra stuff it wants
+                    fValidator->postParseValidation();
+                }
+
+                // That went ok, so scan for any miscellaneous stuff
+                if (!fReaderMgr.atEOF())
+                    scanMiscellaneous();
+            }
+        }
+
+        // If we have a document handler, then call the end document
+        if (fDocHandler)
+            fDocHandler->endDocument();
+    }
+
+    catch(const XML4CErrs::Codes)
+    {
+        // This is a 'first fatal error' type exit, so just fall through
+    }
+
+    //
+    //  We have to propogate SAX exceptions. Since they are derived from our
+    //  XMLException class, we have to filter it out first here so that it
+    //  does not get caught and eaten below.
+    //
+    catch(const SAXException&)
+    {
+        //
+        //  Make sure we do anything that would normally be done on the way
+        //  out of this method.
+        //
+        fReaderMgr.reset();
+        throw;
+    }
+
+    catch(const XMLException& excToCatch)
+    {
+        fInException = true;
+        emitError
+        (
+            XML4CErrs::XMLException
+            , excToCatch.getType()
+            , excToCatch.getMessage()
+        );
+
+        // And fall through
+    }
+
+    catch(...)
+    {
+        //
+        //  We don't know what happened. So issue an error, flush the reader
+        //  manager to close down files, sockets, etc... and rethrow.
+        //
+        //  NOTE: The error emit MUST come before the flush of the reader
+        //  or it will fail because it tries to find out the position in
+        //  the XML source of the error.
+        //
+        fInException = true;
+        emitError(XML4CErrs::SysException);
+        fReaderMgr.reset();
+        throw;
+    }
+
+    // Reset the reader manager to close all files
+    fReaderMgr.reset();
+}
+
+
+//
+//  This method begins a progressive parse. It scans through the prolog and
+//  returns a token to be used on subsequent scanNext() calls. If the return
+//  value is true, then the token is legal and ready for further use. If it
+//  returns false, then the scan of the prolog failed and the token is not
+//  going to work on subsequent scanNext() calls.
+//
+bool XMLScanner::scanFirst( const   InputSource&    src
+                            ,       XMLPScanToken&  toFill
+                            , const bool            reuseValidator)
+{
+    // Store the reuse validator flag
+    fReuseValidator = reuseValidator;
+
+    //
+    //  Bump up the sequence id for this new scan cycle. This will invalidate
+    //  any previous tokens we've returned.
+    //
+    fSequenceId++;
+
+    // Reset the scanner and its plugged in stuff for a new run
+    scanReset(src);
+
+    try
+    {
+        //
+        //  Scan the prolog part, which is everything before the root element
+        //  including the DTD subsets. This is all that is done on the scan
+        //  first.
+        //
+        scanProlog();
+    }
+
+    // This is a 'first failure' exception so reset and return a failure
+    catch(const XML4CErrs::Codes)
+    {
+        fReaderMgr.reset();
+        return false;
+    }
+
+    // We have to propogate SAX exceptions
+    catch(const SAXException&)
+    {
+        fReaderMgr.reset();
+        throw;
+    }
+
+    // This one is just a failure
+    catch(const XMLException& excToCatch)
+    {
+        fInException = true;
+        emitError
+        (
+            XML4CErrs::XMLException
+            , excToCatch.getType()
+            , excToCatch.getMessage()
+        );
+        fReaderMgr.reset();
+        return false;
+    }
+
+    catch(...)
+    {
+        fInException = true;
+        emitError(XML4CErrs::SysException);
+        fReaderMgr.reset();
+        throw;
+    }
+
+    // Fill in the caller's token to make it legal and return success
+    toFill.set(fScannerId, fSequenceId);
+    return true;
+}
+
+
+bool XMLScanner::scanNext(XMLPScanToken& token)
+{
+    // Make sure this token is still legal
+    if (!isLegalToken(token))
+        ThrowXML(RuntimeException, XML4CExcepts::Scan_BadPScanToken);
+
+    bool retVal = true;
+    try
+    {
+        // Find the next token and remember the reader id
+        unsigned int orgReader;
+        const XMLTokens curToken = senseNextToken(orgReader);
+
+        if (curToken == Token_CharData)
+        {
+            scanCharData(fCDataBuf);
+        }
+         else if (curToken == Token_EOF)
+        {
+            if (!fElemStack.isEmpty())
+            {
+                const ElemStack::StackElem* topElem = fElemStack.popTop();
+                emitError
+                (
+                    XML4CErrs::EndedWithTagsOnStack
+                    , topElem->fThisElement->getFullName()
+                );
+            }
+
+            retVal = false;
+        }
+         else
+        {
+            // Its some sort of markup
+            bool gotData;
+            switch(curToken)
+            {
+                case Token_CData :
+                    // Make sure we are within content
+                    if (fElemStack.isEmpty())
+                        emitError(XML4CErrs::CDATAOutsideOfContent);
+                    scanCDSection();
+                    break;
+
+                case Token_Comment :
+                    scanComment();
+                    break;
+
+                case Token_EndTag :
+                    scanEndTag(gotData);
+                    break;
+
+                case Token_PI :
+                    scanPI();
+                    break;
+
+                case Token_StartTag :
+                    if (fDoNamespaces)
+                        scanStartTagNS(gotData);
+                    else
+                        scanStartTag(gotData);
+                    break;
+
+                default :
+                    fReaderMgr.skipToChar(chOpenAngle);
+                    break;
+            }
+
+            if (orgReader != fReaderMgr.getCurrentReaderNum())
+                emitError(XML4CErrs::PartialMarkupInEntity);
+
+            // If we hit the end, then do the miscellaneous part
+            if (!gotData)
+                scanMiscellaneous();
+        }
+    }
+
+    // This is a 'first failure' exception, so reset and return failure
+    catch(const XML4CErrs::Codes)
+    {
+        fReaderMgr.reset();
+        return false;
+    }
+
+    // We have to propogate SAX exceptions
+    catch(const SAXException&)
+    {
+        fReaderMgr.reset();
+        throw;
+    }
+
+    // This one is just a failure
+    catch(const XMLException& excToCatch)
+    {
+        fInException = true;
+        emitError
+        (
+            XML4CErrs::XMLException
+            , excToCatch.getType()
+            , excToCatch.getMessage()
+        );
+
+        fReaderMgr.reset();
+        return false;
+    }
+
+    catch(...)
+    {
+        fInException = true;
+        emitError(XML4CErrs::SysException);
+
+        fReaderMgr.reset();
+        throw;
+    }
+    return retVal;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Private helper methods. Most of these are implemented in
+//  XMLScanner2.Cpp.
+// ---------------------------------------------------------------------------
+
+//
+//  This method handles the common initialization, to avoid having to do
+//  it redundantly in multiple constructors.
+//
+void XMLScanner::commonInit()
+{
+    //
+    //  We have to do a little init that involves statics, so we have to
+    //  use the mutex to protect it.
+    //
+    {
+        XMLMutexLock lockInit(&gScannerMutex);
+
+        // If we haven't loaded our message yet, then do that
+        if (!gMsgLoader)
+        {
+            // MUST check again since we could have gotten beat to the lock
+            if (!gMsgLoader)
+            {
+                gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain);
+                if (!gMsgLoader)
+                    XMLPlatformUtils::panic(XMLPlatformUtils::Panic_CantLoadMsgDomain);
+            }
+        }
+
+        // And assign ourselves the next available scanner id
+        fScannerId = ++gScannerId;
+    }
+
+    //
+    //  Create the attribute list, which is used to store attribute values
+    //  during start tag processing. Give it a reasonable initial size that
+    //  will serve for most folks, though it will grow as required.
+    //
+    fAttrList = new RefVectorOf<XMLAttr>(32);
+
+    //
+    //  And we need one for the raw attribute scan. This just stores key/
+    //  value string pairs (prior to any processing.)
+    //
+    fRawAttrList = new RefVectorOf<KVStringPair>(32);
+
+    //
+    //  Create the id ref list. This is used to enforce XML 1.0 ID ref
+    //  semantics, i.e. all id refs must refer to elements that exist
+    //
+    fIDRefList = new RefHashTableOf<XMLRefInfo>(109);
+
+    //
+    //  Tell the validator about the stuff it needs to know in order to
+    //  do its work.
+    //
+    fValidator->setScannerInfo(this, &fReaderMgr, &fBufMgr);
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Error emitting methods
+// ---------------------------------------------------------------------------
+
+//
+//  These methods are called whenever the scanner wants to emit an error.
+//  It handles getting the message loaded, doing token replacement, etc...
+//  and then calling the error handler, if its installed.
+//
+void XMLScanner::emitError(const XML4CErrs::Codes toEmit)
+{
+    if (fErrorReporter)
+    {
+        // Load the message into a local for display
+        const unsigned int msgSize = 1023;
+        XMLCh errText[msgSize + 1];
+
+        // Lock the mutex and load the text
+        {
+            XMLMutexLock lockInit(&gScannerMutex);
+            if (!gMsgLoader->loadMsg(toEmit, errText, msgSize))
+            {
+                // <TBD> Probably should load a default msg here
+            }
+        }
+
+        //
+        //  Create a LastExtEntityInfo structure and get the reader manager
+        //  to fill it in for us. This will give us the information about
+        //  the last reader on the stack that was an external entity of some
+        //  sort (i.e. it will ignore internal entities.
+        //
+        ReaderMgr::LastExtEntityInfo lastInfo;
+        fReaderMgr.getLastExtEntityInfo(lastInfo);
+
+        fErrorReporter->error
+        (
+            toEmit
+            , XMLUni::fgXMLErrDomain
+            , XML4CErrs::errorType(toEmit)
+            , errText
+            , lastInfo.systemId
+            , lastInfo.publicId
+            , lastInfo.lineNumber
+            , lastInfo.colNumber
+        );
+    }
+
+    // Bail out if its fatal an we are to give up on the first fatal error
+    if (XML4CErrs::isFatal(toEmit) && fExitOnFirstFatal && !fInException)
+        throw toEmit;
+}
+
+void XMLScanner::emitError( const   XML4CErrs::Codes    toEmit
+                            , const XMLCh* const        text1
+                            , const XMLCh* const        text2
+                            , const XMLCh* const        text3
+                            , const XMLCh* const        text4)
+{
+    if (fErrorReporter)
+    {
+        //
+        //  Load the message into alocal and replace any tokens found in
+        //  the text.
+        //
+        const unsigned int maxChars = 2047;
+        XMLCh errText[maxChars + 1];
+
+        // Lock the mutex and load the text
+        {
+            XMLMutexLock lockInit(&gScannerMutex);
+            if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4))
+            {
+                // <TBD> Should probably load a default message here
+            }
+        }
+
+        //
+        //  Create a LastExtEntityInfo structure and get the reader manager
+        //  to fill it in for us. This will give us the information about
+        //  the last reader on the stack that was an external entity of some
+        //  sort (i.e. it will ignore internal entities.
+        //
+        ReaderMgr::LastExtEntityInfo lastInfo;
+        fReaderMgr.getLastExtEntityInfo(lastInfo);
+
+        fErrorReporter->error
+        (
+            toEmit
+            , XMLUni::fgXMLErrDomain
+            , XML4CErrs::errorType(toEmit)
+            , errText
+            , lastInfo.systemId
+            , lastInfo.publicId
+            , lastInfo.lineNumber
+            , lastInfo.colNumber
+        );
+    }
+
+    // Bail out if its fatal an we are to give up on the first fatal error
+    if (XML4CErrs::isFatal(toEmit) && fExitOnFirstFatal && !fInException)
+        throw toEmit;
+}
+
+void XMLScanner::emitError( const   XML4CErrs::Codes    toEmit
+                            , const char* const         text1
+                            , const char* const         text2
+                            , const char* const         text3
+                            , const char* const         text4)
+{
+    if (fErrorReporter)
+    {
+        //
+        //  Load the message into alocal and replace any tokens found in
+        //  the text.
+        //
+        const unsigned int maxChars = 2047;
+        XMLCh errText[maxChars + 1];
+
+        // Lock the mutex and load the text
+        {
+            XMLMutexLock lockInit(&gScannerMutex);
+            if (!gMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4))
+            {
+                // <TBD> Should probably load a default message here
+            }
+        }
+
+        //
+        //  Create a LastExtEntityInfo structure and get the reader manager
+        //  to fill it in for us. This will give us the information about
+        //  the last reader on the stack that was an external entity of some
+        //  sort (i.e. it will ignore internal entities.
+        //
+        ReaderMgr::LastExtEntityInfo lastInfo;
+        fReaderMgr.getLastExtEntityInfo(lastInfo);
+
+        fErrorReporter->error
+        (
+            toEmit
+            , XMLUni::fgXMLErrDomain
+            , XML4CErrs::errorType(toEmit)
+            , errText
+            , lastInfo.systemId
+            , lastInfo.publicId
+            , lastInfo.lineNumber
+            , lastInfo.colNumber
+        );
+    }
+
+    // Bail out if its fatal an we are to give up on the first fatal error
+    if (XML4CErrs::isFatal(toEmit) && fExitOnFirstFatal && !fInException)
+        throw toEmit;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Getter methods
+// ---------------------------------------------------------------------------
+
+//
+//  This method allows the caller to query the current location of the scanner.
+//  It will return the sys/public ids of the current entity, and the line/col
+//  position within it.
+//
+//  NOTE: This API returns the location with the last external file. So if its
+//  currently scanning an entity, the position returned will be the end of
+//  the entity reference in the file that had the reference.
+//
+bool
+XMLScanner::getLastExtLocation(         XMLCh* const    sysIdToFill
+                                , const unsigned int    maxSysIdChars
+                                ,       XMLCh* const    pubIdToFill
+                                , const unsigned int    maxPubIdChars
+                                ,       unsigned int&   lineToFill
+                                ,       unsigned int&   colToFill)
+{
+    // Create a local info object and get it filled in by the reader manager
+    ReaderMgr::LastExtEntityInfo lastInfo;
+    fReaderMgr.getLastExtEntityInfo(lastInfo);
+
+    // Fill in the line and column number
+    lineToFill = lastInfo.lineNumber;
+    colToFill = lastInfo.colNumber;
+
+    // And copy over as much of the ids as will fit
+    sysIdToFill[0] = 0;
+    if (lastInfo.systemId)
+    {
+        if (XMLString::stringLen(lastInfo.systemId) > maxSysIdChars)
+            return false;
+        XMLString::copyString(sysIdToFill, lastInfo.systemId);
+    }
+
+    pubIdToFill[0] = 0;
+    if (lastInfo.publicId)
+    {
+        if (XMLString::stringLen(lastInfo.publicId) > maxPubIdChars)
+            return false;
+        XMLString::copyString(pubIdToFill, lastInfo.publicId);
+    }
+    return true;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Setter methods methods
+// ---------------------------------------------------------------------------
+void XMLScanner::setDoValidation(const bool validate)
+{
+    fDoValidation = validate;
+}
+
+void XMLScanner::setValidator(XMLValidator* const validator)
+{
+    fValidator = validator;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Private scanning methods
+// ---------------------------------------------------------------------------
+
+//
+//  This method is called from scanStartTag() to handle the very raw initial
+//  scan of the attributes. It just fills in the passed collection with
+//  key/value pairs for each attribute. No processing is done on them at all.
+//
+unsigned int
+XMLScanner::rawAttrScan(RefVectorOf<KVStringPair>& toFill, bool& isEmpty)
+{
+    //
+    //  Keep up with how many attributes we've seen so far, and how many
+    //  elements are available in the vector. This way we can reuse old
+    //  elements until we run out and then expand it.
+    //
+    unsigned int attCount = 0;
+    unsigned int curVecSize = toFill.size();
+
+    // Assume it is not empty
+    isEmpty = false;
+
+    //
+    //  We loop until we either see a /> or >, handling key/value pairs util
+    //  we get there. We place them in the passed vector, which we will expand
+    //  as required to hold them.
+    //
+    while (true)
+    {
+        // Get the next character, which should be non-space
+        XMLCh nextCh = fReaderMgr.peekNextChar();
+
+        //
+        //  If the next character is not a slash or closed angle bracket,
+        //  then it must be whitespace, since whitespace is required
+        //  between the end of the last attribute and the name of the next
+        //  one.
+        //
+        if (attCount)
+        {
+            if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle))
+            {
+                if (XMLReader::isWhitespace(nextCh))
+                {
+                    // Ok, skip by them and get another char
+                    fReaderMgr.getNextChar();
+                    fReaderMgr.skipPastSpaces();
+                    nextCh = fReaderMgr.peekNextChar();
+                }
+                 else
+                {
+                    // Emit the error but keep on going
+                    emitError(XML4CErrs::ExpectedWhitespace);
+                }
+            }
+        }
+
+        //
+        //  Ok, here we first check for any of the special case characters.
+        //  If its not one, then we do the normal case processing, which
+        //  assumes that we've hit an attribute value, Otherwise, we do all
+        //  the special case checks.
+        //
+        if (!XMLReader::isSpecialStartTagChar(nextCh))
+        {
+            //
+            //  Assume its going to be an attribute, so get a name from
+            //  the input.
+            //
+            if (!fReaderMgr.getName(fAttNameBuf))
+            {
+                emitError(XML4CErrs::ExpectedAttrName);
+                fReaderMgr.skipPastChar(chCloseAngle);
+                return attCount;
+            }
+
+            // And next must be an equal sign
+            if (!scanEq())
+            {
+                static const XMLCh tmpList[] =
+                {
+                    chSingleQuote, chDoubleQuote, chCloseAngle
+                    , chOpenAngle, chForwardSlash, chNull
+                };
+
+                emitError(XML4CErrs::ExpectedEqSign);
+
+                //
+                //  Try to sync back up by skipping forward until we either
+                //  hit something meaningful.
+                //
+                const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList);
+
+                if ((chFound == chCloseAngle) || (chFound == chForwardSlash))
+                {
+                    // Jump back to top for normal processing of these
+                    continue;
+                }
+                 else if ((chFound == chSingleQuote)
+                      ||  (chFound == chDoubleQuote)
+                      ||  XMLReader::isWhitespace(chFound))
+                {
+                    // Just fall through assuming that the value is to follow
+                }
+                 else if (chFound == chOpenAngle)
+                {
+                    // Assume a malformed tag and that new one is starting
+                    emitError(XML4CErrs::UnterminatedStartTag);
+                    return attCount;
+                }
+                 else
+                {
+                    // Something went really wrong
+                    return attCount;
+                }
+            }
+
+            //
+            //  Next should be the quoted attribute value. We just do a simple
+            //  and stupid scan of this value. The only thing we do here
+            //  is to expand entity references.
+            //
+            if (!basicAttrValueScan(fAttValueBuf))
+            {
+                static const XMLCh tmpList[] =
+                {
+                    chCloseAngle, chOpenAngle, chForwardSlash, chNull
+                };
+
+                emitError(XML4CErrs::ExpectedAttrValue);
+
+                //
+                //  It failed, so lets try to get synced back up. We skip
+                //  forward until we find some whitespace or one of the
+                //  chars in our list.
+                //
+                const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList);
+
+                if ((chFound == chCloseAngle)
+                ||  (chFound == chForwardSlash)
+                ||  XMLReader::isWhitespace(chFound))
+                {
+                    //
+                    //  Just fall through and process this attribute, though
+                    //  the value will be "". 
+                    //
+                }
+                 else if (chFound == chOpenAngle)
+                {
+                    // Assume a malformed tag and that new one is starting
+                    emitError(XML4CErrs::UnterminatedStartTag);
+                    return attCount;
+                }
+                 else
+                {
+                    // Something went really wrong
+                    return attCount;
+                }
+            }
+
+            //
+            //  Make sure that the name is basically well formed for namespace
+            //  enabled rules. It either has no colons, or it has one which
+            //  is neither the first or last char.
+            //
+            const int colonFirst = XMLString::indexOf(fAttNameBuf.getRawBuffer(), chColon);
+            if (colonFirst != -1)
+            {
+                const int colonLast = XMLString::lastIndexOf(fAttNameBuf.getRawBuffer(), chColon);
+
+                if (colonFirst != colonLast)
+                {
+                    emitError(XML4CErrs::TooManyColonsInName);
+                    continue;
+                }
+                 else if ((colonFirst == 0)
+                      ||  (colonLast == (int)fAttNameBuf.getLen() - 1))
+                {
+                    emitError(XML4CErrs::InvalidColonPos);
+                    continue;
+                }
+            }
+
+
+            //
+            //  And now lets add it to the passed collection. If we have not
+            //  filled it up yet, then we use the next element. Else we add
+            //  a new one.
+            //
+            KVStringPair* curPair = 0;
+            if (attCount >= curVecSize)
+            {
+                curPair = new KVStringPair
+                (
+                    fAttNameBuf.getRawBuffer()
+                    , fAttValueBuf.getRawBuffer()
+                );
+                toFill.addElement(curPair);
+            }
+             else
+            {
+                curPair = toFill.elementAt(attCount);
+                curPair->set(fAttNameBuf.getRawBuffer(), fAttValueBuf.getRawBuffer());
+            }
+
+            // And bump the count of attributes we've gotten
+            attCount++;
+
+            // And go to the top again for another attribute
+            continue;
+        }
+
+        //
+        //  It was some special case character so do all of the checks and
+        //  deal with it.
+        //
+        if (!nextCh)
+            ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+
+        if (nextCh == chForwardSlash)
+        {
+            fReaderMgr.getNextChar();
+            if (fReaderMgr.skippedChar(chCloseAngle))
+            {
+                isEmpty = true;
+                break;
+            }
+        }
+         else if (nextCh == chCloseAngle)
+        {
+            fReaderMgr.getNextChar();
+            break;
+        }
+         else if (nextCh == chOpenAngle)
+        {
+            //
+            //  Check for this one specially, since its going to be common
+            //  and it is kind of auto-recovering since we've already hit the
+            //  next open bracket, which is what we would have seeked to (and
+            //  skipped this whole tag.)
+            //
+            emitError(XML4CErrs::UnterminatedStartTag);
+            break;
+        }
+         else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote))
+        {
+            //
+            //  Check for this one specially, which is probably a missing
+            //  attribute name, e.g. ="value". Just issue expected name
+            //  error and eat the quoted string, then jump back to the
+            //  top again.
+            //
+            emitError(XML4CErrs::ExpectedAttrName);
+            fReaderMgr.getNextChar();
+            fReaderMgr.skipQuotedString(nextCh);
+            fReaderMgr.skipPastSpaces();
+            continue;
+        }
+    }
+
+    return attCount;
+}
+
+
+//
+//  This method will kick off the scanning of the primary content of the
+//  document, i.e. the elements.
+//
+bool XMLScanner::scanContent(const bool extEntity)
+{
+    //
+    //  Go into a loop until we hit the end of the root element, or we fall
+    //  out because there is no root element.
+    //
+    //  We have to do kind of a deeply nested double loop here in order to
+    //  avoid doing the setup/teardown of the exception handler on each
+    //  round. Doing it this way we only do it when an exception actually
+    //  occurs.
+    //
+    bool gotData = true;
+    bool inMarkup = false;
+    while (gotData)
+    {
+        try
+        {
+            while (gotData)
+            {
+                //  Sense what the next top level token is. According to what
+                //  this tells us, we will call something to handle that kind
+                //  of thing.
+                //
+                unsigned int orgReader;
+                const XMLTokens curToken = senseNextToken(orgReader);
+
+                //
+                //  Handle character data and end of file specially. Char data
+                //  is not markup so we don't want to handle it in the loop
+                //  below.
+                //
+                if (curToken == Token_CharData)
+                {
+                    //
+                    //  Scan the character data and call appropriate events. Let
+                    //  him use our local character data buffer for efficiency.
+                    //
+                    scanCharData(fCDataBuf);
+                    continue;
+                }
+                 else if (curToken == Token_EOF)
+                {
+                    //
+                    //  The element stack better be empty at this point or we
+                    //  ended prematurely before all elements were closed.
+                    //
+                    if (!fElemStack.isEmpty())
+                    {
+                        const ElemStack::StackElem* topElem = fElemStack.popTop();
+                        emitError
+                        (
+                            XML4CErrs::EndedWithTagsOnStack
+                            , topElem->fThisElement->getFullName()
+                        );
+                    }
+
+                    // Its the end of file, so clear the got data flag
+                    gotData = false;
+                    continue;
+                }
+
+                // We are in some sort of markup now
+                inMarkup = true;
+
+                //
+                //  According to the token we got, call the appropriate
+                //  scanning method.
+                //
+                switch(curToken)
+                {
+                    case Token_CData :
+                        // Make sure we are within content
+                        if (fElemStack.isEmpty())
+                            emitError(XML4CErrs::CDATAOutsideOfContent);
+                        scanCDSection();
+                        break;
+
+                    case Token_Comment :
+                        scanComment();
+                        break;
+
+                    case Token_EndTag :
+                        scanEndTag(gotData);
+                        break;
+
+                    case Token_PI :
+                        scanPI();
+                        break;
+
+                    case Token_StartTag :
+                        if (fDoNamespaces)
+                            scanStartTagNS(gotData);
+                        else
+                            scanStartTag(gotData);
+                        break;
+
+                    default :
+                        fReaderMgr.skipToChar(chOpenAngle);
+                        break;
+                }
+
+                if (orgReader != fReaderMgr.getCurrentReaderNum())
+                    emitError(XML4CErrs::PartialMarkupInEntity);
+
+                // And we are back out of markup again
+                inMarkup = false;
+            }
+        }
+
+        catch(const EndOfEntityException& toCatch)
+        {
+            //
+            //  If we were in some markup when this happened, then its a
+            //  partial markup error.
+            //
+            if (inMarkup)
+                emitError(XML4CErrs::PartialMarkupInEntity);
+
+            // Send an end of entity reference event
+            if (fDocHandler)
+                fDocHandler->endEntityReference(toCatch.getEntity());
+
+            inMarkup = false;
+        }
+    }
+
+    // It went ok, so return success
+    return true;
+}
+
+
+void XMLScanner::scanEndTag(bool& gotData)
+{
+    //
+    //  Assume we will still have data until proven otherwise. It will only
+    //  ever be false if this is the end of the root element.
+    //
+    gotData = true;
+
+    //
+    //  Check if the element stack is empty. If so, then this is an unbalanced
+    //  element (i.e. more ends than starts, perhaps because of bad text
+    //  causing one to be skipped.)
+    //
+    if (fElemStack.isEmpty())
+    {
+        emitError(XML4CErrs::MoreEndThanStartTags);
+        fReaderMgr.skipPastChar(chCloseAngle);
+        ThrowXML(RuntimeException, XML4CExcepts::Scan_UnbalancedStartEnd);
+    }
+
+    // After the </ is the element QName, so get a name from the input
+    XMLBufBid bbQName(&fBufMgr);
+    XMLBuffer& qnameBuf = bbQName.getBuffer();
+    if (!fReaderMgr.getName(qnameBuf))
+    {
+        // It failed so we can't really do anything with it
+        emitError(XML4CErrs::ExpectedElementName);
+        fReaderMgr.skipPastChar(chCloseAngle);
+        return;
+    }
+
+    unsigned int elemId;
+    unsigned int uriId = 0;
+    if (fDoNamespaces)
+    {
+        XMLBufBid bbName(&fBufMgr);
+        XMLBufBid bbPrefix(&fBufMgr);
+        uriId = resolveQName
+        (
+            qnameBuf.getRawBuffer()
+            , bbName.getBuffer()
+            , bbPrefix.getBuffer()
+            , ElemStack::Mode_Element
+        );
+
+        //
+        //  Ask the validator for the element id for the {uri}name we got. He owns
+        //  the element decl pool.
+        //
+        elemId = fValidator->findElemId
+        (
+            uriId
+            , bbName.getBuffer().getRawBuffer()
+            , qnameBuf.getRawBuffer()
+        );
+    }
+     else
+    {
+        elemId = fValidator->findElemId(0, 0, qnameBuf.getRawBuffer());
+    }
+
+    //
+    //  Pop the stack of the element we are supposed to be ending. Remember
+    //  that we don't own this. The stack just keeps them and reuses them.
+    //
+    //  NOTE: We CANNOT do this until we've resolved the element name because
+    //  the element stack top contains the prefix to URI mappings for this
+    //  element.
+    //
+    const ElemStack::StackElem* topElem = fElemStack.popTop();
+
+    // Make sure that its the end of the element that we expect
+    if (topElem->fThisElement->getId() != elemId)
+    {
+        emitError
+        (
+            XML4CErrs::ExpectedEndOfTagX
+            , topElem->fThisElement->getFullName()
+        );
+    }
+
+    // Make sure we are back on the same reader as where we started
+    if (topElem->fReaderNum != fReaderMgr.getCurrentReaderNum())
+        emitError(XML4CErrs::PartialTagMarkupError);
+
+    // See if it was the root element, to avoid multiple calls below
+    const bool isRoot = fElemStack.isEmpty();
+
+    // Skip optional whitespace
+    fReaderMgr.skipPastSpaces();
+
+    // Make sure we find the closing bracket
+    if (!fReaderMgr.skippedChar(chCloseAngle))
+        emitError(XML4CErrs::UnterminatedEndTag);
+
+    // If we have a doc handler, tell it about the end tag
+    if (fDocHandler)
+    {
+        fDocHandler->endElement
+        (
+            *topElem->fThisElement
+            , uriId
+            , isRoot
+        );
+    }
+
+    //
+    //  If validation is enabled, then lets pass him the list of children and
+    //  this element and let him validate it.
+    //
+    if (fDoValidation)
+    {
+        int res = fValidator->checkContent
+        (
+            topElem->fThisElement->getId()
+            , topElem->fChildIds
+            , topElem->fChildCount
+        );
+
+        if (res >= 0)
+        {
+            //
+            //  One of the elements is not valid for the content.
+            //  NOTE that if no children were provided but the
+            //  content model requires them, it comes back with
+            //  a zero value. But we cannot use that to index
+            //  the child array in this case, and have to put
+            //  out a special message.
+            //
+            if (!topElem->fChildCount)
+            {
+                fValidator->emitError
+                (
+                    XML4CValid::EmptyNotValidForContent
+                    , topElem->fThisElement->getFormattedContentModel(*fValidator)
+                );
+            }
+             else if ((unsigned int)res >= topElem->fChildCount)
+            {
+                fValidator->emitError
+                (
+                    XML4CValid::NotEnoughElemsForCM
+                    , topElem->fThisElement->getFormattedContentModel(*fValidator)
+                );
+            }
+             else
+            {
+                // Find the element decl for the evil spawn
+                XMLElementDecl* decl = fValidator->getElemDecl
+                (
+                    topElem->fChildIds[res]
+                );
+
+                fValidator->emitError
+                (
+                    XML4CValid::ElementNotValidForContent
+                    , decl->getFullName()
+                    , topElem->fThisElement->getFormattedContentModel(*fValidator)
+                );
+            }
+        }
+    }
+
+    // If this was the root, then done with content
+    gotData = !isRoot;
+}
+
+
+//
+//  This method is called after the end of the root element, to handle
+//  any miscellaneous stuff hanging around.
+//
+void XMLScanner::scanMiscellaneous()
+{
+    // Get a buffer for this work
+    XMLBufBid bbCData(&fBufMgr);
+
+    while (true)
+    {
+        try
+        {
+            const XMLCh nextCh = fReaderMgr.peekNextChar();
+
+            // Watch for end of file and break out
+            if (!nextCh)
+                break;
+
+            if (nextCh == chOpenAngle)
+            {
+                if (fReaderMgr.skippedString(XMLUni::fgXMLStringSpace))
+                {
+                    // Can't have an XML decl here
+                    emitError(XML4CErrs::NotValidAfterContent);
+                    fReaderMgr.skipPastChar(chCloseAngle);
+                }
+                 else if (fReaderMgr.skippedString(XMLUni::fgPIString))
+                {
+                    scanPI();
+                }
+                 else if (fReaderMgr.skippedString(XMLUni::fgCommentString))
+                {
+                    scanComment();
+                }
+                 else
+                {
+                    // This can't be possible, so just give up
+                    emitError(XML4CErrs::ExpectedCommentOrPI);
+                    fReaderMgr.skipPastChar(chCloseAngle);
+                }
+            }
+             else if (XMLReader::isWhitespace(nextCh))
+            {
+                //
+                //  If we have a doc handler, then gather up the spaces and
+                //  call back. Otherwise, just skip over whitespace.
+                //
+                if (fDocHandler)
+                {
+                    fReaderMgr.getSpaces(bbCData.getBuffer());
+                    fDocHandler->ignorableWhitespace
+                    (
+                        bbCData.getRawBuffer()
+                        , bbCData.getLen()
+                        , false
+                    );
+                }
+                 else
+                {
+                    fReaderMgr.skipPastSpaces();
+                }
+            }
+             else
+            {
+                emitError(XML4CErrs::ExpectedCommentOrPI);
+                fReaderMgr.skipPastChar(chCloseAngle);
+            }
+        }
+
+        catch(const EndOfEntityException&)
+        {
+            //
+            //  Some entity leaked out of the content part of the document. Issue
+            //  a warning and keep going.
+            //
+            emitError(XML4CErrs::EntityPropogated);
+        }
+    }
+}
+
+
+//
+//  Scans a PI and calls the appropriate callbacks. At entry we have just
+//  scanned the <? part, and need to now start on the PI target name.
+//
+void XMLScanner::scanPI()
+{
+    const XMLCh* namePtr = 0;
+    const XMLCh* targetPtr = 0;
+
+    // And skip any subsequent spaces before the name
+    fReaderMgr.skipPastSpaces();
+
+    // Get a buffer for the PI name and scan it in
+    XMLBufBid bbName(&fBufMgr);
+    if (!fReaderMgr.getNameToken(bbName.getBuffer()))
+    {
+        emitError(XML4CErrs::PINameExpected);
+        fReaderMgr.skipPastChar(chCloseAngle);
+        return;
+    }
+
+    // Point the name pointer at the raw data
+    namePtr = bbName.getRawBuffer();
+
+    // See if it is some form of 'xml' and emit a warning
+    if (!XMLString::compareIString(namePtr, XMLUni::fgXMLString))
+        emitError(XML4CErrs::NoPIStartsWithXML);
+
+    // If namespaces are enabled, then no colons allowed
+    if (fDoNamespaces)
+    {
+        if (XMLString::indexOf(namePtr, chColon) != -1)
+            emitError(XML4CErrs::ColonNotLegalWithNS);
+    }
+
+    //
+    //  If we don't hit a space next, then the PI has no target. If we do
+    //  then get out the target. Get a buffer for it as well
+    //
+    XMLBufBid bbTarget(&fBufMgr);
+    if (fReaderMgr.skippedSpace())
+    {
+        // Skip any leading spaces
+        fReaderMgr.skipPastSpaces();
+
+        // It does have a target, so lets move on to deal with that.
+        while (1)
+        {
+            const XMLCh nextCh = fReaderMgr.getNextChar();
+
+            // Watch for an end of file, which is always bad here
+            if (!nextCh)
+            {
+                emitError(XML4CErrs::UnterminatedPI);
+                ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+            }
+
+            // Watch for potential terminating character
+            if (nextCh == chQuestion)
+            {
+                // It must be followed by '>' to be a termination of the target
+                if (fReaderMgr.skippedChar(chCloseAngle))
+                    break;
+            }
+
+            // Watch for invalid chars but try to keep going
+            if (!XMLReader::isXMLChar(nextCh))
+                emitError(XML4CErrs::InvalidCharacter);
+
+            bbTarget.append(nextCh);
+        }
+    }
+     else
+    {
+        // No target, but make sure its terminated ok
+        if (!fReaderMgr.skippedChar(chQuestion))
+        {
+            emitError(XML4CErrs::UnterminatedPI);
+            fReaderMgr.skipPastChar(chCloseAngle);
+            return;
+        }
+
+        if (!fReaderMgr.skippedChar(chCloseAngle))
+        {
+            emitError(XML4CErrs::UnterminatedPI);
+            fReaderMgr.skipPastChar(chCloseAngle);
+            return;
+        }
+    }
+
+    // Point the target pointer at the raw data
+    targetPtr = bbTarget.getRawBuffer();
+
+    // If we have a handler, then call it
+    if (fDocHandler)
+    {
+        fDocHandler->docPI
+        (
+            namePtr
+            , targetPtr
+       );
+    }
+}
+
+
+//
+//  Scans all the input from the start of the file to the root element.
+//  There does not have to be anything in the prolog necessarily, but usually
+//  there is at least an XMLDecl.
+//
+//  On exit from here we are either at the end of the file or about to read
+//  the opening < of the root element.
+//
+void XMLScanner::scanProlog()
+{
+    // Get a buffer for whitespace processing
+    XMLBufBid bbCData(&fBufMgr);
+
+    //
+    //  Loop through the prolog. If there is no content, this could go all
+    //  the way to the end of the file.
+    //
+    //  Note that we use a double loop here to avoid the overhead of the
+    //  setup/teardown of the exception handler on each loop.
+    //
+    bool  acceptXMLDecl = true;
+    while (true)
+    {
+    try
+    {
+        while (true)
+        {
+            const XMLCh nextCh = fReaderMgr.peekNextChar();
+
+            // An end of file is legal here between markup
+            if (!nextCh)
+                return;
+
+            if (nextCh == chOpenAngle)
+            {
+                //
+                //  Ok, it could be the xml decl, a comment, the doc type line,
+                //  or the start of the root element.
+                //
+                if (fReaderMgr.skippedString(XMLUni::fgXMLDeclStringSpace))
+                {
+                    //
+                    //  If we are not at line 1, col 7, then the decl was not
+                    //  the first text, so its invalid.
+                    //
+                    const XMLReader* curReader = fReaderMgr.getCurrentReader();
+                    if ((curReader->getLineNumber() != 1)
+                    ||  (curReader->getColumnNumber() != 7))
+                    {
+                        emitError(XML4CErrs::XMLDeclMustBeFirst);
+                    }
+                    scanXMLDecl(Decl_XML);
+                }
+                 else if (fReaderMgr.skippedString(XMLUni::fgPIString))
+                {
+                    scanPI();
+                }
+                 else if (fReaderMgr.skippedString(XMLUni::fgCommentString))
+                {
+                    scanComment();
+                }
+                 else if (fReaderMgr.skippedString(XMLUni::fgDocTypeString))
+                {
+                    //
+                    //  We have a doc type. So, ask the validator if it
+                    //  supports DTD scanning. if so, let it scan the
+                    //  DTD.
+                    //
+                    if (fValidator->handlesDTD())
+                        fValidator->scanDTD(fReuseValidator);
+                    else
+                        ThrowXML(RuntimeException, XML4CExcepts::Gen_NoDTDValidator);
+                }
+                 else
+                {
+                    // Assume its the start of the root element
+                    return;
+                }
+            }
+             else if (XMLReader::isWhitespace(nextCh))
+            {
+                //
+                //  If we have a document handler then gather up the
+                //  whitespace and call back. Otherwise just skip over spaces.
+                //
+                if (fDocHandler)
+                {
+                    fReaderMgr.getSpaces(bbCData.getBuffer());
+                    fDocHandler->ignorableWhitespace
+                    (
+                        bbCData.getRawBuffer()
+                        , bbCData.getLen()
+                        , false
+                    );
+                }
+                 else
+                {
+                    fReaderMgr.skipPastSpaces();
+                }
+            }
+             else
+            {
+                emitError(XML4CErrs::InvalidDocumentStructure);
+                fReaderMgr.skipPastChar(chCloseAngle);
+            }
+
+            //
+            //  Once we make it around once, then we cannot accept the XML
+            //  decl now, since it must be first if present.
+            //
+            acceptXMLDecl = false;
+        }
+    }
+
+    catch(const EndOfEntityException&)
+    {
+        //
+        //  We should never get an end of entity here. They should only
+        //  occur within the doc type scanning method, and not leak out to
+        //  here.
+        //
+        emitError
+        (
+            XML4CErrs::UnexpectedEOE
+            , "in prolog"
+        );
+    }
+    }
+}
+
+
+bool XMLScanner::scanStartTag(bool& gotData)
+{
+    //
+    //  Assume we will still have data until proven otherwise. It will only
+    //  ever be false if this is the root and its empty.
+    //
+    gotData = true;
+
+    //
+    //  Get the QName. In this case, we are not doing namespaces, so we just
+    //  use it as is and don't have to break it into parts.
+    //
+    if (!fReaderMgr.getName(fQNameBuf))
+    {
+        emitError(XML4CErrs::ExpectedElementName);
+        fReaderMgr.skipToChar(chOpenAngle);
+        return false;
+    }
+
+    // Assume it won't be an empty tag
+    bool isEmpty = false;
+
+    //
+    //  Lets try to look up the element in the validator's element decl pool
+    //  We can pass bogus values for the URI id and the base name. We know that
+    //  this can only be called if we are doing a DTD style validator and that
+    //  he will only look at the QName.
+    //
+    //  We tell him to fault in a decl if he does not find one.
+    //
+    bool wasAdded;
+    XMLElementDecl* elemDecl = fValidator->findElemDecl
+    (
+        0
+        , 0
+        , fQNameBuf.getRawBuffer()
+        , XMLValidator::AddIfNotFound
+        , wasAdded
+    );
+
+    //
+    //  We do something different here according to whether we found the
+    //  element or not.
+    //
+    if (wasAdded)
+    {
+        // If validating then emit an error
+        if (fDoValidation)
+        {
+            fValidator->emitError
+            (
+                XML4CValid::ElementNotDefined
+                , elemDecl->getFullName()
+            );
+        }
+
+        //
+        //  If we are not validating, then mark it as declared since it makes
+        //  things simpler and we aren't going to do do the validation checks
+        //  that need to know if it was really declared or not anyway.
+        //
+        if (!fDoValidation)
+            elemDecl->setCreateReason(XMLElementDecl::Declared);
+    }
+     else
+    {
+        // If its not marked declared and validating, then emit an error
+        if (!elemDecl->isDeclared() && fDoValidation)
+        {
+            fValidator->emitError
+            (
+                XML4CValid::ElementNotDefined
+                , elemDecl->getFullName()
+            );
+        }
+    }
+
+    // See if its the root element
+    const bool isRoot = fElemStack.isEmpty();
+
+    // Expand the element stack and add the new element
+    fElemStack.addLevel(elemDecl, fReaderMgr.getCurrentReaderNum());
+
+    //
+    //  If this is the first element and we are validating, check the root
+    //  element. This may or may not have any meaning for the installed
+    //  validator, in which case it may just always return success. Some
+    //  validators will treat any element as the root.
+    //
+    if (isRoot)
+    {
+        if (fDoValidation)
+        {
+            if (!fValidator->checkRootElement(elemDecl->getId()))
+                fValidator->emitError(XML4CValid::RootElemNotLikeDocType);
+        }
+    }
+     else
+    {
+        //
+        //  If the element stack is not empty, then add this element as a
+        //  child of the previous top element. If its empty, this is the root
+        //  elem and is not the child of anything.
+        //
+        fElemStack.addChild(elemDecl->getId(), true);
+    }
+
+    //
+    //  Ask the element decl to clear out the 'provided' flag on all of its
+    //  att defs.
+    //
+    elemDecl->resetDefs();
+
+    // Skip any whitespace after the name
+    fReaderMgr.skipPastSpaces();
+
+    //
+    //  We loop until we either see a /> or >, handling attribute/value
+    //  pairs until we get there.
+    //
+    unsigned int    attCount = 0;
+    unsigned int    curAttListSize = fAttrList->size();
+    while (true)
+    {
+        // And get the next non-space character
+        XMLCh nextCh = fReaderMgr.peekNextChar();
+
+        //
+        //  If the next character is not a slash or closed angle bracket,
+        //  then it must be whitespace, since whitespace is required
+        //  between the end of the last attribute and the name of the next
+        //  one.
+        //
+        if (attCount)
+        {
+            if ((nextCh != chForwardSlash) && (nextCh != chCloseAngle))
+            {
+                if (XMLReader::isWhitespace(nextCh))
+                {
+                    // Ok, skip by them and peek another char
+                    fReaderMgr.skipPastSpaces();
+                    nextCh = fReaderMgr.peekNextChar();
+                }
+                 else
+                {
+                    // Emit the error but keep on going
+                    emitError(XML4CErrs::ExpectedWhitespace);
+                }
+            }
+        }
+
+        //
+        //  Ok, here we first check for any of the special case characters.
+        //  If its not one, then we do the normal case processing, which
+        //  assumes that we've hit an attribute value, Otherwise, we do all
+        //  the special case checks.
+        //
+        if (!XMLReader::isSpecialStartTagChar(nextCh))
+        {
+            //
+            //  Assume its going to be an attribute, so get a name from
+            //  the input.
+            //
+            if (!fReaderMgr.getName(fAttNameBuf))
+            {
+                emitError(XML4CErrs::ExpectedAttrName);
+                fReaderMgr.skipPastChar(chCloseAngle);
+                return false;
+            }
+
+            // And next must be an equal sign
+            if (!scanEq())
+            {
+                static const XMLCh tmpList[] =
+                {
+                    chSingleQuote, chDoubleQuote, chCloseAngle
+                    , chOpenAngle, chForwardSlash, chNull
+                };
+
+                emitError(XML4CErrs::ExpectedEqSign);
+
+                //
+                //  Try to sync back up by skipping forward until we either
+                //  hit something meaningful.
+                //
+                const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList);
+
+                if ((chFound == chCloseAngle) || (chFound == chForwardSlash))
+                {
+                    // Jump back to top for normal processing of these
+                    continue;
+                }
+                 else if ((chFound == chSingleQuote)
+                      ||  (chFound == chDoubleQuote)
+                      ||  XMLReader::isWhitespace(chFound))
+                {
+                    // Just fall through assuming that the value is to follow
+                }
+                 else if (chFound == chOpenAngle)
+                {
+                    // Assume a malformed tag and that new one is starting
+                    emitError(XML4CErrs::UnterminatedStartTag);
+                    return false;
+                }
+                 else
+                {
+                    // Something went really wrong
+                    return false;
+                }
+            }
+
+            //
+            //  See if this attribute is declared for this element. If we are
+            //  not validating of course it will not be at first, but we will
+            //  fault it into the pool (to avoid lots of redundant errors.)
+            //
+            XMLAttDef* attDef = elemDecl->findAttr
+            (
+                fAttNameBuf.getRawBuffer()
+                , 0
+                , 0
+                , XMLElementDecl::AddIfNotFound
+                , wasAdded
+            );
+
+            if (wasAdded)
+            {
+                //
+                //  If there is a validation handler, then we are validating
+                //  so emit an error.
+                //
+                if (fDoValidation)
+                {
+                    fValidator->emitError
+                    (
+                        XML4CValid::AttNotDefinedForElement
+                        , fAttNameBuf.getRawBuffer()
+                        , elemDecl->getFullName()
+                    );
+                }
+            }
+
+            //
+            //  If its already provided, then there are more than one of
+            //  this attribute in this start tag, so emit an error.
+            //
+            if (attDef->getProvided())
+            {
+                emitError
+                (
+                    XML4CErrs::AttrAlreadyUsedInSTag
+                    , attDef->getFullName()
+                    , elemDecl->getFullName()
+                );
+            }
+             else
+            {
+                // Mark this one as already seen
+                attDef->setProvided(true);
+            }
+
+            //
+            //  Skip any whitespace before the value and then scan the att
+            //  value. This will come back normalized with entity refs and
+            //  char refs expanded.
+            //
+            fReaderMgr.skipPastSpaces();
+            if (!scanAttValue(fAttValueBuf, attDef->getType()))
+            {
+                static const XMLCh tmpList[] =
+                {
+                    chCloseAngle, chOpenAngle, chForwardSlash, chNull
+                };
+
+                emitError(XML4CErrs::ExpectedAttrValue);
+
+                //
+                //  It failed, so lets try to get synced back up. We skip
+                //  forward until we find some whitespace or one of the
+                //  chars in our list.
+                //
+                const XMLCh chFound = fReaderMgr.skipUntilInOrWS(tmpList);
+
+                if ((chFound == chCloseAngle)
+                ||  (chFound == chForwardSlash)
+                ||  XMLReader::isWhitespace(chFound))
+                {
+                    //
+                    //  Just fall through and process this attribute, though
+                    //  the value will be "". 
+                    //
+                }
+                 else if (chFound == chOpenAngle)
+                {
+                    // Assume a malformed tag and that new one is starting
+                    emitError(XML4CErrs::UnterminatedStartTag);
+                    return false;
+                }
+                 else
+                {
+                    // Something went really wrong
+                    return false;
+                }
+            }
+
+            //
+            //  Now that its all stretched out, lets look at its type and
+            //  determine if it has a valid value. It will output any needed
+            //  errors, but we just keep going. We only need to do this if
+            //  we are validating.
+            //
+            if (!wasAdded)
+            {
+                // Let the validator pass judgement on the attribute value
+                fValidator->validateAttrValue
+                (
+                    *attDef
+                    , fAttValueBuf.getRawBuffer()
+                );
+            }
+
+            //
+            //  Add this attribute to the attribute list that we use to
+            //  pass them to the handler. We reuse its existing elements
+            //  but expand it as required.
+            //
+            XMLAttr* curAtt;
+            if (attCount >= curAttListSize)
+            {
+                curAtt = new XMLAttr
+                (
+                    fValidator->getGlobalNamespaceId()
+                    , fAttNameBuf.getRawBuffer()
+                    , XMLUni::fgZeroLenString
+                    , fAttValueBuf.getRawBuffer()
+                    , attDef->getType()
+                    , true
+                );
+                fAttrList->addElement(curAtt);
+            }
+             else
+            {
+                curAtt = fAttrList->elementAt(attCount);
+                curAtt->set
+                (
+                    fValidator->getGlobalNamespaceId()
+                    , fAttNameBuf.getRawBuffer()
+                    , XMLUni::fgZeroLenString
+                    , fAttValueBuf.getRawBuffer()
+                    , attDef->getType()
+                );
+                curAtt->setSpecified(true);
+            }
+            attCount++;
+
+            // And jump back to the top of the loop
+            continue;
+        }
+
+        //
+        //  It was some special case character so do all of the checks and
+        //  deal with it.
+        //
+        if (!nextCh)
+            ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+
+        if (nextCh == chForwardSlash)
+        {
+            fReaderMgr.getNextChar();
+            isEmpty = true;
+            if (!fReaderMgr.skippedChar(chCloseAngle))
+                emitError(XML4CErrs::UnterminatedStartTag);
+            break;
+        }
+         else if (nextCh == chCloseAngle)
+        {
+            fReaderMgr.getNextChar();
+            break;
+        }
+         else if (nextCh == chOpenAngle)
+        {
+            //
+            //  Check for this one specially, since its going to be common
+            //  and it is kind of auto-recovering since we've already hit the
+            //  next open bracket, which is what we would have seeked to (and
+            //  skipped this whole tag.)
+            //
+            emitError(XML4CErrs::UnterminatedStartTag);
+            break;
+        }
+         else if ((nextCh == chSingleQuote) || (nextCh == chDoubleQuote))
+        {
+            //
+            //  Check for this one specially, which is probably a missing
+            //  attribute name, e.g. ="value". Just issue expected name
+            //  error and eat the quoted string, then jump back to the
+            //  top again.
+            //
+            emitError(XML4CErrs::ExpectedAttrName);
+            scanAttValue(fAttValueBuf, XMLAttDef::CData);
+            fReaderMgr.skipPastSpaces();
+            continue;
+        }
+    }
+
+    //
+    //  Ok, so lets get an enumerator for the attributes of this element
+    //  and run through them for well formedness and validity checks. But
+    //  make sure that we had any attributes before we do it, since the list
+    //  would have have gotten faulted in anyway.
+    //
+    if (elemDecl->hasAttDefs())
+    {
+        XMLAttDefList& attDefList = elemDecl->getAttDefList();
+        while (attDefList.hasMoreElements())
+        {
+            // Get the current att def, for convenience and its def type
+            const XMLAttDef& curDef = attDefList.nextElement();
+            const XMLAttDef::DefAttTypes defType = curDef.getDefaultType();
+
+            if (!curDef.getProvided())
+            {
+                if (fDoValidation)
+                {
+                    // If we are validating and its required, then an error
+                    if (defType == XMLAttDef::Required)
+                    {
+                        fValidator->emitError
+                        (
+                            XML4CValid::RequiredAttrNotProvided
+                            , curDef.getFullName()
+                            , elemDecl->getFullName()
+                        );
+                    }
+                }
+
+                // Fault in the value if needed, and bump the att count
+                if ((defType == XMLAttDef::Default)
+                ||  (defType == XMLAttDef::Fixed))
+                {
+                    XMLAttr* curAtt;
+                    if (attCount >= curAttListSize)
+                    {
+                        curAtt = new XMLAttr
+                        (
+                            fValidator->getGlobalNamespaceId()
+                            , curDef.getFullName()
+                            , XMLUni::fgZeroLenString
+                            , curDef.getValue()
+                            , curDef.getType()
+                            , false
+                        );
+                        fAttrList->addElement(curAtt);
+                        curAttListSize++;
+                    }
+                     else
+                    {
+                        curAtt = fAttrList->elementAt(attCount);
+                        curAtt->set
+                        (
+                            fValidator->getGlobalNamespaceId()
+                            , curDef.getFullName()
+                            , XMLUni::fgZeroLenString
+                            , curDef.getValue()
+                            , curDef.getType()
+                        );
+                        curAtt->setSpecified(false);
+                    }
+                    attCount++;
+                }
+            }
+        }
+    }
+
+    //
+    //  If empty, validate content right now if we are validating and then
+    //  pop the element stack top. Else, we have to update the current stack
+    //  top's namespace mapping elements.
+    //
+    if (isEmpty)
+    {
+        // If validating, then insure that its legal to have no content
+        if (fDoValidation)
+        {
+            const int res = fValidator->checkContent(elemDecl->getId(), 0, 0);
+            if (res >= 0)
+            {
+                fValidator->emitError
+                (
+                    XML4CValid::ElementNotValidForContent
+                    , elemDecl->getFullName()
+                    , elemDecl->getFormattedContentModel(*fValidator)
+                );
+            }
+        }
+
+        // Pop the element stack back off since it'll never be used now
+        fElemStack.popTop();
+
+        // If the elem stack is empty, then it was an empty root
+        if (isRoot)
+            gotData = false;
+    }
+
+    //
+    //  If we have a document handler, then tell it about this start tag. We
+    //  don't have any URI id to send along, so send zero. We also do not send
+    //  any prefix since its just one big name if we are not doing namespaces.
+    //
+    if (fDocHandler)
+    {
+        fDocHandler->startElement
+        (
+            *elemDecl
+            , 0
+            , 0
+            , *fAttrList
+            , attCount
+            , isEmpty
+            , isRoot
+        );
+    }
+
+    return true;
+}
+
+
+//
+//
+//  This method is called to scan a start tag when we are processing
+//  namespaces. There are two different versions of this method, one for
+//  namespace aware processing an done for non-namespace aware processing.
+//
+//  This method is called after we've scanned the < of a start tag. So we
+//  have to get the element name, then scan the attributes, after which
+//  we are either going to see >, />, or attributes followed by one of those
+//  sequences.
+//
+bool XMLScanner::scanStartTagNS(bool& gotData)
+{
+    //
+    //  Assume we will still have data until proven otherwise. It will only
+    //  ever be false if this is the root and its empty.
+    //
+    gotData = true;
+
+    //
+    //  The current position is after the open bracket, so we need to read in
+    //  in the element name.
+    //
+    if (!fReaderMgr.getName(fQNameBuf))
+    {
+        emitError(XML4CErrs::ExpectedElementName);
+        fReaderMgr.skipToChar(chOpenAngle);
+        return false;
+    }
+
+    //
+    //  Do a little sanity check here. One common problem is that
+    //  badly encoded files cause getName() to exit above on a
+    //  non-name char (an invalid XML char), then the scan start
+    //  tag below fails. This is misleading, so check here that
+    //  we are looking at a valid XML char.
+    //
+    if (!XMLReader::isXMLChar(fReaderMgr.peekNextChar()))
+        emitError(XML4CErrs::InvalidCharacter);
+
+    // See if its the root element
+    const bool isRoot = fElemStack.isEmpty();
+
+    // Skip any whitespace after the name
+    fReaderMgr.skipPastSpaces();
+
+    //
+    //  First we have to do the rawest attribute scan. We don't do any
+    //  normalization of them at all, since we don't know yet what type they
+    //  might be (since we need the element decl in order to do that.)
+    //
+    bool isEmpty;
+    unsigned int attCount = rawAttrScan(*fRawAttrList, isEmpty);
+    const bool gotAttrs = (attCount != 0);
+
+    //
+    //  Now, since we might have to update the namespace map for this element,
+    //  but we don't have the element decl yet, we just tell the element stack
+    //  to expand up to get ready.
+    //
+    fElemStack.addLevel();
+
+    //
+    //  Make an initial pass through the list and find any xmlns attributes.
+    //  When we find one, send it off to be used to update the element stack's
+    //  namespace mappings.
+    //
+    if (attCount)
+    {
+        for (unsigned int index = 0; index < attCount; index++)
+        {
+            //
+            //  If either the key begins with "xmlns:" or its just plain
+            //  "xmlns", then use it to update the map.
+            //
+            const KVStringPair* curPair = fRawAttrList->elementAt(index);
+            if (!XMLString::compareNString( curPair->getKey()
+                                            , XMLUni::fgXMLNSColonString
+                                            , 6)
+            ||  !XMLString::compareString(curPair->getKey(), XMLUni::fgXMLNSString))
+            {
+                updateNSMap(curPair->getKey(), curPair->getValue());
+            }
+        }
+    }
+
+    //
+    //  Resolve the qualified name to a URI and name so that we can look up
+    //  the element decl for this element. We have now update the prefix to
+    //  namespace map so we should get the correct element now.
+    //
+    //  <TBD>
+    //  <NOTE> There is an issue here in that (when Schema comes along) if
+    //  there were defauled/fixed xmlns attributes defined for this element,
+    //  it is too late for them to affect the prefix of this element (though
+    //  technically they should.) There is no way out of this unfortunately.
+    //
+    const unsigned int uriId = resolveQName
+    (
+        fQNameBuf.getRawBuffer()
+        , fNameBuf
+        , fPrefixBuf
+        , ElemStack::Mode_Element
+    );
+
+    //
+    //  Look up the element now in the validator. This will get us back a
+    //  generic element decl object. We tell him to fault one in if he does
+    //  not find it.
+    //
+    bool wasAdded;
+    XMLElementDecl* elemDecl = fValidator->findElemDecl
+    (
+        uriId
+        , fNameBuf.getRawBuffer()
+        , fQNameBuf.getRawBuffer()
+        , XMLValidator::AddIfNotFound
+        , wasAdded
+    );
+
+    //
+    //  We do something different here according to whether we found the
+    //  element or not.
+    //
+    if (wasAdded)
+    {
+        // If validating then emit an error
+        if (fDoValidation)
+        {
+            fValidator->emitError
+            (
+                XML4CValid::ElementNotDefined
+                , elemDecl->getFullName()
+            );
+        }
+
+        //
+        //  If we are not validating, then mark it as declared since it makes
+        //  things simpler and we aren't going to do do the validation checks
+        //  that need to know if it was really declared or not anyway.
+        //
+        if (!fDoValidation)
+            elemDecl->setCreateReason(XMLElementDecl::Declared);
+    }
+     else
+    {
+        // If its not marked declared and validating, then emit an error
+        if (!elemDecl->isDeclared() && fDoValidation)
+        {
+            fValidator->emitError
+            (
+                XML4CValid::ElementNotDefined
+                , elemDecl->getFullName()
+            );
+        }
+    }
+
+    //
+    //  Now we can update the element stack to set the current element
+    //  decl. We expanded the stack above, but couldn't store the element
+    //  decl because we didn't know it yet.
+    //
+    fElemStack.setElement(elemDecl, fReaderMgr.getCurrentReaderNum());
+
+    //
+    //  If this is the first element and we are validating, check the root
+    //  element. This may or may not have any meaning for the installed
+    //  validator, in which case it may just always return success. Some
+    //  validators will treat any element as the root.
+    //
+    if (isRoot)
+    {
+        if (fDoValidation)
+        {
+            if (!fValidator->checkRootElement(elemDecl->getId()))
+                fValidator->emitError(XML4CValid::RootElemNotLikeDocType);
+        }
+    }
+     else
+    {
+        //
+        //  If the element stack is not empty, then add this element as a
+        //  child of the previous top element. If its empty, this is the root
+        //  elem and is not the child of anything.
+        //
+        fElemStack.addChild(elemDecl->getId(), true);
+    }
+
+    //
+    //  Now lets get the fAttrList filled in. This involves faulting in any
+    //  defaulted and fixed attributes and normalizing the values of any that
+    //  we got explicitly.
+    //
+    //  We update the attCount value with the total number of attributes, but
+    //  it goes in with the number of values we got during the raw scan of
+    //  explictly provided attrs above.
+    //
+    attCount = buildAttList(*fRawAttrList, attCount, *elemDecl, *fAttrList);
+
+    //
+    //  If empty, validate content right now if we are validating and then
+    //  pop the element stack top. Else, we have to update the current stack
+    //  top's namespace mapping elements.
+    //
+    if (isEmpty)
+    {
+        // Pop the element stack back off since it'll never be used now
+        fElemStack.popTop();
+
+        // If validating, then insure that its legal to have no content
+        if (fDoValidation)
+        {
+            const int res = fValidator->checkContent(elemDecl->getId(), 0, 0);
+            if (res >= 0)
+            {
+                fValidator->emitError
+                (
+                    XML4CValid::ElementNotValidForContent
+                    , elemDecl->getFullName()
+                    , elemDecl->getFormattedContentModel(*fValidator)
+                );
+            }
+        }
+
+        // If the elem stack is empty, then it was an empty root
+        if (isRoot)
+            gotData = false;
+    }
+
+    // If we have a document handler, then tell it about this start tag
+    if (fDocHandler)
+    {
+        fDocHandler->startElement
+        (
+            *elemDecl
+            , uriId
+            , fPrefixBuf.getRawBuffer()
+            , *fAttrList
+            , attCount
+            , isEmpty
+            , isRoot
+        );
+    }
+
+    return true;
+}
+
+
+//
+//  Scans the <?xml .... ?> line. This stuff is all sequential so we don't
+//  do any state machine loop here. We just bull straight through it. It ends
+//  past the closing bracket. If there is a document handler, then its called
+//  on the XMLDecl callback.
+//
+//  On entry, the <?xml has been scanned, and we pick it up from there.
+//
+//  NOTE: In order to provide good recovery from bad XML here, we try to be
+//  very flexible. No matter what order the stuff is in, we'll keep going
+//  though we'll issue errors.
+//
+//  The parameter tells us which type of decl we should expect, Text or XML.
+//
+void XMLScanner::scanXMLDecl(const DeclTypes type)
+{
+    // Get us some buffers to use
+    XMLBufBid bbVersion(&fBufMgr);
+    XMLBufBid bbEncoding(&fBufMgr);
+    XMLBufBid bbStand(&fBufMgr);
+    XMLBufBid bbDummy(&fBufMgr);
+    XMLBufBid bbName(&fBufMgr);
+
+    //
+    //  We use this little enum and array to keep up with what we found
+    //  and what order we found them in. This lets us get them free form
+    //  without too much overhead, but still know that they were in the
+    //  wrong order.
+    //
+    enum Strings
+    {
+        VersionString
+        , EncodingString
+        , StandaloneString
+        , UnknownString
+
+        , StringCount
+    };
+    int flags[StringCount] = { -1, -1, -1, -1 };
+
+    //
+    //  Also set up a list of buffers in the right order so that we know
+    //  where to put stuff.
+    //
+    XMLBuffer* buffers[StringCount] =
+    {
+        &bbVersion.getBuffer()
+        , &bbEncoding.getBuffer()
+        , &bbStand.getBuffer()
+        , &bbDummy.getBuffer()
+    };
+
+    int curCount = 0;
+    Strings curString;
+    XMLBuffer& nameBuf = bbName.getBuffer();
+    while (true)
+    {
+        // Skip any spaces
+        const unsigned int spaceCount = fReaderMgr.skipPastSpaces();
+
+        // If we are looking at a question mark, then break out
+        if (fReaderMgr.lookingAtChar(chQuestion))
+            break;
+
+        // If this is not the first string, then we require the spaces
+        if (!spaceCount && curCount)
+            emitError(XML4CErrs::ExpectedWhitespace);
+
+        //
+        //  Get characters up to the next whitespace or equal's sign.
+        //
+        if (!scanUpToWSOr(nameBuf, chEqual))
+            emitError(XML4CErrs::ExpectedDeclString);
+
+        // See if it matches any of our expected strings
+        if (!XMLString::compareString(nameBuf.getRawBuffer(), XMLUni::fgVersionString))
+            curString = VersionString;
+        else if (!XMLString::compareString(nameBuf.getRawBuffer(), XMLUni::fgEncodingString))
+            curString = EncodingString;
+        else if (!XMLString::compareString(nameBuf.getRawBuffer(), XMLUni::fgStandaloneString))
+            curString = StandaloneString;
+        else
+            curString = UnknownString;
+
+        //
+        //  If its an unknown string, then give that error. Else check to
+        //  see if this one has been done already and give that error.
+        //
+        if (curString == UnknownString)
+            emitError(XML4CErrs::ExpectedDeclString, nameBuf.getRawBuffer());
+        else if (flags[curString] != -1)
+            emitError(XML4CErrs::DeclStringRep, nameBuf.getRawBuffer());
+        else if (flags[curString] == -1)
+            flags[curString] = ++curCount;
+
+        //
+        //  Scan for an equal's sign. If we don't find it, issue an error
+        //  but keep trying to go on.
+        //
+        if (!scanEq())
+            emitError(XML4CErrs::ExpectedEqSign);
+
+        //
+        //  Get a quote string into the buffer for the string that we are
+        //  currently working on.
+        //
+        if (!getQuotedString(*buffers[curString]))
+        {
+            emitError(XML4CErrs::ExpectedQuotedString);
+            fReaderMgr.skipPastChar(chCloseAngle);
+            return;
+        }
+
+        // And validate the value according which one it was
+        const XMLCh* rawValue = buffers[curString]->getRawBuffer();
+        if (curString == VersionString)
+        {
+            if (XMLString::compareString(rawValue, XMLUni::fgSupportedVersion))
+                emitError(XML4CErrs::UnsupportedXMLVersion);
+        }
+         else if (curString == EncodingString)
+        {
+            if (!XMLString::stringLen(rawValue))
+                emitError(XML4CErrs::BadXMLEncoding);
+        }
+         else if (curString == StandaloneString)
+        {
+            if (!XMLString::compareString(rawValue, XMLUni::fgYesString))
+                fStandalone = true;
+            else if (!XMLString::compareString(rawValue, XMLUni::fgNoString))
+                fStandalone = false;
+            else
+            {
+                emitError(XML4CErrs::BadStandalone);
+                if (!XMLString::compareIString(rawValue, XMLUni::fgYesString))
+                    fStandalone = true;
+                else if (!XMLString::compareIString(rawValue, XMLUni::fgNoString))
+                    fStandalone = false;
+            }
+        }
+    }
+
+    //
+    //  Make sure that the strings present are in order. We don't care about
+    //  which ones are present at this point, just that any there are in the
+    //  right order.
+    //
+    int curTop = 0;
+    for (int index = VersionString; index < StandaloneString; index++)
+    {
+        if (flags[index] != -1)
+        {
+            if (flags[index] !=  curTop + 1)
+            {
+                emitError(XML4CErrs::DeclStringsInWrongOrder);
+                break;
+            }
+            curTop = flags[index];
+        }
+    }
+
+    //
+    //  If its an XML decl, the version must be present. If its a Text decl
+    //  then standalone must not be present.
+    //
+    if ((type == Decl_XML) && (flags[VersionString] == -1))
+        emitError(XML4CErrs::XMLVersionRequired);
+    else if ((type == Decl_Text) && (flags[StandaloneString] != -1))
+        emitError(XML4CErrs::StandaloneNotLegal);
+
+    if (!fReaderMgr.skippedChar(chQuestion))
+    {
+        emitError(XML4CErrs::UnterminatedXMLDecl);
+        fReaderMgr.skipPastChar(chCloseAngle);
+    }
+     else if (!fReaderMgr.skippedChar(chCloseAngle))
+    {
+        emitError(XML4CErrs::UnterminatedXMLDecl);
+        fReaderMgr.skipPastChar(chCloseAngle);
+    }
+
+    //
+    //  If we have a document handler then call the XML Decl callback.
+    //
+    //  !NOTE! Do this before we possibly update the reader with the
+    //  actual encoding string. Otherwise, we will pass the wrong thing
+    //  for the last parameter!
+    //
+    if (fDocHandler)
+    {
+        fDocHandler->XMLDecl
+        (
+            bbVersion.getRawBuffer()
+            , bbEncoding.getRawBuffer()
+            , bbStand.getRawBuffer()
+            , fReaderMgr.getCurrentEncodingStr()
+        );
+    }
+
+    //
+    //  Ok, we've now seen the real encoding string, if there was one, so
+    //  lets call back on the current reader and tell it what the real
+    //  encoding string was. If it fails, that's because it represents some
+    //  sort of contradiction with the autosensed format, and it keeps the
+    //  original encoding.
+    //
+    //  NOTE: This can fail for a number of reasons, such as a bogus encoding
+    //  name or because its in flagrant contradiction of the auto-sensed
+    //  format.
+    //
+    if (flags[EncodingString] != -1)
+    {
+        if (!fReaderMgr.getCurrentReader()->setEncoding(bbEncoding.getRawBuffer()))
+            emitError(XML4CErrs::ContradictoryEncoding, bbEncoding.getRawBuffer());
+    }
+}
diff --git a/src/internal/XMLScanner.hpp b/src/internal/XMLScanner.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..eb829e68f223758d316c56ecfe11cf196261e6f8
--- /dev/null
+++ b/src/internal/XMLScanner.hpp
@@ -0,0 +1,631 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:23  twl
+ * Initial revision
+ *
+ * Revision 1.4  1999/11/08 20:44:52  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#if !defined(XMLSCANNER_HPP)
+#define XMLSCANNER_HPP
+
+#include <util/KVStringPair.hpp>
+#include <util/RefVectorOf.hpp>
+#include <util/XMLString.hpp>
+#include <framework/XMLAttr.hpp>
+#include <framework/XMLBufferMgr.hpp>
+#include <framework/XMLErrorCodes.hpp>
+#include <framework/XMLRefInfo.hpp>
+#include <framework/XMLPScanToken.hpp>
+#include <internal/ElemStack.hpp>
+#include <internal/ReaderMgr.hpp>
+
+class InputSource;
+class XMLDocumentHandler;
+class XMLDocumentTypeHandler;
+class XMLElementDecl;
+class XMLEntityHandler;
+class XMLErrorReporter;
+class XMLMsgLoader;
+class XMLValidator;
+
+
+//
+//  This is the mondo scanner class, which does the vast majority of the
+//  work of parsing. It handles reading in input and spitting out events
+//  to installed handlers.
+//
+class XMLPARSER_EXPORT XMLScanner
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Public class types
+    //
+    //  NOTE: These should really be private, but some of the compilers we
+    //  have to deal with are too stupid to understand this.
+    //
+    //  DeclTypes
+    //      Used by scanXMLDecl() to know what type of decl it should scan.
+    //      Text decls have slightly different rules from XMLDecls.
+    //
+    //  EntityExpRes
+    //      These are the values returned from the entity expansion method,
+    //      to indicate how it went.
+    //
+    //  XMLTokens
+    //      These represent the possible types of input we can get while
+    //      scanning content.
+    // -----------------------------------------------------------------------
+    enum DeclTypes
+    {
+        Decl_Text
+        , Decl_XML
+    };
+
+    enum EntityExpRes
+    {
+        EntityExp_Pushed
+        , EntityExp_Returned
+        , EntityExp_Failed
+    };
+
+    enum XMLTokens 
+    {
+        Token_CData
+        , Token_CharData
+        , Token_Comment
+        , Token_EndTag
+        , Token_EOF
+        , Token_PI
+        , Token_StartTag
+        , Token_Unknown
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    XMLScanner
+    (
+        XMLValidator* const validator
+    );
+    XMLScanner
+    (
+        XMLDocumentHandler* const   docHandler
+        , XMLEntityHandler* const   entityHandler
+        , XMLErrorReporter* const   errReporter
+        , XMLValidator* const       validator
+    );
+    ~XMLScanner();
+
+
+    // -----------------------------------------------------------------------
+    //  Error emitter methods
+    // -----------------------------------------------------------------------
+    void emitError(const XML4CErrs::Codes toEmit);
+    void emitError
+    (
+        const   XML4CErrs::Codes    toEmit
+        , const XMLCh* const        text1
+        , const XMLCh* const        text2 = 0
+        , const XMLCh* const        text3 = 0
+        , const XMLCh* const        text4 = 0
+    );
+    void emitError
+    (
+        const   XML4CErrs::Codes    toEmit
+        , const char* const         text1
+        , const char* const         text2 = 0
+        , const char* const         text3 = 0
+        , const char* const         text4 = 0
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    const XMLDocumentHandler* getDocHandler() const;
+    XMLDocumentHandler* getDocHandler();
+    bool getDoNamespaces() const;
+    bool getDoValidation() const;
+    const XMLEntityHandler* getEntityHandler() const;
+    XMLEntityHandler* getEntityHandler();
+    const XMLErrorReporter* getErrorReporter() const;
+    XMLErrorReporter* getErrorReporter();
+    bool getExitOnFirstFatal() const;
+    RefHashTableOf<XMLRefInfo>& getIDRefList();
+    bool getInException() const;
+    const RefHashTableOf<XMLRefInfo>& getIDRefList() const;
+    bool getLastExtLocation
+    (
+                XMLCh* const    sysIdToFill
+        , const unsigned int    maxSysIdChars
+        ,       XMLCh* const    pubIdToFill
+        , const unsigned int    maxPubIdChars
+        ,       unsigned int&   lineToFill
+        ,       unsigned int&   colToFill
+    );
+    bool getStandalone() const;
+    const XMLValidator* getValidator() const;
+    XMLValidator* getValidator();
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setDocHandler(XMLDocumentHandler* const docHandler);
+    void setDoNamespaces(const bool doNamespaces);
+    void setDoValidation(const bool validate);
+    void setEntityHandler(XMLEntityHandler* const docTypeHandler);
+    void setErrorReporter(XMLErrorReporter* const errHandler);
+    void setExitOnFirstFatal(const bool newValue);
+    void setValidator(XMLValidator* const validator);
+
+
+    // -----------------------------------------------------------------------
+    //  Document scanning methods
+    //
+    //  scanDocument() does the entire source document. scanFirst() and
+    //  scanNext() support a progressive parse.
+    // -----------------------------------------------------------------------
+    void scanDocument
+    (
+        const   InputSource&    src
+        , const bool            reuseValidator = false
+    );
+    bool scanFirst
+    (
+        const   InputSource&    src
+        ,       XMLPScanToken&  toFill
+        , const bool            reuseValidator = false
+    );
+    bool scanNext(XMLPScanToken& toFill);
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private class types
+    // -----------------------------------------------------------------------
+    enum IDTypes
+    {
+        IDType_Public
+        , IDType_External
+        , IDType_Either
+    };
+
+    enum DTDSubsets
+    {
+        Subset_Internal
+        , Subset_External
+    };
+
+
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    XMLScanner();
+    XMLScanner(const XMLScanner&);
+    void operator=(const XMLScanner&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    // -----------------------------------------------------------------------
+    void commonInit();
+
+
+    // -----------------------------------------------------------------------
+    //  Private helper methods
+    //
+    //  These are implemented in XMLScanner2.cpp, to keep the main file from
+    //  becoming so bloated. We can't have any bloated files.
+    // -----------------------------------------------------------------------
+    unsigned int buildAttList
+    (
+        const   RefVectorOf<KVStringPair>&  providedAttrs
+        , const unsigned int                attCount
+        ,       XMLElementDecl&             elemDecl
+        ,       RefVectorOf<XMLAttr>&       toFill
+    );
+    void checkIDRefs();
+    bool isLegalToken(const XMLPScanToken& toCheck);
+    bool normalizeAttValue
+    (
+        const   XMLCh* const        value
+        , const XMLAttDef::AttTypes type
+        ,       XMLBuffer&          toFill
+    );
+    unsigned int resolveQName
+    (
+        const   XMLCh* const        qName
+        ,       XMLBuffer&          nameBufToFill
+        ,       XMLBuffer&          prefixBufToFill
+        , const ElemStack::MapModes mode
+    );
+    unsigned int resolvePrefix
+    (
+        const   XMLCh* const        prefix
+        , const ElemStack::MapModes mode
+    );
+    unsigned int resolvePrefix
+    (
+        const   XMLCh* const        prefix
+        ,       XMLBuffer&          uriBufToFill
+        , const ElemStack::MapModes mode
+    );
+    void scanReset(const InputSource& src);
+    void sendCharData(XMLBuffer& toSend);
+    XMLTokens senseNextToken(unsigned int& orgReader);
+    void updateNSMap
+    (
+        const   XMLCh* const    attrName
+        , const XMLCh* const    attrValue
+    );
+    void validateAttrValue
+    (
+        const   XMLCh* const            valueText
+        , const XMLAttDef::AttTypes     type
+        , const XMLAttDef::DefAttTypes  defType
+        , const XMLCh* const            defText
+        , const XMLCh* const            fullName
+        , const XMLCh* const            enumList
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Private scanning methods
+    // -----------------------------------------------------------------------
+    bool basicAttrValueScan(XMLBuffer& toFill);
+    bool getQuotedString(XMLBuffer& toFill);
+    unsigned int rawAttrScan
+    (
+        RefVectorOf<KVStringPair>&  toFill
+        , bool&                     isEmpty
+    );
+    bool scanAttValue(XMLBuffer& toFill, const XMLAttDef::AttTypes type);
+    void scanCDSection();
+    void scanCharData(XMLBuffer& toToUse);
+    bool scanCharRef(XMLCh& toFill, XMLCh& second);
+    void scanComment();
+    bool scanContent(const bool extEntity);
+    void scanDocTypeDecl();
+    void scanEndTag(bool& gotData);
+    EntityExpRes scanEntityRef
+    (
+        const   bool    inAttVal
+        ,       XMLCh&  firstCh
+        ,       XMLCh&  secondCh
+        ,       bool&   escaped
+    );
+    bool scanEq();
+    bool scanId
+    (
+                XMLBuffer&  pubIdToFill
+        ,       XMLBuffer&  sysIdToFill
+        , const IDTypes     whatKind
+    );
+    void scanIgnoredSection();
+    bool scanInternalSubset();
+    void scanMiscellaneous();
+    void scanPI();
+    void scanProlog();
+    bool scanPublicLiteral(XMLBuffer& toFill);
+    bool scanStartTag(bool& gotData);
+    bool scanStartTagNS(bool& gotData);
+    bool scanSystemLiteral(XMLBuffer& toFill);
+    void scanXMLDecl(const DeclTypes type);
+    unsigned int scanUpToWSOr
+    (
+                XMLBuffer&  toFill
+        , const XMLCh       chEndChar
+    );
+
+
+
+    // -----------------------------------------------------------------------
+    //  Data members
+    //
+    //  fAttrList
+    //      Every time we get a new element start tag, we have to pass to
+    //      the document handler the attributes found. To make it more
+    //      efficient we keep this ref vector of XMLAttr objects around. We
+    //      just reuse it over and over, allowing it to grow to meet the
+    //      peek need.
+    //
+    //  fBaseDir
+    //      This is the base directory, from which the initial XML file
+    //      was loaded. It is set after the file is successfully opened,
+    //      so we know it to be valid. If the initial file had no path
+    //      component, then this is left null. It is used to handle relative
+    //      paths of DTD and external entity system ids.
+    //
+    //  fBufMgr
+    //      This is a manager for temporary buffers used during scanning.
+    //      For efficiency we must use a set of static buffers, but we have
+    //      to insure that they are not incorrectly reused. So this manager
+    //      provides the smarts to hand out buffers as required.
+    //
+    //  fDocHandler
+    //      The client code's document handler. If zero, then no document
+    //      handler callouts are done. We don't adopt it.
+    //
+    //  fDoNamespaces
+    //      This flag indicates whether the client code wants us to do
+    //      namespaces or not. If the installed validator indicates that it
+    //      has to do namespaces, then this is ignored.
+    //
+    //  fDoValidation
+    //      Indicates whether any validation should be done. A validator
+    //      can still be installed and it will build up all the data
+    //      structures for the DTD/Schema declarations, but the scanner will
+    //      not ask it to validate anything.
+    //
+    //  fElemStack
+    //      This is the element stack that is used to track the elements that
+    //      are currently being worked on.
+    //
+    //  fEntityHandler
+    //      The client code's entity handler. If zero, then no entity handler
+    //      callouts are done. We don't adopt it.
+    //
+    //  fErrorReporter
+    //      The client code's error handler. If zero, then no error handler
+    //      callouts are done. We don't adopt it.
+    //
+    //  fExitOnFirstFatal
+    //      This indicates whether we bail out on the first fatal XML error
+    //      or not. It defaults to true, which is the strict XML way, but it
+    //      can be changed.
+    //
+    //  fIDRefList
+    //      This is a list of XMLRefInfo objects. This member lets us do all
+    //      needed ID-IDREF balancing checks.
+    //
+    //  fInException
+    //      To avoid a circular freakout when we catch an exception and emit
+    //      it, which would normally throw again if the 'fail on first error'
+    //      flag is one.
+    //
+    //  fRawAttrList
+    //      During the initial scan of the attributes we can only do a raw
+    //      scan for key/value pairs. So this vector is used to store them
+    //      until they can be processed (and put into fAttrList.)
+    //
+    //  fReaderMgr
+    //      This is the reader manager, from which we get characters. It
+    //      manages the reader stack for us, and provides a lot of convenience
+    //      methods to do specialized checking for chars, sequences of chars,
+    //      skipping chars, etc...
+    //
+    //  fReuseValidator
+    //      This flag is set on a per-scan basis. So its provided in the
+    //      scanDocument() and scanFirst() methods, and applies for that
+    //      one pass. It indicates that the validator should not be reused
+    //      and that any external structural description should be ignored.
+    //      There cannot be any internal subset.
+    //
+    //  fScannerId
+    //  fSequenceId
+    //      These are used for progressive parsing, to make sure that the
+    //      client code does the right thing at the right time.
+    //
+    //  fStandalone
+    //      Indicates whether the document is standalone or not. Defaults to
+    //      no, but can be overridden in the XMLDecl.
+    //
+    //  fValidator
+    //      The installed validator. We look at them via the abstract
+    //      validator interface, and don't know what it actual is.
+    //
+    //
+    //  fAttName
+    //  fAttValue
+    //  fCDataBuf
+    //  fNameBuf
+    //  fQNameBuf
+    //  fPrefixBuf
+    //      For the most part, buffers are obtained from the fBufMgr object
+    //      on the fly. However, for the start tag scan, we have a set of
+    //      fixed buffers for performance reasons. These are used a lot and
+    //      there are a number of them, so asking the buffer manager each
+    //      time for new buffers is a bit too much overhead.
+    // -----------------------------------------------------------------------
+    RefVectorOf<XMLAttr>*       fAttrList;
+    XMLCh*                      fBaseDir;
+    XMLBufferMgr                fBufMgr;
+    XMLDocumentHandler*         fDocHandler;
+    bool                        fDoNamespaces;
+    bool                        fDoValidation;
+    ElemStack                   fElemStack;
+    XMLEntityHandler*           fEntityHandler;
+    XMLErrorReporter*           fErrorReporter;
+    bool                        fExitOnFirstFatal;
+    RefHashTableOf<XMLRefInfo>* fIDRefList;
+    bool                        fInException;
+    RefVectorOf<KVStringPair>*  fRawAttrList;
+    ReaderMgr                   fReaderMgr;
+    bool                        fReuseValidator;
+    XMLUInt32                   fScannerId;
+    XMLUInt32                   fSequenceId;
+    bool                        fStandalone;
+    XMLValidator*               fValidator;
+
+    XMLBuffer                   fAttNameBuf;
+    XMLBuffer                   fAttValueBuf;
+    XMLBuffer                   fCDataBuf;
+    XMLBuffer                   fNameBuf;
+    XMLBuffer                   fQNameBuf;
+    XMLBuffer                   fPrefixBuf;
+    XMLBuffer                   fURIBuf;
+};
+
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Getter methods
+// ---------------------------------------------------------------------------
+inline const XMLDocumentHandler* XMLScanner::getDocHandler() const
+{
+    return fDocHandler;
+}
+
+inline XMLDocumentHandler* XMLScanner::getDocHandler()
+{
+    return fDocHandler;
+}
+
+inline bool XMLScanner::getDoNamespaces() const
+{
+    return fDoNamespaces;
+}
+
+inline bool XMLScanner::getDoValidation() const
+{
+    return fDoValidation;
+}
+
+inline const XMLEntityHandler* XMLScanner::getEntityHandler() const
+{
+    return fEntityHandler;
+}
+
+inline XMLEntityHandler* XMLScanner::getEntityHandler()
+{
+    return fEntityHandler;
+}
+
+inline const XMLErrorReporter* XMLScanner::getErrorReporter() const
+{
+    return fErrorReporter;
+}
+
+inline XMLErrorReporter* XMLScanner::getErrorReporter()
+{
+    return fErrorReporter;
+}
+
+inline bool XMLScanner::getExitOnFirstFatal() const
+{
+    return fExitOnFirstFatal;
+}
+
+inline RefHashTableOf<XMLRefInfo>& XMLScanner::getIDRefList()
+{
+    return *fIDRefList;
+}
+
+inline bool XMLScanner::getInException() const
+{
+    return fInException;
+}
+
+inline const RefHashTableOf<XMLRefInfo>& XMLScanner::getIDRefList() const
+{
+    return *fIDRefList;
+}
+
+inline bool XMLScanner::getStandalone() const
+{
+    return fStandalone;
+}
+
+inline const XMLValidator* XMLScanner::getValidator() const
+{
+    return fValidator;
+}
+
+inline XMLValidator* XMLScanner::getValidator()
+{
+    return fValidator;
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Setter methods
+// ---------------------------------------------------------------------------
+inline void XMLScanner::setDoNamespaces(const bool doNamespaces)
+{
+    fDoNamespaces = doNamespaces;
+}
+
+inline void XMLScanner::setDocHandler(XMLDocumentHandler* const docHandler)
+{
+    fDocHandler = docHandler;
+}
+
+inline void XMLScanner::setErrorReporter(XMLErrorReporter* const errHandler)
+{
+    fErrorReporter = errHandler;
+}
+
+inline void XMLScanner::setEntityHandler(XMLEntityHandler* const entityHandler)
+{
+    fEntityHandler = entityHandler;
+    fReaderMgr.setEntityHandler(entityHandler);
+}
+
+inline void XMLScanner::setExitOnFirstFatal(const bool newValue)
+{
+    fExitOnFirstFatal = newValue;
+}
+
+#endif
diff --git a/src/internal/XMLScanner2.cpp b/src/internal/XMLScanner2.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b36aea100e57d06515bf5f2f92736fd9d227f2af
--- /dev/null
+++ b/src/internal/XMLScanner2.cpp
@@ -0,0 +1,2315 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:08:24  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:56:55  droddey
+ * If the main xml entity does not exist, we need to get the error handling for that
+ * inside the main XMLScanner::scanDocument() try block so that it gets reported
+ * in the normal way. We have to add a little extra safety code because, when this
+ * happens, there is no reader on the reader stack to get position ino from.
+ *
+ * Revision 1.5  1999/11/08 20:44:52  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  This file holds some of the grunt work methods of XMLScanner.cpp to keep
+//  it a little more readable.
+// ---------------------------------------------------------------------------
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/BinMemInputStream.hpp>
+#include <util/Janitor.hpp>
+#include <util/PlatformUtils.hpp>
+#include <util/UnexpectedEOFException.hpp>
+#include <util/URL.hpp>
+#include <util/XMLUni.hpp>
+#include <sax/InputSource.hpp>
+#include <framework/XMLErrorReporter.hpp>
+#include <framework/XMLDocumentHandler.hpp>
+#include <framework/XMLElementDecl.hpp>
+#include <framework/XMLEntityDecl.hpp>
+#include <framework/XMLEntityHandler.hpp>
+#include <framework/XMLPScanToken.hpp>
+#include <framework/XMLRefInfo.hpp>
+#include <framework/XMLValidator.hpp>
+#include <internal/XMLScanner.hpp>
+#include <internal/EndOfEntityException.hpp>
+#include <internal/URLInputSource.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Private helper methods
+// ---------------------------------------------------------------------------
+
+//
+//  This method is called from scanStartTag() to build up the list of
+//  XMLAttr objects that will be passed out in the start tag callout. We
+//  get the key/value pairs from the raw scan of explicitly provided attrs,
+//  which have not been normalized. And we get the element declaration from
+//  which we will get any defaulted or fixed attribute defs and add those
+//  in as well.
+//
+unsigned int
+XMLScanner::buildAttList(const  RefVectorOf<KVStringPair>&  providedAttrs
+                        , const unsigned int                attCount
+                        ,       XMLElementDecl&             elemDecl
+                        ,       RefVectorOf<XMLAttr>&       toFill)
+{
+    //
+    //  Ask the element to clear the 'provided' flag on all of the att defs
+    //  that it owns, and to return us a boolean indicating whether it has
+    //  any defs.
+    //
+    const bool hasDefs = elemDecl.resetDefs();
+
+    //
+    //  If there are no expliclitily provided attributes and there are no
+    //  defined attributes for the element, the we don't have anything to do.
+    //  So just return zero in this case.
+    //
+    if (!hasDefs && !attCount)
+        return 0;
+
+    // Keep up with how many attrs we end up with total
+    unsigned int retCount = 0;
+
+    //
+    //  And get the current size of the output vector. This lets us use
+    //  existing elements until we fill it, then start adding new ones.
+    //
+    const unsigned int curAttListSize = toFill.size();
+
+    //
+    //  We need a buffer into which raw scanned attribute values will be
+    //  normalized. 
+    //
+    XMLBufBid bbNormal(&fBufMgr);
+    XMLBuffer& normBuf = bbNormal.getBuffer();
+
+    //
+    //  Loop through our explicitly provided attributes, which are in the raw
+    //  scanned form, and build up XMLAttr objects.
+    //
+    unsigned int index;
+    for (index = 0; index < attCount; index++)
+    {
+        const KVStringPair* curPair = providedAttrs.elementAt(index);
+
+        //
+        //  We have to split the name into its prefix and name parts. Then
+        //  we map the prefix to its URI.
+        //
+        XMLCh* namePtr = XMLString::replicate(curPair->getKey());
+        ArrayJanitor<XMLCh> janName(namePtr);
+        const int colonInd = XMLString::indexOf(namePtr, chColon);
+        const XMLCh* prefPtr = XMLUni::fgZeroLenString;
+        const XMLCh* suffPtr = XMLUni::fgZeroLenString;
+        if (colonInd != -1)
+        {
+            namePtr[colonInd] = chNull;
+            prefPtr = namePtr;
+            suffPtr = &namePtr[colonInd + 1];
+        }
+         else
+        {
+            // No colon, so we just have a name with no prefix
+            suffPtr = namePtr;
+        }
+
+        //
+        //  Map the prefix to a URI id. We tell him that we are mapping an
+        //  attr prefix, so any xmlns attrs at this level will not affect it.
+        //
+        const unsigned int uriId = resolvePrefix(prefPtr, ElemStack::Mode_Attribute);
+
+        //
+        //  If the uri comes back as the xmlns or xml URI or its just a name
+        //  and that name is 'xmlns', then we handle it specially. So set a
+        //  boolean flag that lets us quickly below know which we are dealing
+        //  with.
+        //
+        const bool isNSAttr = (uriId == fValidator->getXMLNSNamespaceId())
+                              || (uriId == fValidator->getXMLNamespaceId())
+                              || !XMLString::compareString(suffPtr, XMLUni::fgXMLNSString);
+
+
+        //
+        //  If its not a special case namespace attr of some sort, then we
+        //  do normal checking and processing.
+        //
+        XMLAttDef::AttTypes attType;
+        if (!isNSAttr)
+        {
+            //
+            //  Find this attribute within the parent element. We pass both
+            //  the uriID/name and the raw QName buffer, since we don't know
+            //  how the derived validator and its elements store attributes.
+            //
+            bool wasAdded;
+            XMLAttDef* attDef = elemDecl.findAttr
+            (
+                curPair->getKey()
+                , uriId
+                , suffPtr
+                , XMLElementDecl::AddIfNotFound
+                , wasAdded
+            );
+
+            //
+            //  Its not valid for this element, so issue an error if we are
+            //  validating. If its an XMLNS type attribute, then its not an
+            //  error for it not to be predefined.
+            //
+            if (wasAdded)
+            {
+                if (fDoValidation && !isNSAttr)
+                {
+                    XMLBuffer bufURI;
+                    fValidator->getURIText(uriId, bufURI);
+                    fValidator->emitError
+                    (
+                        XML4CValid::AttNotDefinedForElement
+                        , bufURI.getRawBuffer()
+                        , suffPtr
+                        , elemDecl.getFullName()
+                    );
+                }
+            }
+
+            // Mark this one as provided (even if it was faulted in)
+            attDef->setProvided(true);
+
+            //
+            //  Now normalize the raw value since we have the attribute type. We
+            //  don't care about the return status here. If it failed, an error
+            //  was issued, which is all we care about.
+            //
+            normalizeAttValue(curPair->getValue(), attDef->getType(), normBuf);
+
+            //
+            //  If we found an attdef for this one, then lets validate it.
+            //
+            if (!wasAdded)
+            {
+                fValidator->validateAttrValue
+                (
+                    *attDef
+                    , normBuf.getRawBuffer()
+                );
+            }
+
+            // Save the type for later use
+            attType = attDef->getType();
+
+            // Make sure it's not a dup of anything so far
+            for (unsigned int inner = 0; inner < retCount; inner++)
+            {
+                // If they have the same URI, then compare names
+                if (uriId == toFill.elementAt(inner)->getURIId())
+                {
+                    if (!XMLString::compareString(suffPtr, toFill.elementAt(inner)->getName()))
+                    {
+                        emitError
+                        (
+                            XML4CErrs::AttrAlreadyUsedInSTag
+                            , attDef->getFullName()
+                            , elemDecl.getFullName()
+                        );
+                    }
+                }
+            }
+        }
+         else
+        {
+            // Just normalize as CDATA
+            attType = XMLAttDef::CData;
+            normalizeAttValue(curPair->getValue(), XMLAttDef::CData, normBuf);
+        }
+
+        //
+        //  Add this attribute to the attribute list that we use to pass them
+        //  to the handler. We reuse its existing elements but expand it as
+        //  required.
+        //
+        XMLAttr* curAttr;
+        if (retCount >= curAttListSize)
+        {
+            curAttr = new XMLAttr
+            (
+                uriId
+                , suffPtr
+                , prefPtr
+                , normBuf.getRawBuffer()
+                , attType
+                , true
+            );
+            toFill.addElement(curAttr);
+        }
+         else
+        {
+            curAttr = toFill.elementAt(retCount);
+            curAttr->set
+            (
+                uriId
+                , suffPtr
+                , prefPtr
+                , normBuf.getRawBuffer()
+                , attType
+            );
+            curAttr->setSpecified(true);
+        }
+
+        // Bump the count of attrs in the list
+        retCount++;
+    }
+
+    //
+    //  Now, if there are any attributes declared by this element, let's
+    //  go through them and make sure that any required ones are provided,
+    //  and fault in any fixed ones and defaulted ones that are not provided
+    //  literally.
+    //
+    if (hasDefs)
+    {
+        XMLAttDefList& attDefList = elemDecl.getAttDefList();
+        while (attDefList.hasMoreElements())
+        {
+            // Get the current att def, for convenience and its def type
+            const XMLAttDef& curDef = attDefList.nextElement();
+            const XMLAttDef::DefAttTypes defType = curDef.getDefaultType();
+
+            if (!curDef.getProvided())
+            {
+                if (fDoValidation)
+                {
+                    // If we are validating and its required, then an error
+                    if (defType == XMLAttDef::Required)
+                    {
+                        fValidator->emitError
+                        (
+                            XML4CValid::RequiredAttrNotProvided
+                            , curDef.getFullName()
+                        );
+                    }
+                }
+
+                //
+                //  Fault in the value if needed, and bump the att count.
+                //  We have to 
+                //
+                if ((defType == XMLAttDef::Default)
+                ||  (defType == XMLAttDef::Fixed))
+                {
+                    XMLAttr* curAtt;
+                    if (retCount >= curAttListSize)
+                    {
+                        curAtt = new XMLAttr;
+                        fValidator->faultInAttr(*curAtt, curDef);
+                        fAttrList->addElement(curAtt);
+                    }
+                     else
+                    {
+                        curAtt = fAttrList->elementAt(retCount);
+                        fValidator->faultInAttr(*curAtt, curDef);
+                    }
+
+                    //
+                    //  Map the new attribute's prefix to a URI id and store
+                    //  that in the attribute object.
+                    //
+                    curAtt->setURIId
+                    (
+                        resolvePrefix(curAtt->getPrefix(), ElemStack::Mode_Attribute)
+                    );
+
+                    // Indicate it was not explicitly specified and bump count
+                    curAtt->setSpecified(false);
+                    retCount++;
+                }
+            }
+        }
+    }
+
+    return retCount;
+}
+
+
+//
+//  This method is called after the content scan to insure that all the
+//  ID/IDREF attributes match up (i.e. that all IDREFs refer to IDs.) This is
+//  an XML 1.0 rule, so we can do here in the core.
+//
+void XMLScanner::checkIDRefs()
+{
+    //
+    //  
+    //  Iterate the id ref list. If we find any entries here which are used
+    //  but not declared, then that's an error.
+    //
+    RefHashTableOfEnumerator<XMLRefInfo> refEnum(fIDRefList);
+    while (refEnum.hasMoreElements())
+    {
+        // Get a ref to the current element
+        const XMLRefInfo& curRef = refEnum.nextElement();
+
+        // If its used but not declared, then its an error
+        if (!curRef.getDeclared() && curRef.getUsed())
+            fValidator->emitError(XML4CValid::IDNotDeclared, curRef.getRefName());
+    }
+}
+
+
+//
+//  This just does a simple check that the passed progressive scan token is
+//  legal for this scanner.
+//
+bool XMLScanner::isLegalToken(const XMLPScanToken& toCheck)
+{
+    return ((fScannerId == toCheck.fScannerId)
+    &&      (fSequenceId == toCheck.fSequenceId));
+}
+
+
+//
+//  This method will take a raw attribute value and normalize it according to
+//  the rules of the attribute type. It will put the resulting value into the
+//  passed buffer.
+//
+//  This code assumes that escaped characters in the original value (via char
+//  refs) are prefixed by a 0xFFFF character. This is because some characters
+//  are legal if escaped only. And some escape chars are not subject to
+//  normalization rules.
+//
+bool XMLScanner::normalizeAttValue( const   XMLCh* const        value
+                                    , const XMLAttDef::AttTypes type
+                                    ,       XMLBuffer&          toFill)
+{
+    // A simple state value for a whitespace processing state machine
+    enum States
+    {
+        InWhitespace
+        , InContent
+    };
+
+    // Assume its going to go fine, and empty the target buffer in preperation
+    bool retVal = true;
+    toFill.reset();
+
+    //
+    //  Loop through the chars of the source value and normalize it according
+    //  to the type.
+    //
+    States curState = InContent;
+    bool escaped;
+    bool firstNonWS = false;
+    XMLCh nextCh;
+    const XMLCh* srcPtr = value;
+    while (*srcPtr)
+    {
+        //
+        //  Get the next character from the source. We have to watch for
+        //  escaped characters (which are indicated by a 0xFFFF value followed
+        //  by the char that was escaped.)
+        //
+        nextCh = *srcPtr;
+        escaped = (nextCh == 0xFFFF);
+        if (escaped)
+            nextCh = *++srcPtr;
+
+        //
+        //  If its not escaped, then make sure its not a < character, which is
+        //  not allowed in attribute values.
+        //
+        if (!escaped && (*srcPtr == chOpenAngle))
+        {
+            emitError(XML4CErrs::BracketInAttrValue);
+            retVal = false;
+        }
+
+        if (type == XMLAttDef::CData)
+        {
+            if (!escaped)
+            {
+                //
+                //  NOTE: Yes this is a little redundant in that a 0x20 is
+                //  replaced with an 0x20. But its faster to do this (I think)
+                //  than checking for 9, A, and D separately.
+                //
+                if (XMLReader::isWhitespace(nextCh))
+                    nextCh = chSpace;
+            }
+        }
+         else
+        {
+            if (curState == InWhitespace)
+            {
+                if (!XMLReader::isWhitespace(nextCh))
+                {
+                    if (firstNonWS)
+                        toFill.append(chSpace);
+                    curState = InContent;
+                    firstNonWS = true;
+                }
+                 else
+                {
+                    srcPtr++;
+                    continue;
+                }
+            }
+             else if (curState == InContent)
+            {
+                if (XMLReader::isWhitespace(nextCh))
+                {
+                    curState = InWhitespace;
+                    srcPtr++;
+                    continue;
+                }
+                firstNonWS = true;
+            }
+        }
+
+        // Add this char to the target buffer
+        toFill.append(nextCh);
+
+        // And move up to the next character in the source
+        srcPtr++;
+    }
+    return retVal;
+}
+
+
+unsigned int
+XMLScanner::resolvePrefix(  const   XMLCh* const        prefix
+                            , const ElemStack::MapModes mode)
+{
+    //
+    //  Watch for the special namespace prefixes. We always map these to
+    //  special URIs. 'xml' gets mapped to the official URI that its defined
+    //  to map to by the NS spec. xmlns gets mapped to a special place holder
+    //  URI that we define (so that it maps to something checkable.)
+    //
+    if (!XMLString::compareIString(prefix, XMLUni::fgXMLNSString))
+        return fValidator->getXMLNSNamespaceId();
+    else if (!XMLString::compareIString(prefix, XMLUni::fgXMLString))
+        return fValidator->getXMLNamespaceId();
+
+
+    //
+    //  Ask the element stack to search up itself for a mapping for the
+    //  passed prefix.
+    //
+    bool unknown;
+    unsigned int uriId = fElemStack.mapPrefixToURI(prefix, mode, unknown);
+
+    // If it was unknown, then the URI was faked in but we have to issue an error
+    if (unknown)
+        emitError(XML4CErrs::UnknownPrefix, prefix);
+
+    return uriId;
+}
+
+
+unsigned int
+XMLScanner::resolvePrefix(  const   XMLCh* const        prefix
+                            ,       XMLBuffer&          bufToFill
+                            , const ElemStack::MapModes mode)
+{
+    //
+    //  Watch for the special namespace prefixes. We always map these to
+    //  special URIs. 'xml' gets mapped to the official URI that its defined
+    //  to map to by the NS spec. xmlns gets mapped to a special place holder
+    //  URI that we define (so that it maps to something checkable.)
+    //
+    if (!XMLString::compareIString(prefix, XMLUni::fgXMLNSString))
+        return fValidator->getXMLNSNamespaceId();
+    else if (!XMLString::compareIString(prefix, XMLUni::fgXMLString))
+        return fValidator->getXMLNamespaceId();
+
+    //
+    //  Ask the element stack to search up itself for a mapping for the
+    //  passed prefix.
+    //
+    bool unknown;
+    unsigned int uriId = fElemStack.mapPrefixToURI(prefix, mode, unknown);
+
+    // If it was unknown, then the URI was faked in but we have to issue an error
+    if (unknown)
+        emitError(XML4CErrs::UnknownPrefix, prefix);
+
+    fValidator->getURIText(uriId, bufToFill);
+    return uriId;
+}
+
+
+unsigned int
+XMLScanner::resolveQName(   const   XMLCh* const        qName
+                            ,       XMLBuffer&          nameBuf
+                            ,       XMLBuffer&          prefixBuf
+                            , const ElemStack::MapModes mode)
+{
+    // Reset both target buffers in case we don't get anything for either
+    nameBuf.reset();
+    prefixBuf.reset();
+
+    //
+    //  Lets split out the qName into a URI and name buffer first. The URI
+    //  can be empty.
+    //
+    const int colonPos = XMLString::indexOf(qName, chColon);
+    unsigned int uriId = 0;
+    if (colonPos == -1)
+    {
+        //
+        //  Its all name with no prefix, so put the whole thing into the name
+        //  buffer. Then map the empty string to a URI, since the empty string
+        //  represents the default namespace. This will either return some
+        //  explicit URI which the default namespace is mapped to, or the
+        //  the default global namespace.
+        //
+        nameBuf.append(qName);
+        bool unknown;
+        uriId = fElemStack.mapPrefixToURI(prefixBuf.getRawBuffer(), mode, unknown);
+
+        #if defined(XML4C_DEBUG)
+        if (unknown)
+        {
+            // <TBD> This one should never be unknown
+        }
+        #endif
+    }
+     else
+    {
+        //
+        //  Copy the chars up to but not including the colon into the prefix
+        //  buffer.
+        //
+        prefixBuf.append(qName, colonPos);
+
+        // And copy over the rest of the chars to the name buffer
+        nameBuf.append(&qName[colonPos+1]);
+
+        //
+        //  Watch for the special namespace prefixes. We always map these to
+        //  special URIs. 'xml' gets mapped to the official URI that its defined
+        //  to map to by the NS spec. xmlns gets mapped to a special place holder
+        //  URI that we define (so that it maps to something checkable.)
+        //
+        if (!XMLString::compareIString(prefixBuf.getRawBuffer(), XMLUni::fgXMLNSString))
+            uriId = fValidator->getXMLNSNamespaceId();
+        else if (!XMLString::compareIString(prefixBuf.getRawBuffer(), XMLUni::fgXMLString))
+            uriId = fValidator->getXMLNamespaceId();
+        else
+        {
+            bool unknown;
+            uriId = fElemStack.mapPrefixToURI(prefixBuf.getRawBuffer(), mode, unknown);
+            if (unknown)
+                emitError(XML4CErrs::UnknownPrefix, prefixBuf.getRawBuffer());
+        }
+    }
+    return uriId;
+}
+
+
+//
+//  This method will reset the scanner data structures, and related plugged
+//  in stuff, for a new scan session. We get the input source for the primary
+//  XML entity, create the reader for it, and push it on the stack so that
+//  upon successful return from here we are ready to go.
+//
+void XMLScanner::scanReset(const InputSource& src)
+{
+    //
+    //  This call implicitly tells us that we are going to reuse the scanner
+    //  if it was previously used. So tell the validator to reset itself.
+    //
+    //  But, if the fReuseValidator flag is set, then don't reset it.
+    //
+    //  NOTE:   The ReaderMgr is flushed on the way out, because that is
+    //          required to insure that files are closed.
+    //
+    if (!fReuseValidator)
+        fValidator->reset();
+
+    //
+    //  And for all installed handlers, send reset events. This gives them
+    //  a chance to flush any cached data.
+    //
+    if (fDocHandler)
+        fDocHandler->resetDocument();
+    if (fEntityHandler)
+        fEntityHandler->resetEntities();
+    if (fErrorReporter)
+        fErrorReporter->resetErrors();
+
+    // Clear out the id reference list
+    fIDRefList->removeAll();
+
+    //
+    //  Reset the element stack, and give it the latest ids for the special
+    //  URIs it has to know about.
+    //
+    fElemStack.reset
+    (
+        fValidator->getEmptyNamespaceId()
+        , fValidator->getGlobalNamespaceId()
+        , fValidator->getUnknownNamespaceId()
+        , fValidator->getXMLNamespaceId()
+        , fValidator->getXMLNSNamespaceId()
+    );
+
+    // Reset some status flags
+    fInException = false;
+    fStandalone = false;
+
+    //
+    //  Handle the creation of the XML reader object for this input source.
+    //  This will provide us with transcoding and basic lexing services.
+    //
+    XMLReader* newReader = fReaderMgr.createReader
+    (
+        src
+        , true
+        , XMLReader::RefFrom_NonLiteral
+        , XMLReader::Type_General
+        , XMLReader::Source_External
+    );
+    if (!newReader)
+        ThrowXML1(RuntimeException, XML4CExcepts::Scan_CouldNotOpenSource, src.getSystemId());
+
+    // Push this read onto the reader manager
+    fReaderMgr.pushReader(newReader, 0);
+
+    //
+    //  We know that the file is legal now, so lets get the base directory
+    //  off of it and store it. If there is no directory component on the
+    //  path, then this returns a null.
+    //
+    //  We have to assume it could be a URL so we create a temporary URL
+    //  and ask it for the path part of itself. That will insure that if its
+    //  relative we really see it as a relative path.
+    //
+    URL tmpURL;
+
+    try
+    {
+        tmpURL.setURL(src.getSystemId());
+
+        //
+        //  Its a valid URL so its assumed to be fully qualified. Get the
+        //  base part of the path part of the URL.
+        //
+        fReaderMgr.setBasePath(XMLPlatformUtils::getBasePath(tmpURL.getPath()));
+    }
+
+    catch(const MalformedURLException&)
+    {
+        //
+        //  Its not a URL, so assume its just a plain file path and could
+        //  be partial, so get the complete path.
+        //
+        fReaderMgr.setBasePath(XMLPlatformUtils::getBasePath(src.getSystemId()));
+    }
+}
+
+
+//
+//  This method is called between markup in content. It scans for character
+//  data that is sent to the document handler. It watches for any markup
+//  characters that would indicate that the character data has ended. It also
+//  handles expansion of general and character entities.
+//
+//  sendData() is a local static helper for this method which handles some
+//  code that must be done in three different places here.
+//
+void XMLScanner::sendCharData(XMLBuffer& toSend)
+{
+    // If no data in the buffer, then nothing to do
+    if (toSend.isEmpty())
+        return;
+
+    // Get the raw data we need for the callback
+    const XMLCh* rawBuf = toSend.getRawBuffer();
+    const unsigned int len = toSend.getLen();
+
+    //
+    //  We do different things according to whether we are validating or
+    //  not. If not, its always just characters; else, it depends on the
+    //  current element's content model.
+    //
+    if (fDoValidation)
+    {
+        // See if all the text is whitespace
+        const bool isSpaces = XMLReader::isAllSpaces(rawBuf, len);
+
+        // And see if the current element is a 'Children' style content model
+        const ElemStack::StackElem* topElem = fElemStack.topElement();
+
+        // Get the character data opts for the current element
+        XMLElementDecl::CharDataOpts charOpts = topElem->fThisElement->getCharDataOpts();
+
+        if (charOpts == XMLElementDecl::NoCharData)
+        {
+            // They definitely cannot handle any type of char data
+            fValidator->emitError(XML4CValid::NoCharDataInCM);
+        }
+         else if (isSpaces)
+        {
+            //
+            //  Its all spaces. So, if they can take spaces, then send it
+            //  as ignorable whitespace. If they can handle any char data
+            //  send it as characters.
+            //
+            if (fDocHandler)
+            {
+                if (charOpts == XMLElementDecl::SpacesOk)
+                    fDocHandler->ignorableWhitespace(rawBuf, len, false);
+                else if (charOpts == XMLElementDecl::AllCharData)
+                    fDocHandler->docCharacters(rawBuf, len, false);
+            }
+        }
+         else
+        {
+            //
+            //  If they can take any char data, then send it. Otherwise, they
+            //  can only handle whitespace and can't handle this stuff so
+            //  issue an error.
+            //
+            if (charOpts == XMLElementDecl::AllCharData)
+            {
+                if (fDocHandler)
+                    fDocHandler->docCharacters(rawBuf, len, false);
+            }
+             else
+            {
+                fValidator->emitError(XML4CValid::NoCharDataInCM);
+            }
+        }
+    }
+     else
+    {
+        // Always assume its just char data if not validating
+        if (fDocHandler)
+            fDocHandler->docCharacters(rawBuf, len, false);
+    }
+
+    // Reset buffer
+    toSend.reset();
+}
+
+
+//
+//  This method will handle figuring out what the next top level token is
+//  in the input stream. It will return an enumerated value that indicates
+//  what it believes the next XML level token must be. It will eat as many
+//  chars are required to figure out what is next.
+//
+XMLScanner::XMLTokens XMLScanner::senseNextToken(unsigned int& orgReader)
+{
+    //
+    //  Get the next character and use it to guesstimate what the next token
+    //  is going to be.
+    //
+    XMLCh nextCh = fReaderMgr.peekNextChar();
+
+    // If its not one of the special chars, then assume its char data
+    if (!XMLReader::isSpecialTokenSenseChar(nextCh))
+        return Token_CharData;
+
+    //
+    //  Else its something special so lets check them out. Start with the most
+    //  obvious end of file, which should be legal here at top level.
+    //
+    if (!nextCh)
+        return Token_EOF;
+
+    //
+    //  See if its an entity reference of some sort. If so, assume it must
+    //  be character data because that's the only place a reference can
+    //  occur in content.
+    //
+    if (nextCh == chAmpersand)
+        return Token_CharData;
+
+    //
+    //  Ok it had to have been a '<' character. So get it out of the reader
+    //  and store the reader number where we saw it, passing it back to the
+    //  caller.
+    //
+    fReaderMgr.getNextChar();
+    orgReader = fReaderMgr.getCurrentReaderNum();
+
+    // 
+    //  Ok, so lets go through the things that it could be at this point which
+    //  are all some form of markup.
+    //
+    nextCh = fReaderMgr.peekNextChar();
+    if (nextCh == chBang)
+    {
+        static const XMLCh gCDATAStr[] =
+        {
+                chBang, chOpenSquare, chLatin_C, chLatin_D, chLatin_A
+            ,   chLatin_T, chLatin_A, chNull
+        };
+
+        static const XMLCh gCommentString[] =
+        {
+            chBang, chDash, chDash, chNull
+        };
+
+        if (fReaderMgr.skippedString(gCDATAStr))
+            return Token_CData;
+
+        if (fReaderMgr.skippedString(gCommentString))
+            return Token_Comment;
+
+        emitError(XML4CErrs::ExpectedCommentOrCDATA);
+        return Token_Unknown;
+    }
+     else if (nextCh == chQuestion)
+    {
+        // It must be a PI
+        fReaderMgr.getNextChar();
+        return Token_PI;
+    }
+     else if (nextCh == chForwardSlash)
+    {
+        fReaderMgr.getNextChar();
+        return Token_EndTag;
+    }
+
+    //
+    //  Assume its an element name, so return with a start tag token. If it
+    //  turns out not to be, then it will fail when it cannot get a valid tag.
+    //
+    return Token_StartTag;
+}
+
+
+//
+//  This method is called with a key/value string pair that represents an
+//  xmlns="xxx" or xmlns:xxx="yyy" attribute. This method will update the
+//  current top of the element stack based on this data. We know that when
+//  we get here, that it is one of these forms, so we don't bother confirming
+//  it.
+//
+void XMLScanner::updateNSMap(const  XMLCh* const    attrName
+                            , const XMLCh* const    attrValue)
+{
+    // We need a buffer to normalize the attribute value into
+    XMLBufBid bbNormal(&fBufMgr);
+    XMLBuffer& normalBuf = bbNormal.getBuffer();
+
+    //  We either have the default prefix (""), or we point it into the attr
+    //  name parameter. Note that the xmlns is not the prefix we care about
+    //  here. To us, the 'prefix' is really the local part of the attrName
+    //  parameter.
+    //
+    const XMLCh* prefPtr = XMLUni::fgZeroLenString;
+    const unsigned int colonOfs = XMLString::indexOf(attrName, chColon);
+    if (colonOfs != -1)
+        prefPtr = &attrName[colonOfs + 1];
+
+    //
+    //  Normalize the value into the passed buffer. In this case, we don't
+    //  care about the return value. An error was issued for the error, which
+    //  is all we care about here.
+    //
+    normalizeAttValue(attrValue, XMLAttDef::CData, normalBuf);
+
+    //
+    //  Ok, we have to get the unique id for the attribute value, which is the
+    //  URI that this value should be mapped to. The validator has the
+    //  namespace string pool, so we ask him to find or add this new one. Then
+    //  we ask the element stack to add this prefix to URI Id mapping.
+    //
+    fElemStack.addPrefix
+    (
+        prefPtr
+        , fValidator->addOrFindNSId(normalBuf.getRawBuffer())
+    );
+}
+
+
+// ---------------------------------------------------------------------------
+//  XMLScanner: Private parsing methods
+// ---------------------------------------------------------------------------
+
+
+//
+//  This guy just scans out a single or double quoted string of characters.
+//  It does not pass any judgement on the contents and assumes that it is
+//  illegal to have another quote of the same kind inside the string's
+//  contents.
+//
+//  NOTE: This is for simple stuff like the strings in the XMLDecl which
+//  cannot have any entities inside them. So this guy does not handle any
+//  end of entity stuff.
+//
+bool XMLScanner::getQuotedString(XMLBuffer& toFill)
+{
+    // Reset the target buffer
+    toFill.reset();
+
+    // Get the next char which must be a single or double quote
+    XMLCh quoteCh;
+    if (!fReaderMgr.skipIfQuote(quoteCh))
+        return false;
+
+    while (true)
+    {
+        // Get another char
+        const XMLCh nextCh = fReaderMgr.getNextChar();
+
+        // See if it matches the starting quote char
+        if (nextCh == quoteCh)
+            break;
+
+        //
+        //  We should never get either an end of file null char here. If we
+        //  do, just fail. It will be handled more gracefully in the higher
+        //  level code that called us.
+        //
+        if (!nextCh)
+            return false;
+
+        // Else add it to the buffer
+        toFill.append(nextCh);
+    }
+    return true;
+}
+
+
+//
+//  This method is called to do a raw scan of an attribute value. It does not
+//  do normalization (since we don't know their types yet.) It just scans the
+//  value and does entity expansion.
+//
+//  End of entity's must be dealt with here. During DTD scan, they can come
+//  from external entities. During content, they can come from any entity.
+//  We just eat the end of entity and continue with our scan until we come
+//  to the closing quote. If an unterminated value causes us to go through
+//  subsequent entities, that will cause errors back in the calling code,
+//  but there's little we can do about it here.
+//
+bool XMLScanner::basicAttrValueScan(XMLBuffer& toFill)
+{
+    // Reset the target buffer
+    toFill.reset();
+
+    // Get the next char which must be a single or double quote
+    XMLCh quoteCh;
+    if (!fReaderMgr.skipIfQuote(quoteCh))
+        return false;
+
+    //
+    //  We have to get the current reader because we have to ignore closing
+    //  quotes until we hit the same reader again.
+    //
+    const unsigned int curReader = fReaderMgr.getCurrentReaderNum();
+
+    //
+    //  Loop until we get the attribute value. Note that we use a double
+    //  loop here to avoid the setup/teardown overhead of the exception
+    //  handler on every round.
+    //
+    XMLCh   nextCh;
+    XMLCh   secondCh = 0;
+    bool    gotLeadingSurrogate = false;
+    bool    escaped;
+    while (true)
+    {
+        try
+        {
+            while(true)
+            {
+                // Get another char. Use second char if one is waiting
+                if (secondCh)
+                {
+                    nextCh = secondCh;
+                    secondCh = 0;
+                }
+                 else
+                {
+                    nextCh = fReaderMgr.getNextChar();
+                }
+
+                if (!nextCh)
+                    ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+
+                //
+                //  Check for our ending quote. It has to be in the same entity
+                //  as where we started. Quotes in nested entities are ignored.
+                //
+                if (nextCh == quoteCh)
+                {
+                    if (curReader == fReaderMgr.getCurrentReaderNum())
+                        return true;
+
+                    // Watch for spillover into a previous entity
+                    if (curReader > fReaderMgr.getCurrentReaderNum())
+                    {
+                        emitError(XML4CErrs::PartialMarkupInEntity);
+                        return false;
+                    }
+                }
+
+                //
+                //  Check for an entity ref . We ignore the empty flag in
+                //  this one.
+                //  
+                escaped = false;
+                if (nextCh == chAmpersand)
+                {
+                    // If it was not returned directly, then jump back up
+                    if (scanEntityRef(true, nextCh, secondCh, escaped) != EntityExp_Returned)
+                    {
+                        gotLeadingSurrogate = false;
+                        continue;
+                    }
+                }
+
+                // Deal with surrogate pairs
+                if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF))
+                {
+                    //
+                    //  Its a leading surrogate. If we already got one, then
+                    //  issue an error, else set leading flag to make sure that
+                    //  we look for a trailing next time.
+                    //
+                    if (gotLeadingSurrogate)
+                    {
+                        emitError(XML4CErrs::Expected2ndSurrogateChar);
+                    }
+                     else
+                    {
+                        // Its got to at least be a valid XML character
+                        if (!XMLReader::isXMLChar(nextCh))
+                            emitError(XML4CErrs::InvalidCharacter);
+                        gotLeadingSurrogate = true;
+                    }
+                }
+                 else
+                {
+                    //
+                    //  If its a trailing surrogate, make sure that we are
+                    //  prepared for that. Else, its just a regular char so make
+                    //  sure that we were not expected a trailing surrogate.
+                    //
+                    if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF))
+                    {
+                        // Its trailing, so make sure we were expecting it
+                        if (!gotLeadingSurrogate)
+                            emitError(XML4CErrs::Unexpected2ndSurrogateChar);
+                    }
+                     else
+                    {
+                        //
+                        //  Its just a char, so make sure we were not expecting a
+                        //  trailing surrogate.
+                        //
+                        if (gotLeadingSurrogate)
+                            emitError(XML4CErrs::Expected2ndSurrogateChar);
+                    }
+                    gotLeadingSurrogate = false;
+                }
+
+                //
+                //  If it was escaped, then put in a 0xFFFF value. This will
+                //  be used later during validation and normalization of the
+                //  value to know that the following character was via an
+                //  escape char.
+                //
+                if (escaped)
+                    toFill.append(0xFFFF);
+
+                // Else add it to the buffer
+                toFill.append(nextCh);
+            }
+        }
+
+        catch(const EndOfEntityException&)
+        {
+            // Just eat it and continue.
+            gotLeadingSurrogate = false;
+            escaped = false;
+        }
+    }
+    return true;
+}
+
+
+bool XMLScanner::scanAttValue(          XMLBuffer&          toFill
+                                , const XMLAttDef::AttTypes type)
+{
+    enum States
+    {
+        InWhitespace
+        , InContent
+    };
+
+
+    // Reset the target buffer
+    toFill.reset();
+
+    // Get the next char which must be a single or double quote
+    XMLCh quoteCh;
+    if (!fReaderMgr.skipIfQuote(quoteCh))
+        return false;
+
+    //
+    //  We have to get the current reader because we have to ignore closing
+    //  quotes until we hit the same reader again.
+    //
+    const unsigned int curReader = fReaderMgr.getCurrentReaderNum();
+
+    //
+    //  Loop until we get the attribute value. Note that we use a double
+    //  loop here to avoid the setup/teardown overhead of the exception
+    //  handler on every round.
+    //
+    XMLCh   nextCh;
+    XMLCh   secondCh = 0;
+    States  curState = InContent;
+    bool    firstNonWS = false;
+    bool    gotLeadingSurrogate = false;
+    bool    escaped;
+    while (true)
+    {
+    try
+    {
+        while(true)
+        {
+            // Get another char. Use second char if one is waiting
+            if (secondCh)
+            {
+                nextCh = secondCh;
+                secondCh = 0;
+            }
+             else
+            {
+                nextCh = fReaderMgr.getNextChar();
+            }
+
+            if (!nextCh)
+                ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+
+            // Its got to at least be a valid XML character
+            if (!XMLReader::isXMLChar(nextCh))
+                emitError(XML4CErrs::InvalidCharacter);
+
+            // Check for our ending quote in the same entity
+            if (nextCh == quoteCh)
+            {
+                if (curReader == fReaderMgr.getCurrentReaderNum())
+                    return true;
+
+                // Watch for spillover into a previous entity
+                if (curReader > fReaderMgr.getCurrentReaderNum())
+                {
+                    emitError(XML4CErrs::PartialMarkupInEntity);
+                    return false;
+                }
+            }
+
+            //
+            //  Check for an entity ref now, before we let it affect our
+            //  whitespace normalization logic below. We ignore the empty flag
+            //  in this one.
+            //  
+            escaped = false;
+            if (nextCh == chAmpersand)
+            {
+                if (scanEntityRef(true, nextCh, secondCh, escaped) != EntityExp_Returned)
+                {
+                    gotLeadingSurrogate = false;
+                    continue;
+                }
+            }
+
+            // Deal with surrogate pairs
+            if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF))
+            {
+                //
+                //  Its a leading surrogate. If we already got one, then
+                //  issue an error, else set leading flag to make sure that
+                //  we look for a trailing next time.
+                //
+                if (gotLeadingSurrogate)
+                    emitError(XML4CErrs::Expected2ndSurrogateChar);
+                 else
+                    gotLeadingSurrogate = true;
+            }
+             else
+            {
+                //
+                //  If its a trailing surrogate, make sure that we are
+                //  prepared for that. Else, its just a regular char so make
+                //  sure that we were not expected a trailing surrogate.
+                //
+                if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF))
+                {
+                    // Its trailing, so make sure we were expecting it
+                    if (!gotLeadingSurrogate)
+                        emitError(XML4CErrs::Unexpected2ndSurrogateChar);
+                }
+                 else
+                {
+                    //
+                    //  Its just a char, so make sure we were not expecting a
+                    //  trailing surrogate.
+                    //
+                    if (gotLeadingSurrogate)
+                        emitError(XML4CErrs::Expected2ndSurrogateChar);
+                }
+                gotLeadingSurrogate = false;
+            }
+
+            //
+            //  If its not escaped, then make sure its not a < character, which
+            //  is not allowed in attribute values.
+            //
+            if (!escaped && (nextCh == chOpenAngle))
+                emitError(XML4CErrs::BracketInAttrValue);
+
+            //
+            //  If the attribute is a CDATA type we do simple replacement of
+            //  tabs and new lines with spaces, if the character is not escaped
+            //  by way of a char ref.
+            //
+            //  Otherwise, we do the standard non-CDATA normalization of
+            //  compressing whitespace to single spaces and getting rid of leading
+            //  and trailing whitespace.
+            //
+            if (type == XMLAttDef::CData)
+            {
+                if (!escaped)
+                {
+                    if ((nextCh == 0x09) || (nextCh == 0x0A) || (nextCh == 0x0D))
+                        nextCh = chSpace;
+                }
+            }
+             else
+            {
+                if (curState == InWhitespace)
+                {
+                    if (!XMLReader::isWhitespace(nextCh))
+                    {
+                        if (firstNonWS)
+                            toFill.append(chSpace);
+                        curState = InContent;
+                        firstNonWS = true;
+                    }
+                     else
+                    {
+                        continue;
+                    }
+                }
+                 else if (curState == InContent)
+                {
+                    if (XMLReader::isWhitespace(nextCh))
+                    {
+                        curState = InWhitespace;
+                        continue;
+                    }
+                    firstNonWS = true;
+                }
+            }
+
+            // Else add it to the buffer
+            toFill.append(nextCh);
+        }
+    }
+
+    catch(const EndOfEntityException&)
+    {
+        // Just eat it and continue.
+        gotLeadingSurrogate = false;
+        escaped = false;
+    }
+    }
+    return true;
+}
+
+
+//
+//  This method scans a CDATA section. It collects the character into one
+//  of the temp buffers and calls the document handler, if any, with the
+//  characters. It assumes that the <![CDATA string has been scanned before
+//  this call.
+//
+void XMLScanner::scanCDSection()
+{
+    //
+    //  This is the CDATA section opening sequence, minus the '<' character.
+    //  We use this to watch for nested CDATA sections, which are illegal.
+    //
+    static const XMLCh CDataPrefix[] =
+    {
+            chBang, chOpenSquare, chLatin_C, chLatin_D, chLatin_A
+        ,   chLatin_T, chLatin_A, chOpenSquare, chNull
+    };
+
+    static const XMLCh CDataClose[] =
+    {
+            chCloseSquare, chCloseAngle, chNull
+    };
+
+
+    //
+    //  The next character should be the opening square bracket. If not
+    //  issue an error, but then try to recover by skipping any whitespace
+    //  and checking again.
+    //
+    if (!fReaderMgr.skippedChar(chOpenSquare))
+    {
+        emitError(XML4CErrs::ExpectedOpenSquareBracket);
+        fReaderMgr.skipPastSpaces();
+
+        // If we still don't find it, then give up, else keep going
+        if (!fReaderMgr.skippedChar(chOpenSquare))
+            return;
+    }
+
+    // Get a buffer for this
+    XMLBufBid bbCData(&fBufMgr);
+
+    //
+    //  We just scan forward until we hit the end of CDATA section sequence.
+    //  CDATA is effectively a big escape mechanism so we don't treat markup
+    //  characters specially here.
+    //
+    bool            emittedError = false;
+    unsigned int    nestCount = 0;
+    while (true)
+    {
+        const XMLCh nextCh = fReaderMgr.getNextChar();
+
+        // Watch for unexpected end of file
+        if (!nextCh)
+        {
+            emitError(XML4CErrs::UnterminatedCDATASection);
+            ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+        }
+
+        //
+        //  If this is a close square bracket it could be our closing
+        //  sequence. Be sure though to handle nested CDATA sections. They
+        //  are illegal, but we've already issued the error and just need to
+        //  be sure not to fall out early.
+        //
+        if (nextCh == chCloseSquare)
+        {
+            if (fReaderMgr.skippedString(CDataClose))
+            {
+                if (nestCount)
+                {
+                    // We are nested, so just bump down the counter
+                    nestCount--;
+                }
+                 else
+                {
+                    // If we have a doc handler, call it
+                    if (fDocHandler)
+                    {
+                        fDocHandler->docCharacters
+                        (
+                            bbCData.getRawBuffer()
+                            , bbCData.getLen()
+                            , true
+                        );
+                    }
+
+                    // And we are done
+                    break;
+                }
+            }
+        }
+         else if (nextCh == chOpenAngle)
+        {
+            //
+            //  Watch for nested CDATA sections. We got the '<' character,
+            //  so now we check for the remainder of the ![CDATA[ sequence.
+            //  If its there, we bump a counter and issue an error.
+            //
+            if (fReaderMgr.skippedString(CDataPrefix))
+            {
+                // Bump up the nesting count
+                nestCount++;
+
+                // And issue the nested CDATA error
+                emitError(XML4CErrs::NestedCDATA);
+            }
+        }
+
+        //
+        //  Make sure its a valid character. But if we've emitted an error
+        //  already, don't both with the overhead since we've already told
+        //  them about it.
+        //
+        if (!emittedError)
+        {
+            if (!XMLReader::isXMLChar(nextCh))
+            {
+                emitError(XML4CErrs::InvalidCharacter);
+                emittedError = true;
+            }
+        }
+
+        // Add it to the buffer
+        bbCData.append(nextCh);
+    }
+}
+
+
+void XMLScanner::scanCharData(XMLBuffer& toUse)
+{
+    //
+    //  We have to watch for the stupid ]]> sequence, which is illegal in
+    //  character data. So this is a little state machine that handles that.
+    //
+    enum States
+    {
+        State_Waiting
+        , State_GotOne
+        , State_GotTwo
+    };
+
+    // Reset the buffer before we start
+    toUse.reset();
+
+    // Turn on the 'throw at end' flag of the reader manager
+    ThrowEOEJanitor jan(&fReaderMgr, true);
+
+    //
+    //  In order to be more efficient we have to use kind of a deeply nested
+    //  set of blocks here. The outer block puts on a try and catches end of
+    //  entity exceptions. The inner loop is the per-character loop. If we
+    //  put the try inside the inner loop, it would work but would require
+    //  the exception handling code setup/teardown code to be invoked for
+    //  each character.
+    //
+    XMLCh   nextCh;
+    XMLCh   secondCh = 0;
+    States  curState = State_Waiting;
+    bool    escaped = false;
+    bool    gotLeadingSurrogate = false;
+    bool    notDone = true;
+    while (notDone)
+    {
+    try
+    {
+        while (true)
+        {
+            //
+            //  Ok, lets get char data from the the readers until we hit
+            //  a special char. It returns the char that made us break out
+            //  of the loop. Use any second char first.
+            //
+            if (secondCh)
+            {
+                nextCh = secondCh;
+                secondCh = 0;
+            }
+             else
+            {
+                // Reset the surrogate flag and get another block of chars
+                nextCh = fReaderMgr.getCharData(toUse, *this, gotLeadingSurrogate);
+
+                //
+                //  If we get an EOF, that's not really expected here, but it
+                //  could happen if there was effectively no content, so just
+                //  return.
+                //
+                //  Also, if we get the open angle of some markup, then break
+                //  out.
+                //
+                if ((nextCh == chOpenAngle) || !nextCh)
+                {
+                    // If we were waiting for a trailing surrogate, its an error
+                    if (gotLeadingSurrogate)
+                        emitError(XML4CErrs::Expected2ndSurrogateChar);
+
+                    notDone = false;
+                    break;
+                }
+
+                // Get the break char out of the input buffer now
+                fReaderMgr.getNextChar();
+            }
+
+            //
+            //  Watch for a reference. Note that the escapement mechanism
+            //  is ignored in this content.
+            //
+            if (nextCh == chAmpersand)
+            {
+                sendCharData(toUse);
+
+                // Turn off the throwing at the end of entity during this
+                ThrowEOEJanitor jan(&fReaderMgr, false);
+
+                if (scanEntityRef(false, nextCh, secondCh, escaped) != EntityExp_Returned)
+                {
+                    gotLeadingSurrogate = false;
+                    continue;
+                }
+            }
+             else
+            {
+                escaped = false;
+            }
+
+            // Keep the state machine up to date
+            if (!escaped)
+            {
+                if (nextCh == chCloseSquare)
+                {
+                    if (curState == State_Waiting)
+                        curState = State_GotOne;
+                    else if (curState == State_GotOne)
+                        curState = State_GotTwo;
+                }
+                 else if (nextCh == chCloseAngle)
+                {
+                    if (curState == State_GotTwo)
+                        emitError(XML4CErrs::BadSequenceInCharData);
+                    curState = State_Waiting;
+                }
+                 else
+                {
+                    curState = State_Waiting;
+                }
+            }
+             else
+            {
+                curState = State_Waiting;
+            }
+
+            // Deal with surrogate pairs
+            if ((nextCh >= 0xD800) && (nextCh <= 0xDBFF))
+            {
+                //
+                //  Its a leading surrogate. If we already got one, then
+                //  issue an error, else set leading flag to make sure that
+                //  we look for a trailing next time.
+                //
+                if (gotLeadingSurrogate)
+                    emitError(XML4CErrs::Expected2ndSurrogateChar);
+                else
+                    gotLeadingSurrogate = true;
+            }
+             else
+            {
+                //
+                //  If its a trailing surrogate, make sure that we are
+                //  prepared for that. Else, its just a regular char so make
+                //  sure that we were not expected a trailing surrogate.
+                //
+                if ((nextCh >= 0xDC00) && (nextCh <= 0xDFFF))
+                {
+                    // Its trailing, so make sure we were expecting it
+                    if (!gotLeadingSurrogate)
+                        emitError(XML4CErrs::Unexpected2ndSurrogateChar);
+                }
+                 else
+                {
+                    //
+                    //  Its just a char, so make sure we were not expecting a
+                    //  trailing surrogate.
+                    //
+                    if (gotLeadingSurrogate)
+                        emitError(XML4CErrs::Expected2ndSurrogateChar);
+
+                    // Make sure the returned char is a valid XML char
+                    if (!XMLReader::isXMLChar(nextCh))
+                        emitError(XML4CErrs::InvalidCharacter);
+                }
+                gotLeadingSurrogate = false;
+            }
+
+            // Add this char to the buffer
+            toUse.append(nextCh);
+        }
+    }
+
+    catch(const EndOfEntityException& toCatch)
+    {
+        //
+        //  Some entity ended, so we have to send any accumulated
+        //  chars and send an end of entity event.
+        //
+        sendCharData(toUse);
+        gotLeadingSurrogate = false;
+
+        if (fDocHandler)
+            fDocHandler->endEntityReference(toCatch.getEntity());
+    }
+    }
+
+    // Send any char data that we accumulated into the buffer
+    sendCharData(toUse);
+}
+
+
+//
+//  This method scans a character reference and returns the character that
+//  was refered to. It assumes that we've already scanned the &# characters
+//  that prefix the numeric code.
+//
+bool XMLScanner::scanCharRef(XMLCh& toFill, XMLCh& second)
+{
+    bool gotOne = false;
+    unsigned int value = 0;
+
+    //
+    //  Set the radix. Its supposed to be a lower case x if hex. But, in
+    //  order to recover well, we check for an upper and put out an error
+    //  for that.
+    //
+    unsigned int radix = 10;
+    if (fReaderMgr.skippedChar(chLatin_x))
+    {
+        radix = 16;
+    }
+     else if (fReaderMgr.skippedChar(chLatin_X))
+    {
+        emitError(XML4CErrs::HexRadixMustBeLowerCase);
+        radix = 16;
+    }
+
+    while (true)
+    {
+        const XMLCh nextCh = fReaderMgr.peekNextChar();
+
+        // Watch for EOF
+        if (!nextCh)
+            ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+
+        // Break out on the terminating semicolon
+        if (nextCh == chSemiColon)
+        {
+            fReaderMgr.getNextChar();
+            break;
+        }
+
+        //
+        //  Convert this char to a binary value, or bail out if its not
+        //  one.
+        //
+        unsigned int nextVal;
+        if ((nextCh >= chDigit_0) && (nextCh <= chDigit_9))
+            nextVal = (unsigned int)(nextCh - chDigit_0);
+         else if ((nextCh >= chLatin_A) && (nextCh <= chLatin_F))
+            nextVal= (unsigned int)(10 + (nextCh - chLatin_A));
+         else if ((nextCh >= chLatin_a) && (nextCh <= chLatin_f))
+            nextVal = (unsigned int)(10 + (nextCh - chLatin_a));
+         else
+        {
+            // Return a zero
+            toFill = 0;
+
+            //
+            //  If we got at least a sigit, then do an unterminated ref error.
+            //  Else, do an expected a numerical ref thing.
+            //
+            if (gotOne)
+                emitError(XML4CErrs::UnterminatedCharRef);
+            else
+                emitError(XML4CErrs::ExpectedNumericalCharRef);
+
+            // Return failure
+            return false;
+        }
+
+        //
+        //  Make sure its valid for the radix. If not, then just eat the
+        //  digit and go on after issueing an error. Else, update the
+        //  running value with this new digit.
+        //
+        if (nextVal >= radix)
+        {
+            XMLCh tmpStr[2];
+            tmpStr[0] = nextCh;
+            tmpStr[1] = chNull;
+            emitError(XML4CErrs::BadDigitForRadix, tmpStr);
+        }
+         else
+        {
+            value = (value * radix) + nextVal;
+        }
+
+        // Indicate that we got at least one good digit
+        gotOne = true;
+
+        // And eat the last char
+        fReaderMgr.getNextChar();
+    }
+
+    // Return the char (or chars)
+    if (value >= 0x10000)
+    {
+        value -= 0x10000;
+        toFill = XMLCh((value >> 10) + 0xD800);
+        second = XMLCh((value & 0x3FF) + 0xDC00);
+    }
+     else
+    {
+        toFill = XMLCh(value);
+        second = 0;
+    }
+
+    return true;
+}
+
+
+//
+//  We get here after the '<!--' part of the comment. We scan past the
+//  terminating '-->' It will calls the appropriate handler with the comment
+//  text, if one is provided. A comment can be in either the document or
+//  the DTD, so the fInDocument flag is used to know which handler to send
+//  it to.
+//
+void XMLScanner::scanComment()
+{
+    enum States
+    {
+        InText
+        , OneDash
+        , TwoDashes
+    };
+
+    // Get a buffer for this
+    XMLBufBid bbComment(&fBufMgr);
+
+    //
+    //  Get the comment text into a temp buffer. Be sure to use temp buffer
+    //  two here, since its to be used for stuff that is potentially longer
+    //  than just a name.
+    //
+    States curState = InText;
+    while (true)
+    {
+        // Get the next character
+        const XMLCh nextCh = fReaderMgr.getNextChar();
+
+        //  Watch for an end of file
+        if (!nextCh)
+        {
+            emitError(XML4CErrs::UnterminatedComment);
+            ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+        }
+
+        // Make sure its a valid XML character
+        if (!XMLReader::isXMLChar(nextCh))
+            emitError(XML4CErrs::InvalidCharacter);
+
+        if (curState == InText)
+        {
+            // If its a dash, go to OneDash state. Otherwise take as text
+            if (nextCh == chDash)
+                curState = OneDash;
+            else
+                bbComment.append(nextCh);
+        }
+         else if (curState == OneDash)
+        {
+            //
+            //  If its another dash, then we change to the two dashes states.
+            //  Otherwise, we have to put in the deficit dash and the new
+            //  character and go back to InText.
+            //
+            if (nextCh == chDash)
+            {
+                curState = TwoDashes;
+            }
+             else
+            {
+                bbComment.append(chDash);
+                bbComment.append(nextCh);
+                curState = InText;
+            }
+        }
+         else if (curState == TwoDashes)
+        {
+            // The next character must be the closing bracket
+            if (nextCh != chCloseAngle)
+            {
+                emitError(XML4CErrs::IllegalSequenceInComment);
+                fReaderMgr.skipPastChar(chCloseAngle);
+                return;
+            }
+            break;
+        }
+    }
+
+    // If we have an available handler, call back with the comment.
+    if (fDocHandler)
+    {
+        fDocHandler->docComment
+        (
+            bbComment.getRawBuffer()
+        );
+    }
+}
+
+
+//
+//  Most equal signs can have white space around them, so this little guy
+//  just makes the calling code cleaner by eating whitespace.
+//
+bool XMLScanner::scanEq()
+{
+    fReaderMgr.skipPastSpaces();
+    if (fReaderMgr.skippedChar(chEqual))
+    {
+        fReaderMgr.skipPastSpaces();
+        return true;
+    }
+    return false;
+}
+
+
+//
+//  This method will scan a general/character entity ref. It will either
+//  expand a char ref and return it directly, or push a reader for a general
+//  entity.
+//
+//  The return value indicates whether the char parameters hold the value
+//  or whether the value was pushed as a reader, or that it failed.
+//
+//  The escaped flag tells the caller whether the returned parameter resulted
+//  from a character reference, which escapes the character in some cases. It
+//  only makes any difference if the return value indicates the value was
+//  returned directly.
+//
+XMLScanner::EntityExpRes
+XMLScanner::scanEntityRef(  const   bool    inAttVal
+                            ,       XMLCh&  firstCh
+                            ,       XMLCh&  secondCh
+                            ,       bool&   escaped)
+{
+    // Assume no escape
+    secondCh = 0;
+    escaped = false;
+
+    // We have to insure that its all in one entity
+    const unsigned int curReader = fReaderMgr.getCurrentReaderNum();
+
+    //
+    //  If the next char is a pound, then its a character reference and we
+    //  need to expand it always.
+    //
+    if (fReaderMgr.skippedChar(chPound))
+    {
+        //
+        //  Its a character reference, so scan it and get back the numeric
+        //  value it represents.
+        //
+        if (!scanCharRef(firstCh, secondCh))
+            return EntityExp_Failed;
+
+        escaped = true;
+
+        if (curReader != fReaderMgr.getCurrentReaderNum())
+            emitError(XML4CErrs::PartialMarkupInEntity);
+
+        return EntityExp_Returned;
+    }
+
+    // Expand it since its a normal entity ref
+    XMLBufBid bbName(&fBufMgr);
+    if (!fReaderMgr.getName(bbName.getBuffer()))
+    {
+        emitError(XML4CErrs::ExpectedEntityRefName);
+        return EntityExp_Failed;
+    }
+
+    //
+    //  Next char must be a semi-colon. But if its not, just emit
+    //  an error and try to continue.
+    //
+    if (!fReaderMgr.skippedChar(chSemiColon))
+        emitError(XML4CErrs::UnterminatedEntityRef);
+
+    // Make sure we ended up on the same entity reader as the & char
+    if (curReader != fReaderMgr.getCurrentReaderNum())
+        emitError(XML4CErrs::PartialMarkupInEntity);
+
+    // Look up the name in the general entity pool
+    XMLEntityDecl* decl = fValidator->findEntityDecl(bbName.getRawBuffer(), false);
+
+    // If it does not exist, then obviously an error
+    if (!decl)
+    {
+        emitError(XML4CErrs::EntityNotFound, bbName.getRawBuffer());
+        return EntityExp_Failed;
+    }
+
+    //
+    //  If we are a standalone document, then it has to have been declared
+    //  in the internal subset. Keep going though.
+    //
+    if (fStandalone && !decl->getDeclaredInIntSubset())
+        emitError(XML4CErrs::IllegalRefInStandalone, bbName.getRawBuffer());
+
+    if (decl->isExternal())
+    {
+        // If its unparsed, then its not valid here
+        if (decl->isUnparsed())
+        {
+            emitError(XML4CErrs::NoUnparsedEntityRefs, bbName.getRawBuffer());
+            return EntityExp_Failed;
+        }
+
+        // If we are in an attribute value, then not valid but keep going
+        if (inAttVal)
+            emitError(XML4CErrs::NoExtRefsInAttValue);
+
+        // And now create a reader to read this entity
+        InputSource* srcUsed;
+        XMLReader* reader = fReaderMgr.createReader
+        (
+            decl->getSystemId()
+            , decl->getPublicId()
+            , false
+            , XMLReader::RefFrom_NonLiteral
+            , XMLReader::Type_General
+            , XMLReader::Source_External
+            , srcUsed
+        );
+
+        // Put a janitor on the source so it gets cleaned up on exit
+        Janitor<InputSource> janSrc(srcUsed);
+
+        //
+        //  If the creation failed, and its not because the source was empty,
+        //  then emit an error and return.
+        //
+        if (!reader)
+            ThrowXML1(RuntimeException, XML4CExcepts::Gen_CouldNotOpenExtEntity, srcUsed->getSystemId());
+
+        //
+        //  Push the reader. If its a recursive expansion, then emit an error
+        //  and return an failure.
+        //
+        if (!fReaderMgr.pushReader(reader, decl))
+        {
+            emitError(XML4CErrs::RecursiveEntity, decl->getName());
+            return EntityExp_Failed;
+        }
+
+        // Do a start entity reference event
+        if (fDocHandler)
+            fDocHandler->startEntityReference(*decl);
+
+        // If it starts with the XML string, then parse a text decl
+        if (fReaderMgr.skippedString(XMLUni::fgXMLDeclString))
+            scanXMLDecl(Decl_Text);
+    }
+     else
+    {
+        //
+        //  If its one of the special char references, then we can return
+        //  it as a character, and its considered escaped.
+        //
+        if (decl->getIsSpecialChar())
+        {
+            firstCh = decl->getValue()[0];
+            escaped = true;
+            return EntityExp_Returned;
+        }
+
+        //
+        //  Create a reader over a memory stream over the entity value
+        //  We force it to assume UTF-16 by passing in an encoding
+        //  string. This way it won't both trying to predecode the
+        //  first line, looking for an XML/TextDecl.
+        //
+        XMLReader* valueReader = fReaderMgr.createIntEntReader
+        (
+            decl->getName()
+            , XMLReader::RefFrom_NonLiteral
+            , XMLReader::Type_General
+            , decl->getValue()
+            , decl->getValueLen()
+            , false
+        );
+
+        //
+        //  Try to push the entity reader onto the reader manager stack,
+        //  where it will become the subsequent input. If it fails, that
+        //  means the entity is recursive, so issue an error. The reader
+        //  will have just been discarded, but we just keep going.
+        //
+        if (!fReaderMgr.pushReader(valueReader, decl))
+            emitError(XML4CErrs::RecursiveEntity, decl->getName());
+
+        // Do a start entity reference event
+        if (fDocHandler)
+            fDocHandler->startEntityReference(*decl);
+
+    }
+    return EntityExp_Pushed;
+}
+
+
+//
+//  This method will scan for an id, either public or external. It can look
+//  for either and tell the caller what it found, or it can be told to look
+//  for a particular type.
+//
+bool XMLScanner::scanId(        XMLBuffer&  pubIdToFill
+                        ,       XMLBuffer&  sysIdToFill
+                        , const IDTypes     whatKind)
+{
+    // Clean out both return buffers
+    pubIdToFill.reset();
+    sysIdToFill.reset();
+
+    //
+    //  Check first for the system id first. If we find it, and system id
+    //  is one of the legal values, then lets try to scan it.
+    //
+    if (fReaderMgr.skippedString(XMLUni::fgSysIDString))
+    {
+        // If they were looking for a public id, then we failed
+        if (whatKind == IDType_Public)
+        {
+            emitError(XML4CErrs::ExpectedPublicId);
+            return false;
+        }
+
+        // We must skip spaces
+        if (!fReaderMgr.skipPastSpaces())
+        {
+            emitError(XML4CErrs::ExpectedWhitespace);
+            return false;
+        }
+
+        // Get the system literal value
+        return scanSystemLiteral(sysIdToFill);
+    }
+
+    // See if we have a public id string. If not, we are done and found nothing
+    if (!fReaderMgr.skippedString(XMLUni::fgPubIDString))
+        return false;
+
+    //
+    //  So following this we must have whitespace, a public literal, whitespace,
+    //  and a system literal.
+    //
+    if (!fReaderMgr.skipPastSpaces())
+    {
+        emitError(XML4CErrs::ExpectedWhitespace);
+
+        //
+        //  Just in case, if they just forgot the whitespace but the next char
+        //  is a single or double quote, then keep going.
+        //
+        const XMLCh chPeek = fReaderMgr.peekNextChar();
+        if ((chPeek != chDoubleQuote) && (chPeek != chSingleQuote))
+            return false;
+    }
+
+    if (!scanPublicLiteral(pubIdToFill))
+    {
+        emitError(XML4CErrs::ExpectedPublicId);
+        return false;
+    }
+
+    // If they wanted a public id, then this is all
+    if (whatKind == IDType_Public)
+        return true;
+
+    // Else lets get the system id
+    if (!fReaderMgr.skipPastSpaces())
+    {
+        //
+        //  In order to recover best here we need to see if we don't have
+        //  whitespace because the next thing is a quote or because the next
+        //  thing is some non-quote character.
+        //
+        const XMLCh chPeek = fReaderMgr.peekNextChar();
+        const bool bIsQuote =  ((chPeek == chDoubleQuote)
+                               || (chPeek == chSingleQuote));
+
+        if (whatKind == IDType_External)
+        {
+            //
+            //  If its an external Id, then we need to see the system id.
+            //  So, emit the error. But, if the next char is a quote, don't
+            //  give up since its probably going to work. The user just
+            //  missed the separating space. Otherwise, fail.
+            //
+            emitError(XML4CErrs::ExpectedWhitespace);
+            if (!bIsQuote)
+                return false;
+        }
+         else
+        {
+            //
+            //  We can legally return here. But, if the next char is a quote,
+            //  then that's probably not what was desired, since its probably
+            //  just that space was forgotten and there really is a system
+            //  id to follow.
+            //
+            //  So treat it like missing whitespace if so and keep going.
+            //  Else, just return success.
+            //
+            if (bIsQuote)
+                emitError(XML4CErrs::ExpectedWhitespace);
+             else
+                return true;
+        }
+    }
+
+    if (!scanSystemLiteral(sysIdToFill))
+    {
+        emitError(XML4CErrs::ExpectedSystemId);
+        return false;
+    }
+
+    return true;
+}
+
+
+//
+//  This method scans a public literal. It must be quoted and all of its
+//  characters must be valid public id characters. The quotes are discarded
+//  and the results are returned.
+//
+bool XMLScanner::scanPublicLiteral(XMLBuffer& toFill)
+{
+    toFill.reset();
+
+    // Get the next char which must be a single or double quote
+    XMLCh quoteCh;
+    if (!fReaderMgr.skipIfQuote(quoteCh))
+        return false;
+
+    while (true)
+    {
+        const XMLCh nextCh = fReaderMgr.getNextChar();
+
+        // Watch for EOF
+        if (!nextCh)
+            ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+
+        if (nextCh == quoteCh)
+            break;
+
+        //
+        //  If its not a valid public id char, then report it but keep going
+        //  since that's the best recovery scheme.
+        //
+        if (!XMLReader::isPublicIdChar(nextCh))
+            emitError(XML4CErrs::InvalidPublicIdChar);
+
+        toFill.append(nextCh);
+    }
+    return true;
+}
+
+
+//
+//  This method handles scanning in a quoted system literal. It expects to
+//  start on the open quote and returns after eating the ending quote. There
+//  are not really any restrictions on the contents of system literals.
+//
+bool XMLScanner::scanSystemLiteral(XMLBuffer& toFill)
+{
+    toFill.reset();
+
+    // Get the next char which must be a single or double quote
+    XMLCh quoteCh;
+    if (!fReaderMgr.skipIfQuote(quoteCh))
+        return false;
+
+    bool retVal = true;
+    while (retVal)
+    {
+        const XMLCh nextCh = fReaderMgr.getNextChar();
+
+        // Watch for EOF
+        if (!nextCh)
+            ThrowXML(UnexpectedEOFException, XML4CExcepts::Gen_UnexpectedEOF);
+
+        // Break out on terminating quote
+        if (nextCh == quoteCh)
+            break;
+
+        toFill.append(nextCh);
+    }
+    return retVal;
+}
+
+
+unsigned int
+XMLScanner::scanUpToWSOr(XMLBuffer& toFill, const XMLCh chEndChar)
+{
+    fReaderMgr.getUpToCharOrWS(toFill, chEndChar);
+    return toFill.getLen();
+}
diff --git a/src/parsers/DOMParser.cpp b/src/parsers/DOMParser.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..912020312bf3049ca9e9607a15cbe1e84cf9a36d
--- /dev/null
+++ b/src/parsers/DOMParser.cpp
@@ -0,0 +1,533 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+
+/**
+ *  This file contains code to build the DOM tree. It registers a document
+ *  handler with the scanner. In these handler methods, appropriate DOM nodes
+ *  are created and added to the DOM tree.
+ *
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:49  twl
+ * Initial revision
+ *
+ * Revision 1.7  1999/11/08 20:44:52  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <sax/EntityResolver.hpp>
+#include <sax/ErrorHandler.hpp>
+#include <sax/SAXParseException.hpp>
+#include <framework/XMLNotationDecl.hpp>
+#include <util/IOException.hpp>
+#include <internal/URLInputSource.hpp>
+#include <internal/XMLScanner.hpp>
+#include <validators/DTD/DTDValidator.hpp>
+#include <parsers/DOMParser.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Constructors and Destructor
+// ---------------------------------------------------------------------------
+DOMParser::DOMParser(XMLValidator* const valToAdopt) :
+
+    fErrorHandler(0)
+    , fEntityResolver(0)
+    , fExpandEntityReferences(false)
+    , fNodeStack(0)
+    , fScanner(0)
+    , fValidator(valToAdopt)
+{
+
+    // Create the validator if one was not provided
+    if (!fValidator)
+        fValidator = new DTDValidator;
+
+    //
+    //  Create a scanner and tell it what validator to use. Then set us
+    //  as the document event handler so we can fill the DOM document.
+    //
+    fScanner = new XMLScanner(fValidator);
+    fScanner->setDocHandler(this);
+
+    fNodeStack = new ValueStackOf<DOM_Node>(64);
+    this->reset();
+
+
+}
+
+
+DOMParser::~DOMParser()
+{
+    delete fNodeStack;
+    delete fScanner;
+    delete fValidator;
+}
+
+
+void DOMParser::reset()
+{
+    fDocument = DOM_Document::createDocument();
+        //   Note:  DOM Documents are reference counted.  Doing this 
+        //   assignment will cause the old one to go away unless 
+        //   application code is also holding a reference to it.
+    fCurrentParent   = 0;
+    fCurrentNode     = 0;
+    fParseInProgress = false;
+    fWithinElement   = false;
+    fNodeStack->removeAllElements();
+};
+
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Getter methods
+// ---------------------------------------------------------------------------
+inline const XMLValidator& DOMParser::getValidator() const
+{
+    return *fValidator;
+}
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Setter methods
+// ---------------------------------------------------------------------------
+void DOMParser::setDoNamespaces(const bool newState)
+{
+    fScanner->setDoNamespaces(newState);
+}
+
+void DOMParser::setDoValidation(const bool newState)
+{
+    fScanner->setDoValidation(newState);
+}
+
+void DOMParser::setErrorHandler(ErrorHandler* const handler)
+{
+    fErrorHandler = handler;
+    if (fErrorHandler)
+    {
+        fScanner->setErrorReporter(this);
+        fValidator->setErrorReporter(this);
+    }
+     else
+    {
+        fScanner->setErrorReporter(0);
+        fValidator->setErrorReporter(0);
+    }
+}
+
+void DOMParser::setEntityResolver(EntityResolver* const handler)
+{
+    fEntityResolver = handler;
+    if (fEntityResolver)
+        fScanner->setEntityHandler(this);
+    else
+        fScanner->setEntityHandler(0);
+}
+
+void DOMParser::setExitOnFirstFatalError(const bool newState)
+{
+    fScanner->setExitOnFirstFatal(newState);
+}
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Parsing methods
+// ---------------------------------------------------------------------------
+void DOMParser::parse(const InputSource& source, const bool reuseValidator)
+{
+    // Avoid multiple entrance
+    if (fParseInProgress)
+        ThrowXML(IOException, XML4CExcepts::Gen_ParseInProgress);
+
+    try
+    { 
+        fParseInProgress = true;
+        fScanner->scanDocument(source, reuseValidator);
+        fParseInProgress = false;
+    }
+
+    catch(const SAXException&)
+    {
+        fParseInProgress = false;
+        throw;
+    }
+
+    catch(const XMLException&)
+    {
+        fParseInProgress = false;
+        throw;
+    }
+}
+
+void DOMParser::parse(const XMLCh* const systemId, const bool reuseValidator)
+{
+    // Just call the URL input source version
+    parse(URLInputSource(systemId), reuseValidator);
+}
+
+void DOMParser::parse(const char* const systemId, const bool reuseValidator)
+{
+    // Just call the URL input source version
+    parse(URLInputSource(systemId), reuseValidator);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Progressive parse methods
+// ---------------------------------------------------------------------------
+bool DOMParser::parseFirst( const   XMLCh* const    systemId
+                            ,       XMLPScanToken&  toFill
+                            , const bool            reuseValidator)
+{
+    // Call the other version with a URL input source
+    return parseFirst(URLInputSource(systemId), toFill, reuseValidator);
+}
+
+bool DOMParser::parseFirst( const   char* const         systemId
+                            ,       XMLPScanToken&      toFill
+                            , const bool                reuseValidator)
+{
+    // Call the other version with a URL input source
+    return parseFirst(URLInputSource(systemId), toFill, reuseValidator);
+}
+
+bool DOMParser::parseFirst( const   InputSource&    source
+                            ,       XMLPScanToken&  toFill
+                            , const bool            reuseValidator)
+{
+    //
+    //  Avoid multiple entrance. We cannot enter here while a regular parse
+    //  is in progress.
+    //
+    if (fParseInProgress)
+        ThrowXML(IOException, XML4CExcepts::Gen_ParseInProgress);
+
+    return fScanner->scanFirst(source, toFill, reuseValidator);
+}
+
+bool DOMParser::parseNext(XMLPScanToken& token)
+{
+    return fScanner->scanNext(token);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Implementation of the XMLErrorReporter interface
+// ---------------------------------------------------------------------------
+void DOMParser::error(  const   unsigned int                code
+                        , const XMLCh* const                msgDomain
+                        , const XMLErrorReporter::ErrTypes  errType
+                        , const XMLCh* const                errorText
+                        , const XMLCh* const                systemId
+                        , const XMLCh* const                publicId
+                        , const unsigned int                lineNum
+                        , const unsigned int                colNum)
+{
+    SAXParseException toThrow = SAXParseException
+    (
+        errorText
+        , publicId
+        , systemId
+        , lineNum
+        , colNum
+    );
+
+    //
+    //  If there is an error handler registered, call it, otherwise ignore
+    //  all but the fatal errors.
+    //
+    if (!fErrorHandler)
+    {
+        if (errType == XMLErrorReporter::ErrType_Fatal)
+            throw toThrow;
+        return;
+    }
+
+    if (errType == XMLErrorReporter::ErrType_Warning)
+        fErrorHandler->warning(toThrow);
+    else if (errType >= XMLErrorReporter::ErrType_Fatal)
+        fErrorHandler->fatalError(toThrow);
+    else
+        fErrorHandler->error(toThrow);
+}
+
+void DOMParser::resetErrors()
+{
+}
+
+
+    
+// ---------------------------------------------------------------------------
+//  DOMParser: Implementation of XMLEntityHandler interface
+// ---------------------------------------------------------------------------
+InputSource*
+DOMParser::resolveEntity(const XMLCh* const publicId, const XMLCh* const systemId)
+{
+    //
+    //  Just map it to the SAX entity resolver. If there is not one installed,
+    //  return a null pointer to cause the default resolution.
+    //
+    if (fEntityResolver)
+        return fEntityResolver->resolveEntity(publicId, systemId);
+    return 0;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Implementation of XMLDocumentHandler interface
+// ---------------------------------------------------------------------------
+void DOMParser::docCharacters(  const   XMLCh* const    chars
+                                , const unsigned int    length
+                                , const bool            cdataSection)
+{
+    // Ignore chars outside of content
+    if (!fWithinElement)
+        return;
+
+    if (cdataSection == true)
+    {
+        DOM_CDATASection node = fDocument.createCDATASection
+        (
+            DOMString(chars, length)
+        );
+        fCurrentParent.appendChild(node);
+        fCurrentNode = node;
+    }
+     else
+    {
+        if (fCurrentNode.getNodeType() == DOM_Node::TEXT_NODE)
+        {
+            DOM_Text node = (DOM_Text&)fCurrentNode;
+            node.appendData(DOMString(chars, length));
+        }
+         else
+        {
+            DOM_Text node = fDocument.createTextNode(DOMString(chars, length));
+            fCurrentParent.appendChild(node);
+            fCurrentNode = node;
+        }
+    }
+}
+
+
+void DOMParser::docComment(const XMLCh* const comment)
+{
+    DOM_Comment dcom = fDocument.createComment(comment);
+    fCurrentParent.appendChild(dcom);
+    fCurrentNode = dcom;
+}
+
+
+void DOMParser::docPI(  const   XMLCh* const    target
+                        , const XMLCh* const    data)
+{
+    DOM_ProcessingInstruction pi = fDocument.createProcessingInstruction
+    (
+        target
+        , data
+    );
+    fCurrentParent.appendChild(pi);
+    fCurrentNode = pi;
+}
+
+
+void DOMParser::endEntityReference(const XMLEntityDecl& entDecl)
+{
+    if (fExpandEntityReferences == true)
+    {
+        fCurrentParent = fNodeStack->pop();
+        fCurrentNode   = fCurrentParent;
+    }
+}
+
+
+void DOMParser::endElement( const   XMLElementDecl&     elemDecl
+                            , const unsigned int        urlId
+                            , const bool                isRoot)
+{
+    fCurrentNode   = fCurrentParent;
+    fCurrentParent = fNodeStack->pop();
+
+    // If we've hit the end of content, clear the flag
+    if (fNodeStack->empty())
+        fWithinElement = false;
+}
+
+
+void DOMParser::ignorableWhitespace(const   XMLCh* const    chars
+                                    , const unsigned int    length
+                                    , const bool            cdataSection)
+{
+    // Ignore chars before the root element
+    if (!fWithinElement)
+        return;
+
+    if (fCurrentNode.getNodeType() == DOM_Node::TEXT_NODE)
+    {
+        DOM_Text node = (DOM_Text&)fCurrentNode;
+        node.appendData(DOMString(chars, length));
+    }
+     else
+    {
+        DOM_Text node = fDocument.createTextNode(DOMString(chars, length));
+        fCurrentParent.appendChild(node);
+        fCurrentNode = node;
+    }
+}
+
+
+void DOMParser::resetDocument()
+{
+    //
+    //  The reset methods are called before a new parse event occurs. 
+    //  Reset this parsers state to clear out anything that may be left
+    //  from a previous use, in particular the DOM document itself.
+    //
+    this->reset();
+}
+
+
+void DOMParser::startDocument()
+{
+    // Just set the document as the current parent and current node
+    fCurrentParent = fDocument;
+    fCurrentNode   = fDocument;
+}
+
+
+void DOMParser::startElement(const  XMLElementDecl&         elemDecl
+                            , const unsigned int            urlId
+                            , const XMLCh* const            elemPrefix
+                            , const RefVectorOf<XMLAttr>&   attrList
+                            , const unsigned int            attrCount
+                            , const bool                    isEmpty
+                            , const bool                    isRoot)
+{
+    DOM_Element elem;
+    if (fScanner -> getDoNamespaces()) {    //DOM Level 2, doNamespaces on
+        unsigned int globalNSid = fValidator -> getGlobalNamespaceId();
+	XMLBuffer buf;
+	DOMString namespaceURI = 0;
+        if (urlId != globalNSid) {	//TagName has prefix
+	    fValidator -> getURIText(urlId, buf);   //get namespaceURI
+	    namespaceURI = DOMString(buf.getRawBuffer());
+	}
+	elem = fDocument.createElementNS(namespaceURI, elemDecl.getFullName());
+	for (unsigned int index = 0; index < attrCount; ++index) {
+	    const XMLAttr* oneAttrib = attrList.elementAt(index);
+	    unsigned int attrURIId = oneAttrib -> getURIId();
+	    namespaceURI = 0;
+	    if (attrURIId != globalNSid) {	//Attribute Name has prefix
+		fValidator -> getURIText(attrURIId, buf);   //get namespaceURI
+		namespaceURI = DOMString(buf.getRawBuffer());
+	    }
+	    elem.setAttributeNS(namespaceURI, oneAttrib -> getQName(),
+		oneAttrib -> getValue());
+	}
+    } else {	//DOM Level 1
+	elem = fDocument.createElement(elemDecl.getFullName());
+	for (unsigned int index = 0; index < attrCount; ++index) {
+	    const XMLAttr* oneAttrib = attrList.elementAt(index);
+	    elem.setAttribute(oneAttrib->getName(), oneAttrib->getValue());
+	}
+    }
+
+    fCurrentParent.appendChild(elem);
+    fNodeStack->push(fCurrentParent);
+    fCurrentParent = elem;
+    fCurrentNode = elem;
+    fWithinElement = true;
+
+    // If an empty element, do end right now (no endElement() will be called)
+    if (isEmpty)
+        endElement(elemDecl, urlId, isRoot);
+}
+
+
+void DOMParser::startEntityReference(const XMLEntityDecl& entDecl)
+{
+    if (fExpandEntityReferences == true)
+    {
+        DOM_EntityReference er = fDocument.createEntityReference
+        (
+            DOMString(entDecl.getName())
+        );
+        fCurrentParent.appendChild(er);
+        fNodeStack->push(fCurrentParent);
+        fCurrentParent = er;
+        fCurrentNode = er;
+    }
+}
+
+
+void DOMParser::XMLDecl(const   XMLCh* const
+                        , const XMLCh* const
+                        , const XMLCh* const
+                        , const XMLCh* const)
+{
+    // This is not used by DOM at this time
+}
diff --git a/src/parsers/DOMParser.hpp b/src/parsers/DOMParser.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e4f17977b00363bbe2b49e0d5800e56827bd107c
--- /dev/null
+++ b/src/parsers/DOMParser.hpp
@@ -0,0 +1,407 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:49  twl
+ * Initial revision
+ *
+ * Revision 1.5  1999/11/08 20:44:53  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(DOMPARSER_HPP)
+#define DOMPARSER_HPP
+
+
+#include <dom/DOM_Document.hpp>
+#include <framework/XMLDocumentHandler.hpp>
+#include <framework/XMLErrorReporter.hpp>
+#include <framework/XMLEntityHandler.hpp>
+#include <util/ValueStackOf.hpp>
+
+class EntityResolver;
+class ErrorHandler;
+class XMLPScanToken;
+class XMLScanner;
+class XMLValidator;
+
+
+/**
+ *  <p>This configuration of IBM XML4C builds a DOM for the input file.
+ */
+class PARSERS_EXPORT DOMParser :
+
+    public XMLDocumentHandler
+    , public XMLErrorReporter
+    , public XMLEntityHandler
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Detructor
+    // -----------------------------------------------------------------------
+    DOMParser(XMLValidator* const valToAdopt = 0);
+    ~DOMParser();
+    void reset();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    DOM_Document getDocument();
+    ErrorHandler* getErrorHandler();
+    const ErrorHandler* getErrorHandler() const;
+    EntityResolver* getEntityResolver();
+    const EntityResolver* getEntityResolver() const;
+    bool getExpandEntityReferences() const;
+    const XMLScanner& getScanner() const;
+    const XMLValidator& getValidator() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setDoNamespaces(const bool newState);
+    void setDoValidation(const bool newState);
+    void setExpandEntityReferences(const bool expand);
+    void setErrorHandler(ErrorHandler* const handler);
+    void setEntityResolver(EntityResolver* const handler);
+    void setExitOnFirstFatalError(const bool newState);
+
+
+    // -----------------------------------------------------------------------
+    //  Parsing methods
+    // -----------------------------------------------------------------------
+    void parse(const InputSource& source, const bool reuseValidator = false);
+    void parse(const XMLCh* const systemId, const bool reuseValidator = false);
+    void parse(const char* const systemId, const bool reuseValidator = false);
+    bool parseFirst
+    (
+        const   XMLCh* const    systemId
+        ,       XMLPScanToken&  toFill
+        , const bool            reuseValidator = false
+    );
+    bool parseFirst
+    (
+        const   char* const     systemId
+        ,       XMLPScanToken&  toFill
+        , const bool            reuseValidator = false
+    );
+    bool parseFirst
+    (
+        const   InputSource&    source
+        ,       XMLPScanToken&  toFill
+        , const bool            reuseValidator = false
+    );
+    bool parseNext(XMLPScanToken& token);
+
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the XMLErrorReporter interface.
+    // -----------------------------------------------------------------------
+    virtual void error
+    (
+        const   unsigned int                errCode
+        , const XMLCh* const                msgDomain
+        , const XMLErrorReporter::ErrTypes  errType
+        , const XMLCh* const                errorText
+        , const XMLCh* const                systemId
+        , const XMLCh* const                publicId
+        , const unsigned int                lineNum
+        , const unsigned int                colNum
+    );
+    virtual void resetErrors();
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the XMLEntityHandler interface.
+    // -----------------------------------------------------------------------
+    virtual void endInputSource(const InputSource& inputSource);
+
+    virtual const bool expandSystemId
+    (
+        const   XMLCh* const    systemId
+        ,       XMLBuffer&      toFill
+    );
+
+    virtual void resetEntities();
+
+    virtual InputSource* resolveEntity
+    (
+        const   XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    );
+
+    virtual void startInputSource(const InputSource& inputSource);
+
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the XMLDocumentHandler interface.
+    // -----------------------------------------------------------------------
+    virtual void docCharacters
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+        , const bool            cdataSection
+    );
+
+    virtual void docComment
+    (
+        const   XMLCh* const    comment
+    );
+
+    virtual void docPI
+    (
+        const   XMLCh* const    target
+        , const XMLCh* const    data
+    );
+
+    virtual void endDocument();
+
+    virtual void endElement
+    (
+        const   XMLElementDecl& elemDecl
+        , const unsigned int    urlId
+        , const bool            isRoot
+    );
+
+    virtual void endEntityReference
+    (
+        const   XMLEntityDecl&  entDecl
+    );
+
+    virtual void ignorableWhitespace
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+        , const bool            cdataSection
+    );
+
+    virtual void resetDocument();
+
+    virtual void startDocument();
+
+    virtual void startElement
+    (
+        const   XMLElementDecl&         elemDecl
+        , const unsigned int            urlId
+        , const XMLCh* const            elemPrefix
+        , const RefVectorOf<XMLAttr>&   attrList
+        , const unsigned int            attrCount
+        , const bool                    isEmpty
+        , const bool                    isRoot
+    );
+
+    virtual void startEntityReference
+    (
+        const   XMLEntityDecl&  entDecl
+    );
+
+    virtual void XMLDecl
+    (
+        const   XMLCh* const    versionStr
+        , const XMLCh* const    encodingStr
+        , const XMLCh* const    standaloneStr
+        , const XMLCh* const    actualEncStr
+    );
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fCurrentNode
+    //  fCurrentParent
+    //      Used to track the current node during nested element events. Since
+    //      the tree must be built from a set of disjoint callbacks, we need
+    //      these to keep up with where we currently are.
+    //
+    //  fDocument
+    //      The root document object, filled with the document contents.
+    //
+    //  fEntityResolver
+    //      The installed SAX entity resolver, if any. Null if none.
+    //
+    //  fErrorHandler
+    //      The installed SAX error handler, if any. Null if none.
+    //
+    //  fExpandEntityReference
+    //      Indicates whether entity reference nodes should be expanded to
+    //      its constituent text nodes or just created a single (end result)
+    //      text node.
+    //
+    //  fNodeStack
+    //      Used to track previous parent nodes during nested element events.
+    //
+    //  fParseInProgress
+    //      Used to prevent multiple entrance to the parser while its doing
+    //      a parse.
+    //
+    //  fScanner
+    //      The scanner used for this parser. This is created during the
+    //      constructor.
+    //
+    //  fValidator
+    //      The validator that is installed. If none is provided, we will
+    //      create and install a DTD validator. We install this on the
+    //      scanner we create, which it will use to do validation. We set
+    //      ourself on it as the error reporter for validity errors.
+    //
+    //  fWithinElement
+    //      A flag to indicate that the parser is within at least one level
+    //      of element processing.
+    // -----------------------------------------------------------------------
+    DOM_Node                fCurrentParent;
+    DOM_Node                fCurrentNode;
+    DOM_Document            fDocument;
+    EntityResolver*         fEntityResolver;
+    ErrorHandler*           fErrorHandler;
+    bool                    fExpandEntityReferences;
+    ValueStackOf<DOM_Node>* fNodeStack;
+    bool                    fParseInProgress;
+    XMLScanner*             fScanner;
+    XMLValidator*           fValidator;
+    bool                    fWithinElement;
+};
+
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Handlers for the XMLEntityHandler interface
+// ---------------------------------------------------------------------------
+inline void DOMParser::endInputSource(const InputSource&)
+{
+    // The SAX entity resolver doesn't handle this
+}
+
+inline const bool DOMParser::expandSystemId(const XMLCh* const, XMLBuffer&)
+{
+    // The SAX entity resolver doesn't handle this
+    return false;
+}
+
+inline void DOMParser::resetEntities()
+{
+    // Nothing to do on this one
+}
+
+inline void DOMParser::startInputSource(const InputSource&)
+{
+    // The SAX entity resolver doesn't handle this
+}
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Handlers for the XMLDocumentHandler interface
+// ---------------------------------------------------------------------------
+inline void DOMParser::endDocument()
+{
+    // Not used in DOM at this time
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Getter methods
+// ---------------------------------------------------------------------------
+inline DOM_Document DOMParser::getDocument()
+{
+    return fDocument;
+}
+
+inline ErrorHandler* DOMParser::getErrorHandler()
+{
+    return fErrorHandler;
+}
+
+inline const ErrorHandler* DOMParser::getErrorHandler() const
+{
+    return fErrorHandler;
+}
+
+inline EntityResolver* DOMParser::getEntityResolver()
+{
+    return fEntityResolver;
+}
+
+inline const EntityResolver* DOMParser::getEntityResolver() const
+{
+    return fEntityResolver;
+}
+
+inline bool DOMParser::getExpandEntityReferences() const
+{
+    return fExpandEntityReferences;
+}
+
+inline const XMLScanner& DOMParser::getScanner() const
+{
+    return *fScanner;
+}
+
+
+// ---------------------------------------------------------------------------
+//  DOMParser: Setter methods
+// ---------------------------------------------------------------------------
+inline void DOMParser::setExpandEntityReferences(const bool expand)
+{
+    fExpandEntityReferences = expand;
+}
+
+#endif
diff --git a/src/parsers/Makefile.in b/src/parsers/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..6f84d1b642f22deacccda73eb61f602f23efc27c
--- /dev/null
+++ b/src/parsers/Makefile.in
@@ -0,0 +1,130 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:07:50  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:44:53  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#
+#
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+LDFLAGS = @ldflags@
+LIBS = @libs@
+OSVER = @osver@
+USELIBWWW = @uselibwww@
+MESSAGELOADER = @messageloader@
+TRANSCODER = @transcoder@
+
+include ../Makefile.incl
+
+MODULE = parsers
+
+PARSERS_CPP_PUBHEADERS = \
+	DOMParser.hpp \
+	SAXParser.hpp
+
+PARSERS_CPP_PRIVHEADERS = 
+
+PARSERS_C_FILES = 
+
+PARSERS_CPP_OBJECTS = \
+	DOMParser.o \
+	SAXParser.o
+
+all:	includes $(PARSERS_CPP_OBJECTS) publish
+
+includes:	pubheaders $(PARSERS_C_FILES)
+
+pubheaders:
+	-mkdir -p $(XML_INC_DIR)/$(MODULE)
+	$(CP) $(PARSERS_CPP_PUBHEADERS) $(PARSERS_C_FILES) $(XML_INC_DIR)/$(MODULE)
+
+publish:
+	-mkdir -p ${ALL_OBJECTS_DIR}
+	$(CP) $(PARSERS_CPP_OBJECTS) $(ALL_OBJECTS_DIR)
+
+# this may generate unnecessary dependencies, but it makes life easier
+depend: includes
+	$(MAKE_DEPEND) $(XML_INCL) *.cpp > $(DEPFILE)
+
+clean:
+	@echo "Making clean in $(MODULE) ..."
+	$(RM) $(PARSERS_CPP_OBJECTS)
+
+distclean:	clean
+	$(RM) Makefile $(DEPFILE)
+	@echo "Removing all $(MODULE) header files ..."
+	@for file in $(PARSERS_CPP_PUBHEADERS); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@for file in $(PARSERS_C_FILES); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@echo "Removing all $(MODULE) object files ..."
+	@for file in $(PARSERS_CPP_OBJECTS); do \
+	rm -f $(ALL_OBJECTS_DIR)/$$file; \
+	done
+
+install:
+	-mkdir -p $(PREFIX)/$(MODULE)
+	$(CP) $(PARSERS_CPP_PUBHEADERS) $(PARSERS_C_FILES) $(PREFIX)/$(MODULE)
diff --git a/src/parsers/SAXParser.cpp b/src/parsers/SAXParser.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2cad8b03f7db8c63a825eb7a279a36104e5aa028
--- /dev/null
+++ b/src/parsers/SAXParser.cpp
@@ -0,0 +1,835 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:50  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:44:53  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include <util/IOException.hpp>
+#include <sax/DocumentHandler.hpp>
+#include <sax/DTDHandler.hpp>
+#include <sax/ErrorHandler.hpp>
+#include <sax/EntityResolver.hpp>
+#include <sax/SAXParseException.hpp>
+#include <internal/URLInputSource.hpp>
+#include <internal/XMLScanner.hpp>
+#include <parsers/SAXParser.hpp>
+#include <validators/DTD/DTDValidator.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Constructors and Destructor
+// ---------------------------------------------------------------------------
+SAXParser::SAXParser(XMLValidator* const valToAdopt) :
+
+    fDocHandler(0)
+    , fElemDepth(0)
+    , fEntityResolver(0)
+    , fErrorHandler(0)
+    , fAdvDHCount(0)
+    , fAdvDHList(0)
+    , fAdvDHListSize(32)
+    , fParseInProgress(false)
+    , fScanner(0)
+    , fValidator(valToAdopt)
+{
+    // Create the validator if one was not provided.
+    if (!fValidator)
+        fValidator = new DTDValidator;
+
+    // Create our scanner and tell it what validator to use
+    fScanner = new XMLScanner(fValidator);
+
+    // Create the initial advanced handler list array and zero it out
+    fAdvDHList = new XMLDocumentHandler*[fAdvDHListSize];
+    memset(fAdvDHList, 0, sizeof(void*) * fAdvDHListSize);
+}
+
+
+SAXParser::~SAXParser() 
+{
+    delete [] fAdvDHList;
+    delete fScanner;
+    delete fValidator;
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Advanced document handler list maintenance methods
+// ---------------------------------------------------------------------------
+void SAXParser::installAdvDocHandler(XMLDocumentHandler* const toInstall)
+{
+    // See if we need to expand and do so now if needed
+    if (fAdvDHCount == fAdvDHListSize)
+    {
+        // Calc a new size and allocate the new temp buffer
+        const unsigned int newSize = (unsigned int)(fAdvDHListSize * 1.5);
+        XMLDocumentHandler** newList = new XMLDocumentHandler*[newSize];
+
+        // Copy over the old data to the new list and zero out the rest
+        memcpy(newList, fAdvDHList, sizeof(void*) * fAdvDHListSize);
+        memset
+        (
+            &newList[fAdvDHListSize]
+            , 0
+            , sizeof(void*) * (newSize - fAdvDHListSize)
+        );
+
+        // And now clean up the old array and store the new stuff
+        delete [] fAdvDHList;
+        fAdvDHList = newList;
+        fAdvDHListSize = newSize;
+    }
+
+    // Add this new guy into the empty slot
+    fAdvDHList[fAdvDHCount++] = toInstall;
+
+    //
+    //  Install ourself as the document handler with the scanner. We might
+    //  already be, but its not worth checking, just do it.
+    //
+    fScanner->setDocHandler(this);
+}
+
+
+bool SAXParser::removeAdvDocHandler(XMLDocumentHandler* const toRemove)
+{
+    // If our count is zero, can't be any installed
+    if (!fAdvDHCount)
+        return false;
+
+    //
+    //  Search the array until we find this handler. If we find a null entry
+    //  first, we can stop there before the list is kept contiguous.
+    //
+    unsigned int index;
+    for (index = 0; index < fAdvDHCount; index++)
+    {
+        //
+        //  We found it. We have to keep the list contiguous, so we have to
+        //  copy down any used elements after this one.
+        //
+        if (fAdvDHList[index] == toRemove)
+        {
+            //
+            //  Optimize if only one entry (pretty common). Otherwise, we
+            //  have to copy them down to compact them.
+            //
+            if (fAdvDHCount > 1)
+            {
+                index++;
+                while (index < fAdvDHCount)
+                    fAdvDHList[index - 1] = fAdvDHList[index];
+            }
+
+            // Bump down the count and zero out the last one
+            fAdvDHCount--;
+            fAdvDHList[fAdvDHCount] = 0;
+
+            //
+            //  If this leaves us with no advanced handlers and there is
+            //  no SAX doc handler installed on us, then remove us from the
+            //  scanner as the document handler.
+            //
+            if (!fAdvDHCount && !fDocHandler)
+                fScanner->setDocHandler(0);
+
+            return true;
+        }
+    }
+
+    // Never found it
+    return false;
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Setter methods
+// ---------------------------------------------------------------------------
+void SAXParser::setDoNamespaces(const bool newState)
+{
+    fScanner->setDoNamespaces(newState);
+}
+
+
+void SAXParser::setDoValidation(const bool newState)
+{
+    fScanner->setDoValidation(newState);
+}
+
+
+void SAXParser::setExitOnFirstFatalError(const bool newState)
+{
+    fScanner->setExitOnFirstFatal(newState);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Getter methods
+// ---------------------------------------------------------------------------
+const XMLValidator& SAXParser::getValidator() const
+{
+    return *fValidator;
+}
+
+
+bool SAXParser::getDoNamespaces() const
+{
+    return fScanner->getDoNamespaces();
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Overrides of the SAX Parser interface
+// ---------------------------------------------------------------------------
+void SAXParser::parse(const InputSource& source, const bool reuseValidator)
+{
+    // Avoid multiple entrance
+    if (fParseInProgress)
+        ThrowXML(IOException, XML4CExcepts::Gen_ParseInProgress);
+
+    try
+    { 
+        fParseInProgress = true;
+        fScanner->scanDocument(source, reuseValidator);
+        fParseInProgress = false;
+    }
+
+    catch (const SAXException&)
+    {
+        fParseInProgress = false;
+        throw;
+    }
+
+    catch (const XMLException&)
+    {
+        fParseInProgress = false;
+        throw;
+    }
+}
+
+void SAXParser::parse(const XMLCh* const systemId, const bool reuseValidator)
+{
+    if (fParseInProgress)
+        ThrowXML(IOException, XML4CExcepts::Gen_ParseInProgress);
+
+    parse(URLInputSource(systemId), reuseValidator);
+}
+
+void SAXParser::parse(const char* const systemId, const bool reuseValidator)
+{
+    if (fParseInProgress)
+        ThrowXML(IOException, XML4CExcepts::Gen_ParseInProgress);
+
+    parse(URLInputSource(systemId), reuseValidator);
+}
+
+void SAXParser::setDocumentHandler(DocumentHandler* const handler)
+{
+    fDocHandler = handler;
+    if (fDocHandler)
+    {
+        //
+        //  Make sure we are set as the document handler with the scanner.
+        //  We may already be (if advanced handlers are installed), but its
+        //  not worthing checking, just do it.
+        //
+        fScanner->setDocHandler(this);
+    }
+     else
+    {
+        //
+        //  If we don't have any advanced handlers either, then deinstall us
+        //  from the scanner because we don't need document events anymore.
+        //
+        if (!fAdvDHCount)
+            fScanner->setDocHandler(0);
+    }
+}
+
+
+void SAXParser::setDTDHandler(DTDHandler* const handler)
+{
+    //
+    //  This gets tricky. We can only set this if its a DTD validator, but it
+    //  might not be. We'll have to think about this one.
+    //
+    //  <TBD>
+}
+
+
+void SAXParser::setErrorHandler(ErrorHandler* const handler)
+{
+    //
+    //  Store the handler. Then either install or deinstall us as the
+    //  error reporter on the scanner and validator.
+    //
+    fErrorHandler = handler;
+    if (fErrorHandler)
+    {
+        fScanner->setErrorReporter(this);
+        fValidator->setErrorReporter(this);
+    }
+     else
+    {
+        fScanner->setErrorReporter(0);
+        fValidator->setErrorReporter(0);
+    }
+}
+
+
+void SAXParser::setEntityResolver(EntityResolver* const resolver)
+{
+    fEntityResolver = resolver;
+    if (fEntityResolver)
+        fScanner->setEntityHandler(this);
+    else
+        fScanner->setEntityHandler(0);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Progressive parse methods
+// ---------------------------------------------------------------------------
+bool SAXParser::parseFirst( const   XMLCh* const    systemId
+                            ,       XMLPScanToken&  toFill
+                            , const bool            reuseValidator)
+{
+    // Call the other version with a URL input source
+    return parseFirst(URLInputSource(systemId), toFill, reuseValidator);
+}
+
+bool SAXParser::parseFirst( const   char* const     systemId
+                            ,       XMLPScanToken&  toFill
+                            , const bool            reuseValidator)
+{
+    // Call the other version with a URL input source
+    return parseFirst(URLInputSource(systemId), toFill, reuseValidator);
+}
+
+bool SAXParser::parseFirst( const   InputSource&    source
+                            ,       XMLPScanToken&  toFill
+                            , const bool            reuseValidator)
+{
+    //
+    //  Avoid multiple entrance. We cannot enter here while a regular parse
+    //  is in progress.
+    //
+    if (fParseInProgress)
+        ThrowXML(IOException, XML4CExcepts::Gen_ParseInProgress);
+
+    return fScanner->scanFirst(source, toFill, reuseValidator);
+}
+
+bool SAXParser::parseNext(XMLPScanToken& token)
+{
+    return fScanner->scanNext(token);
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Overrides of the XMLDocumentHandler interface
+// ---------------------------------------------------------------------------
+void SAXParser::docCharacters(  const   XMLCh* const    chars
+                                , const unsigned int    length
+                                , const bool            cdataSection)
+{
+    // SAX don't want to know about chars before content
+    if (!fElemDepth)
+        return;
+
+    // Just map to the SAX document handler
+    if (fDocHandler)
+        fDocHandler->characters(chars, length);
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->docCharacters(chars, length, cdataSection);
+}
+
+
+void SAXParser::docComment(const XMLCh* const commentText)
+{
+    // SAX don't want to know about comments before content
+    if (!fElemDepth)
+        return;
+
+    //
+    //  SAX has no way to report this. But, if there are any installed
+    //  advanced handlers, then lets call them with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->docComment(commentText);
+}
+
+
+void SAXParser::XMLDecl(const   XMLCh* const
+                        , const XMLCh* const
+                        , const XMLCh* const
+                        , const XMLCh* const)
+{
+    // SAX has no way to report this event
+}
+
+
+void SAXParser::docPI(  const   XMLCh* const    target
+                        , const XMLCh* const    data)
+{
+    // SAX don't want to know about PIs before content
+    if (!fElemDepth)
+        return;
+
+    // Just map to the SAX document handler
+    if (fDocHandler)
+        fDocHandler->processingInstruction(target, data);
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->docPI(target, data);
+}
+
+
+void SAXParser::endDocument()
+{
+    if (fDocHandler)
+        fDocHandler->endDocument();
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->endDocument();
+}
+
+
+void SAXParser::endElement( const   XMLElementDecl& elemDecl
+                            , const unsigned int    uriId
+                            , const bool            isRoot)
+{
+    // Just map to the SAX document handler
+    if (fDocHandler)
+        fDocHandler->endElement(elemDecl.getFullName());
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->endElement(elemDecl, uriId, isRoot);
+
+    //
+    //  Dump the element depth down again. Don't let it underflow in case
+    //  of malformed XML.
+    //
+    if (fElemDepth)
+        fElemDepth--;
+}
+
+
+void SAXParser::endEntityReference(const XMLEntityDecl& entityDecl)
+{
+    //
+    //  SAX has no way to report this event. But, if there are any installed
+    //  advanced handlers, then lets call them with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->endEntityReference(entityDecl);
+}
+
+
+void SAXParser::ignorableWhitespace(const   XMLCh* const    chars
+                                    , const unsigned int    length
+                                    , const bool            cdataSection)
+{
+    // SAX don't want to know about space before content
+    if (!fElemDepth)
+        return;
+
+    // Just map to the SAX document handler
+    if (fDocHandler)
+        fDocHandler->ignorableWhitespace(chars, length);
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->ignorableWhitespace(chars, length, cdataSection);
+}
+
+
+void SAXParser::resetDocument()
+{
+    // Just map to the SAX document handler
+    if (fDocHandler)
+        fDocHandler->resetDocument();
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->resetDocument();
+
+    // Make sure our element depth flag gets set back to zero
+    fElemDepth = 0;
+}
+
+
+void SAXParser::startDocument()
+{
+    // Just map to the SAX document handler
+    if (fDocHandler)
+        fDocHandler->startDocument();
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->startDocument();
+}
+
+
+void SAXParser::
+startElement(   const   XMLElementDecl&         elemDecl
+                , const unsigned int            elemURLId
+                , const XMLCh* const            elemPrefix
+                , const RefVectorOf<XMLAttr>&   attrList
+                , const unsigned int            attrCount
+                , const bool                    isEmpty
+                , const bool                    isRoot)
+{
+    // Bump the element depth counter if not empty
+    if (!isEmpty)
+        fElemDepth++;
+
+    if (fDocHandler)
+    {
+        fAttrList.setVector(&attrList, attrCount);
+        fDocHandler->startElement(elemDecl.getFullName(), fAttrList);
+
+        // If its empty, send the end tag event now
+        if (isEmpty)
+            fDocHandler->endElement(elemDecl.getFullName());
+    }
+
+    //
+    //  If there are any installed advanced handlers, then lets call them
+    //  with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+    {
+        fAdvDHList[index]->startElement
+        (
+            elemDecl
+            , elemURLId
+            , elemPrefix
+            , attrList
+            , attrCount
+            , isEmpty
+            , isRoot
+        );
+    }
+}
+
+
+void SAXParser::startEntityReference(const XMLEntityDecl& entityDecl)
+{
+    //
+    //  SAX has no way to report this. But, If there are any installed
+    //  advanced handlers, then lets call them with this info.
+    //
+    for (unsigned int index = 0; index < fAdvDHCount; index++)
+        fAdvDHList[index]->startEntityReference(entityDecl);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Overrides of the DocTypeHandler interface
+// ---------------------------------------------------------------------------
+void SAXParser::attDef( const   DTDElementDecl& elemDecl
+                        , const DTDAttDef&      attDef
+                        , const bool            ignoring)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::doctypeComment(const XMLCh* const)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::doctypeDecl(const   DTDElementDecl& elemDecl
+                            , const XMLCh* const    publicId
+                            , const XMLCh* const    systemId
+                            , const bool            hasIntSubset)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::doctypePI(  const   XMLCh* const
+                            , const XMLCh* const)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::doctypeWhitespace(  const   XMLCh* const    chars
+                                    , const unsigned int    length)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::elementDecl(const DTDElementDecl&, const bool)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::endAttList(const DTDElementDecl&)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::endIntSubset()
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::endExtSubset()
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::entityDecl( const   DTDEntityDecl&  entityDecl
+                            , const bool            isPEDecl
+                            , const bool            isIgnored)
+{
+    //
+    //  If we have a DTD handler, and this entity is not ignored, and
+    //  its an unparsed entity, then send this one.
+    //
+    if (fDTDHandler && !isIgnored)
+    {
+        if (entityDecl.isUnparsed())
+        {
+            fDTDHandler->unparsedEntityDecl
+            (
+                entityDecl.getName()
+                , entityDecl.getPublicId()
+                , entityDecl.getSystemId()
+                , entityDecl.getNotationName()
+            );
+        }
+    }
+}
+
+
+void SAXParser::resetDocType()
+{
+    // Just map to the DTD handler
+    if (fDTDHandler)
+        fDTDHandler->resetDocType();
+}
+
+
+void SAXParser::notationDecl(   const   XMLNotationDecl&    notDecl
+                                , const bool                isIgnored)
+{
+    if (fDTDHandler && !isIgnored)
+    {
+        fDTDHandler->notationDecl
+        (
+            notDecl.getName()
+            , notDecl.getPublicId()
+            , notDecl.getSystemId()
+        );
+    }
+}
+
+
+void SAXParser::startAttList(const DTDElementDecl&)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::startIntSubset()
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::startExtSubset()
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+void SAXParser::TextDecl(   const  XMLCh* const
+                            , const XMLCh* const)
+{
+    // Unused by SAX DTDHandler interface at this time
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Overrides of the XMLErrorReporter interface
+// ---------------------------------------------------------------------------
+void SAXParser::resetErrors()
+{
+}
+
+
+void SAXParser::error(  const   unsigned int                code
+                        , const XMLCh* const                msgDomain
+                        , const XMLErrorReporter::ErrTypes  errType
+                        , const XMLCh* const                errorText
+                        , const XMLCh* const                systemId
+                        , const XMLCh* const                publicId
+                        , const unsigned int                lineNum
+                        , const unsigned int                colNum)
+{
+    SAXParseException toThrow = SAXParseException
+    (
+        errorText
+        , publicId
+        , systemId
+        , lineNum
+        , colNum
+    );
+
+    if (!fErrorHandler)
+    {
+        if (errType == XMLErrorReporter::ErrType_Fatal)
+            throw toThrow;
+        else
+            return;
+    }
+
+    if (errType == XMLErrorReporter::ErrType_Warning)
+        fErrorHandler->warning(toThrow);
+    else if (errType == XMLErrorReporter::ErrType_Fatal)
+        fErrorHandler->fatalError(toThrow);
+    else
+        fErrorHandler->error(toThrow);
+}
+
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Handlers for the XMLEntityHandler interface
+// ---------------------------------------------------------------------------
+void SAXParser::endInputSource(const InputSource&)
+{
+}
+
+const bool SAXParser::expandSystemId(const XMLCh* const, XMLBuffer&)
+{
+    return false;
+}
+
+
+void SAXParser::resetEntities()
+{
+    // Nothing to do for this one
+}
+
+
+InputSource*
+SAXParser::resolveEntity(   const   XMLCh* const    publicId
+                            , const XMLCh* const    systemId)
+{
+    // Just map to the SAX entity resolver handler
+    if (fEntityResolver)
+        return fEntityResolver->resolveEntity(publicId, systemId);
+    return 0;
+}
+
+
+void SAXParser::startInputSource(const InputSource&)
+{
+    // Nothing to do for this one
+}
diff --git a/src/parsers/SAXParser.hpp b/src/parsers/SAXParser.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e5f02070c9cbdefa2abee5db2f5ce6a03671a21a
--- /dev/null
+++ b/src/parsers/SAXParser.hpp
@@ -0,0 +1,480 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:51  twl
+ * Initial revision
+ *
+ * Revision 1.6  1999/11/08 20:44:54  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#if !defined(SAXPARSER_HPP)
+#define SAXPARSER_HPP
+
+#include <sax/Parser.hpp>
+#include <internal/VecAttrListImpl.hpp>
+#include <framework/XMLDocumentHandler.hpp>
+#include <framework/XMLElementDecl.hpp>
+#include <framework/XMLEntityHandler.hpp>
+#include <framework/XMLErrorReporter.hpp>
+#include <validators/DTD/DocTypeHandler.hpp>
+
+class DocumentHandler;
+class EntityResolver;
+class XMLPScanToken;
+class XMLScanner;
+class XMLValidator;
+
+
+/**
+ * <p>This is the Simple API for XML (SAX) 1.0 driver for IBM XML4C. It
+ *  implements the SAX interface and allows the client program to install
+ *  SAX handlers for event callback. This class implements the internal
+ *  event interfaces, whose event callbacks it maps to SAX event callbacks.</p>
+ *
+ *  This class can be validating or non-validating, by setting a member
+ *  flag.
+ */
+class PARSERS_EXPORT SAXParser :
+
+    public Parser
+    , public XMLDocumentHandler
+    , public XMLErrorReporter
+    , public XMLEntityHandler
+    , public DocTypeHandler
+{
+public :
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    SAXParser(XMLValidator* const valToAdopt = 0);
+    ~SAXParser();
+
+
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    DocumentHandler* getDocumentHandler();
+    const DocumentHandler* getDocumentHandler() const;
+    EntityResolver* getEntityResolver();
+    const EntityResolver* getEntityResolver() const;
+    ErrorHandler* getErrorHandler();
+    const ErrorHandler* getErrorHandler() const;
+    const XMLScanner& getScanner() const;
+    const XMLValidator& getValidator() const;
+    bool getDoNamespaces() const;
+
+
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    void setDoNamespaces(const bool newState);
+    void setDoValidation(const bool newState);
+    void setExitOnFirstFatalError(const bool newState);
+
+
+    // -----------------------------------------------------------------------
+    //  Advanced document handler list maintenance methods
+    // -----------------------------------------------------------------------
+    void installAdvDocHandler(XMLDocumentHandler* const toInstall);
+    bool removeAdvDocHandler(XMLDocumentHandler* const toRemove);
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the SAXParser interface
+    // -----------------------------------------------------------------------
+    virtual void parse(const InputSource& source, const bool reuseValidator = false);
+    virtual void parse(const XMLCh* const systemId, const bool reuseValidator = false);
+    virtual void parse(const char* const systemId, const bool reuseValidator = false);
+    virtual void setDocumentHandler(DocumentHandler* const handler);
+    virtual void setDTDHandler(DTDHandler* const handler);
+    virtual void setErrorHandler(ErrorHandler* const handler);
+    virtual void setEntityResolver(EntityResolver* const resolver);
+
+
+    // -----------------------------------------------------------------------
+    //  Progressive scan methods
+    // -----------------------------------------------------------------------
+    bool parseFirst
+    (
+        const   XMLCh* const    systemId
+        ,       XMLPScanToken&  toFill
+        , const bool            reuseValidator = false
+    );
+    bool parseFirst
+    (
+        const   char* const     systemId
+        ,       XMLPScanToken&  toFill
+        , const bool            reuseValidator = false
+    );
+    bool parseFirst
+    (
+        const   InputSource&    source
+        ,       XMLPScanToken&  toFill
+        , const bool            reuseValidator = false
+    );
+    bool parseNext(XMLPScanToken& token);
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the DocTypeHandler
+    // -----------------------------------------------------------------------
+    virtual void attDef
+    (
+        const   DTDElementDecl& elemDecl
+        , const DTDAttDef&      attDef
+        , const bool            ignoring
+    );
+
+    virtual void doctypeComment
+    (
+        const   XMLCh* const    comment
+    );
+
+    virtual void doctypeDecl
+    (
+        const   DTDElementDecl& elemDecl
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+        , const bool            hasIntSubset
+    );
+
+    virtual void doctypePI
+    (
+        const   XMLCh* const    target
+        , const XMLCh* const    data
+    );
+
+    virtual void doctypeWhitespace
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+    );
+
+    virtual void elementDecl
+    (
+        const   DTDElementDecl& decl
+        , const bool            isIgnored
+    );
+
+    virtual void endAttList
+    (
+        const   DTDElementDecl& elemDecl
+    );
+
+    virtual void endIntSubset();
+
+    virtual void endExtSubset();
+
+    virtual void entityDecl
+    (
+        const   DTDEntityDecl&  entityDecl
+        , const bool            isPEDecl
+        , const bool            isIgnored
+    );
+
+    virtual void resetDocType();
+
+    virtual void notationDecl
+    (
+        const   XMLNotationDecl&    notDecl
+        , const bool                isIgnored
+    );
+
+    virtual void startAttList
+    (
+        const   DTDElementDecl& elemDecl
+    );
+
+    virtual void startIntSubset();
+
+    virtual void startExtSubset();
+
+    virtual void TextDecl
+    (
+        const   XMLCh* const    versionStr
+        , const XMLCh* const    encodingStr
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the XMLDocumentHandler interface
+    // -----------------------------------------------------------------------
+    virtual void docCharacters
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+        , const bool            cdataSection
+    );
+
+    virtual void docComment
+    (
+        const   XMLCh* const    comment
+    );
+
+    virtual void docPI
+    (
+        const   XMLCh* const    target
+        , const XMLCh* const    data
+    );
+
+    virtual void endDocument();
+
+    virtual void endElement
+    (
+        const   XMLElementDecl& elemDecl
+        , const unsigned int    urlId
+        , const bool            isRoot
+    );
+
+    virtual void endEntityReference
+    (
+        const   XMLEntityDecl&  entDecl
+    );
+
+    virtual void ignorableWhitespace
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+        , const bool            cdataSection
+    );
+
+    virtual void resetDocument();
+
+    virtual void startDocument();
+
+    virtual void startElement
+    (
+        const   XMLElementDecl&         elemDecl
+        , const unsigned int            urlId
+        , const XMLCh* const            elemPrefix
+        , const RefVectorOf<XMLAttr>&   attrList
+        , const unsigned int            attrCount
+        , const bool                    isEmpty
+        , const bool                    isRoot
+    );
+
+    virtual void startEntityReference
+    (
+        const   XMLEntityDecl&  entDecl
+    );
+
+    virtual void XMLDecl
+    (
+        const   XMLCh* const    versionStr
+        , const XMLCh* const    encodingStr
+        , const XMLCh* const    standaloneStr
+        , const XMLCh* const    actualEncodingStr
+    );
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the XMLErrorReporter interface
+    // -----------------------------------------------------------------------
+    virtual void error
+    (
+        const   unsigned int                errCode
+        , const XMLCh* const                msgDomain
+        , const XMLErrorReporter::ErrTypes  errType
+        , const XMLCh* const                errorText
+        , const XMLCh* const                systemId
+        , const XMLCh* const                publicId
+        , const unsigned int                lineNum
+        , const unsigned int                colNum
+    );
+
+    virtual void resetErrors();
+
+
+    // -----------------------------------------------------------------------
+    //  Implementation of the XMLEntityHandler interface
+    // -----------------------------------------------------------------------
+    virtual void endInputSource(const InputSource& inputSource);
+
+    virtual const bool expandSystemId
+    (
+        const   XMLCh* const    systemId
+        ,       XMLBuffer&      toFill
+    );
+
+    virtual void resetEntities();
+
+    virtual InputSource* resolveEntity
+    (
+        const   XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    );
+
+    virtual void startInputSource(const InputSource& inputSource);
+
+
+private :
+    // -----------------------------------------------------------------------
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    SAXParser(const SAXParser&);
+    void operator=(const SAXParser&);
+
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fAttrList
+    //      A temporary implementation of the basic SAX attribute list
+    //      interface. We use this one over and over on each startElement
+    //      event to allow SAX-like access to the element attributes.
+    //
+    //  fDocHandler
+    //      The installed SAX doc handler, if any. Null if none.
+    //
+    //  fDTDHandler
+    //      The installed SAX DTD handler, if any. Null if none.
+    //
+    //  fElemDepth
+    //      This is used to track the element nesting depth, so that we can
+    //      know when we are inside content. This is so we can ignore char
+    //      data outside of content.
+    //
+    //  fEntityResolver
+    //      The installed SAX entity handler, if any. Null if none.
+    //
+    //  fErrorHandler
+    //      The installed SAX error handler, if any. Null if none.
+    //
+    //  fAdvDHCount
+    //  fAdvDHList
+    //  fAdvDHListSize
+    //      This is an array of pointers to XMLDocumentHandlers, which is
+    //      how we see installed advanced document handlers. There will
+    //      usually not be very many at all, so a simple array is used
+    //      instead of a collection, for performance. It will grow if needed,
+    //      but that is unlikely.
+    //
+    //      The count is how many handlers are currently installed. The size
+    //      is how big the array itself is (for expansion purposes.) When
+    //      count == size, is time to expand.
+    //
+    //  fParseInProgress
+    //      This flag is set once a parse starts. It is used to prevent
+    //      multiple entrance or reentrance of the parser.
+    //
+    //  fScanner
+    //      The scanner being used by this parser. It is created internally
+    //      during construction.
+    //
+    //  fValidator
+    //      The validator that is installed. If none is provided, we will
+    //      create and install a DTD validator. We install this on the
+    //      scanner we create, which it will use to do validation. We set
+    //      ourself on it as the error reporter for validity errors.
+    // -----------------------------------------------------------------------
+    VecAttrListImpl         fAttrList;
+    DocumentHandler*        fDocHandler;
+    DTDHandler*             fDTDHandler;
+    unsigned int            fElemDepth;
+    EntityResolver*         fEntityResolver;
+    ErrorHandler*           fErrorHandler;
+    unsigned int            fAdvDHCount;
+    XMLDocumentHandler**    fAdvDHList;
+    unsigned int            fAdvDHListSize;
+    bool                    fParseInProgress;
+    XMLScanner*             fScanner;
+    XMLValidator*           fValidator;
+};
+
+
+// ---------------------------------------------------------------------------
+//  SAXParser: Getter methods
+// ---------------------------------------------------------------------------
+inline DocumentHandler* SAXParser::getDocumentHandler()
+{
+    return fDocHandler;
+}
+
+inline const DocumentHandler* SAXParser::getDocumentHandler() const
+{
+    return fDocHandler;
+}
+
+inline EntityResolver* SAXParser::getEntityResolver()
+{
+    return fEntityResolver;
+}
+
+inline const EntityResolver* SAXParser::getEntityResolver() const
+{
+    return fEntityResolver;
+}
+
+inline ErrorHandler* SAXParser::getErrorHandler()
+{
+    return fErrorHandler;
+}
+
+inline const ErrorHandler* SAXParser::getErrorHandler() const
+{
+    return fErrorHandler;
+}
+
+inline const XMLScanner& SAXParser::getScanner() const
+{
+    return *fScanner;
+}
+
+#endif
diff --git a/src/sax/AttributeList.hpp b/src/sax/AttributeList.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..bf7bf76d4aa17857e1a56be5d15cd59c81b0fd6c
--- /dev/null
+++ b/src/sax/AttributeList.hpp
@@ -0,0 +1,257 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:43  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:54  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef ATTRIBUTELIST_HPP
+#define ATTRIBUTELIST_HPP
+
+#include <util/XML4CDefs.hpp>
+
+/**
+  * Interface for an element's attribute specifications.
+  *
+  * The SAX parser implements this interface and passes an instance
+  * to the SAX application as the second argument of each startElement
+  * event.
+  *
+  * The instance provided will return valid results only during the
+  * scope of the startElement invocation (to save it for future
+  * use, the application must make a copy: the AttributeListImpl
+  * helper class provides a convenient constructor for doing so).
+  *
+  * An AttributeList includes only attributes that have been
+  * specified or defaulted: #IMPLIED attributes will not be included.
+  *
+  * There are two ways for the SAX application to obtain information
+  * from the AttributeList.  First, it can iterate through the entire
+  * list:
+  *
+  * <pre>
+  * public void startElement (String name, AttributeList atts) {
+  *   for (int i = 0; i < atts.getLength(); i++) {
+  *     String name = atts.getName(i);
+  *     String type = atts.getType(i);
+  *     String value = atts.getValue(i);
+  *     [...]
+  *   }
+  * }
+  * </pre>
+  *
+  * (Note that the result of getLength() will be zero if there
+  * are no attributes.)
+  *
+  * As an alternative, the application can request the value or
+  * type of specific attributes:
+  *
+  * <pre>
+  * public void startElement (String name, AttributeList atts) {
+  *   String identifier = atts.getValue("id");
+  *   String label = atts.getValue("label");
+  *   [...]
+  * }
+  * </pre>
+  *
+  * The AttributeListImpl helper class provides a convenience 
+  * implementation for use by parser or application writers.
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:43  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:44:54  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see DocumentHandler#startElement 
+  * @see AttributeListImpl#AttributeListImpl
+  */
+
+class SAX_EXPORT AttributeList
+{
+public:
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    /** @name Constructors and Destructor */
+    //@{
+    /** Default constructor */
+    AttributeList()
+    {
+    }
+
+    /** Destructor */
+    virtual ~AttributeList()
+    {
+    }
+    //@}
+
+    /** @name The virtual attribute list interface */
+    //@{
+  /**
+    * Return the number of attributes in this list.
+    *
+    * The SAX parser may provide attributes in any
+    * arbitrary order, regardless of the order in which they were
+    * declared or specified.  The number of attributes may be
+    * zero.
+    *
+    * @return The number of attributes in the list.  
+    */
+    virtual unsigned int getLength() const = 0;
+  /**
+    * Return the name of an attribute in this list (by position).
+    *
+    * The names must be unique: the SAX parser shall not include the
+    * same attribute twice.  Attributes without values (those declared
+    * #IMPLIED without a value specified in the start tag) will be
+    * omitted from the list.
+    *
+    * If the attribute name has a namespace prefix, the prefix
+    * will still be attached.
+    *
+    * @param index The index of the attribute in the list (starting at 0).
+    * @return The name of the indexed attribute, or null
+    *         if the index is out of range.
+    * @see #getLength 
+    */
+    virtual const XMLCh* getName(const unsigned int index) const = 0;
+  /**
+    * Return the type of an attribute in the list (by position).
+    *
+    * The attribute type is one of the strings "CDATA", "ID",
+    * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
+    * or "NOTATION" (always in upper case).
+    *
+    * If the parser has not read a declaration for the attribute,
+    * or if the parser does not report attribute types, then it must
+    * return the value "CDATA" as stated in the XML 1.0 Recommentation
+    * (clause 3.3.3, "Attribute-Value Normalization").
+    *
+    * For an enumerated attribute that is not a notation, the
+    * parser will report the type as "NMTOKEN".
+    *
+    * @param index The index of the attribute in the list (starting at 0).
+    * @return The attribute type as a string, or
+    *         null if the index is out of range.
+    * @see #getLength 
+    * @see #getType(String)
+    */
+    virtual const XMLCh* getType(const unsigned int index) const = 0;
+  /**
+    * Return the value of an attribute in the list (by position).
+    *
+    * If the attribute value is a list of tokens (IDREFS,
+    * ENTITIES, or NMTOKENS), the tokens will be concatenated
+    * into a single string separated by whitespace.
+    *
+    * @param index The index of the attribute in the list (starting at 0).
+    * @return The attribute value as a string, or
+    *         null if the index is out of range.
+    * @see #getLength
+    * @see #getValue(String)
+    */
+    virtual const XMLCh* getValue(const unsigned int index) const = 0;
+  /**
+    * Return the type of an attribute in the list (by name).
+    *
+    * The return value is the same as the return value for
+    * getType(int).
+    *
+    * If the attribute name has a namespace prefix in the document,
+    * the application must include the prefix here.
+    *
+    * @param name The name of the attribute.
+    * @return The attribute type as a string, or null if no
+    *         such attribute exists.
+    * @see #getType(int)
+    */
+    virtual const XMLCh* getType(const XMLCh* const name) const = 0;
+  /**
+    * Return the value of an attribute in the list (by name).
+    *
+    * The return value is the same as the return value for
+    * getValue(int).
+    *
+    * If the attribute name has a namespace prefix in the document,
+    * the application must include the prefix here.
+    *
+    * @param name The name of the attribute in the list.
+    * @return The attribute value as a string, or null if
+    *         no such attribute exists.
+    * @see #getValue(int)
+    */
+    virtual const XMLCh* getValue(const XMLCh* const name) const = 0;
+    //@}
+
+private :
+    /** @name Constructors and operators */
+    //@{
+    /** Copy constructor */
+    AttributeList(const AttributeList&);
+    /** Assignment operator */
+    void operator=(const AttributeList&);
+    //@}
+};
+
+#endif
diff --git a/src/sax/DTDHandler.hpp b/src/sax/DTDHandler.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..706d98ea0d5d6444c1a45bb8c2cb03d3f4a877e3
--- /dev/null
+++ b/src/sax/DTDHandler.hpp
@@ -0,0 +1,199 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:44  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:54  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef DTDHANDLER_HPP
+#define DTDHANDLER_HPP
+
+/**
+  * Receive notification of basic DTD-related events.
+  *
+  * <p>If a SAX application needs information about notations and
+  * unparsed entities, then the application implements this 
+  * interface and registers an instance with the SAX parser using 
+  * the parser's setDTDHandler method.  The parser uses the 
+  * instance to report notation and unparsed entity declarations to 
+  * the application.</p>
+  *
+  * <p>The SAX parser may report these events in any order, regardless
+  * of the order in which the notations and unparsed entities were
+  * declared; however, all DTD events must be reported after the
+  * document handler's startDocument event, and before the first
+  * startElement event.</p>
+  *
+  * <p>It is up to the application to store the information for 
+  * future use (perhaps in a hash table or object tree).
+  * If the application encounters attributes of type "NOTATION",
+  * "ENTITY", or "ENTITIES", it can use the information that it
+  * obtained through this interface to find the entity and/or
+  * notation corresponding with the attribute value.</p>
+  *
+  * <p>The HandlerBase class provides a default implementation
+  * of this interface, which simply ignores the events.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:44  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:44:54  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see Parser#setDTDHandler
+  * @see HandlerBase#HandlerBase
+  */
+
+class SAX_EXPORT DTDHandler
+{
+public:
+    /** @name Constructors and Destructor */
+    //@{
+    /** Default Constructor */
+    DTDHandler()
+    {
+    }
+    
+    /** Destructor */
+    virtual ~DTDHandler()
+    {
+    }
+
+    //@}
+
+    /** @name The DTD handler interface */
+    //@{
+  /**
+    * Receive notification of a notation declaration event.
+    *
+    * <p>It is up to the application to record the notation for later
+    * reference, if necessary.</p>
+    *
+    * <p>If a system identifier is present, and it is a URL, the SAX
+    * parser must resolve it fully before passing it to the
+    * application.</p>
+    *
+    * @param name The notation name.
+    * @param publicId The notation's public identifier, or null if
+    *        none was given.
+    * @param systemId The notation's system identifier, or null if
+    *        none was given.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see #unparsedEntityDecl
+    * @see AttributeList#AttributeList
+    */
+	virtual void notationDecl
+    (
+        const   XMLCh* const    name
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    ) = 0;
+
+  /**
+    * Receive notification of an unparsed entity declaration event.
+    *
+    * <p>Note that the notation name corresponds to a notation
+    * reported by the notationDecl() event.  It is up to the
+    * application to record the entity for later reference, if
+    * necessary.</p>
+    *
+    * <p>If the system identifier is a URL, the parser must resolve it
+    * fully before passing it to the application.</p>
+    *
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @param name The unparsed entity's name.
+    * @param publicId The entity's public identifier, or null if none
+    *        was given.
+    * @param systemId The entity's system identifier (it must always
+    *        have one).
+    * @param notation name The name of the associated notation.
+    * @see #notationDecl
+    * @see AttributeList#AttributeList
+    */
+    virtual void unparsedEntityDecl
+    (
+        const   XMLCh* const    name
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+        , const XMLCh* const    notationName
+    ) = 0;
+
+    virtual void resetDocType() = 0;
+
+    //@}
+
+private :
+    /** @name Unimplemented constructors and operators */
+    //@{
+    /** Copy constructor */
+    DTDHandler(const DTDHandler&);
+
+    /** Assignment operator */
+    void operator=(const DTDHandler&);
+    //@}
+};
+
+#endif
diff --git a/src/sax/DocumentHandler.hpp b/src/sax/DocumentHandler.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..a673dd210f3c4e3aeaf02e0bf48139524edb262e
--- /dev/null
+++ b/src/sax/DocumentHandler.hpp
@@ -0,0 +1,325 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:43  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:54  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef DOCUMENTHANDLER_HPP
+#define DOCUMENTHANDLER_HPP
+
+#include <util/XML4CDefs.hpp>
+
+class AttributeList;
+class Locator;
+
+/**
+  * Receive notification of general document events.
+  *
+  * <p>This is the main interface that most SAX applications
+  * implement: if the application needs to be informed of basic parsing 
+  * events, it implements this interface and registers an instance with 
+  * the SAX parser using the setDocumentHandler method.  The parser 
+  * uses the instance to report basic document-related events like
+  * the start and end of elements and character data.</p>
+  *
+  * <p>The order of events in this interface is very important, and
+  * mirrors the order of information in the document itself.  For
+  * example, all of an element's content (character data, processing
+  * instructions, and/or subelements) will appear, in order, between
+  * the startElement event and the corresponding endElement event.</p>
+  *
+  * <p>Application writers who do not want to implement the entire
+  * interface while can derive a class from HandlerBase, which implements
+  * the default functionality; parser writers can instantiate
+  * HandlerBase to obtain a default handler.  The application can find
+  * the location of any document event using the Locator interface
+  * supplied by the Parser through the setDocumentLocator method.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:43  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:44:54  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see Parser#setDocumentHandler
+  * @see Locator#Locator
+  * @see HandlerBase#HandlerBase
+  */
+
+class SAX_EXPORT DocumentHandler
+{
+public:
+    /** @name Constructors and Destructor */
+    //@{
+    /** Default constructor */
+    DocumentHandler()
+    {
+    }
+
+    /** Destructor */
+    virtual ~DocumentHandler()
+    {
+    }
+    //@}
+
+    /** @name The virtual document handler interface */
+    
+    //@{
+   /**
+    * Receive notification of character data.
+    *
+    * <p>The Parser will call this method to report each chunk of
+    * character data.  SAX parsers may return all contiguous character
+    * data in a single chunk, or they may split it into several
+    * chunks; however, all of the characters in any single event
+    * must come from the same external entity, so that the Locator
+    * provides useful information.</p>
+    *
+    * <p>The application must not attempt to read from the array
+    * outside of the specified range.</p>
+    *
+    * <p>Note that some parsers will report whitespace using the
+    * ignorableWhitespace() method rather than this one (validating
+    * parsers must do so).</p>
+    *
+    * @param chars The characters from the XML document.
+    * @param length The number of characters to read from the array.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see #ignorableWhitespace 
+    * @see Locator#Locator
+    */
+    virtual void characters
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+    ) = 0;
+
+  /**
+    * Receive notification of the end of a document.
+    *
+    * <p>The SAX parser will invoke this method only once, and it will
+    * be the last method invoked during the parse.  The parser shall
+    * not invoke this method until it has either abandoned parsing
+    * (because of an unrecoverable error) or reached the end of
+    * input.</p>
+    *
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    */
+    virtual void endDocument () = 0;
+
+  /**
+    * Receive notification of the end of an element.
+    *
+    * <p>The SAX parser will invoke this method at the end of every
+    * element in the XML document; there will be a corresponding
+    * startElement() event for every endElement() event (even when the
+    * element is empty).</p>
+    *
+    * <p>If the element name has a namespace prefix, the prefix will
+    * still be attached to the name.</p>
+    *
+    * @param name The element type name
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    */
+    virtual void endElement(const XMLCh* const name) = 0;
+
+  /**
+    * Receive notification of ignorable whitespace in element content.
+    *
+    * <p>Validating Parsers must use this method to report each chunk
+    * of ignorable whitespace (see the W3C XML 1.0 recommendation,
+    * section 2.10): non-validating parsers may also use this method
+    * if they are capable of parsing and using content models.</p>
+    *
+    * <p>SAX parsers may return all contiguous whitespace in a single
+    * chunk, or they may split it into several chunks; however, all of
+    * the characters in any single event must come from the same
+    * external entity, so that the Locator provides useful
+    * information.</p>
+    *
+    * <p>The application must not attempt to read from the array
+    * outside of the specified range.</p>
+    *
+    * @param chars The characters from the XML document.
+    * @param length The number of characters to read from the array.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see #characters
+    */
+    virtual void ignorableWhitespace
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+    ) = 0;
+
+  /**
+    * Receive notification of a processing instruction.
+    *
+    * <p>The Parser will invoke this method once for each processing
+    * instruction found: note that processing instructions may occur
+    * before or after the main document element.</p>
+    *
+    * <p>A SAX parser should never report an XML declaration (XML 1.0,
+    * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
+    * using this method.</p>
+    *
+    * @param target The processing instruction target.
+    * @param data The processing instruction data, or null if
+    *        none was supplied.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    */
+    virtual void processingInstruction
+    (
+        const   XMLCh* const    target
+        , const XMLCh* const    data
+    ) = 0;
+
+    virtual void resetDocument() = 0;
+
+  /**
+    * Receive an object for locating the origin of SAX document events.
+    *
+    * <p>SAX parsers are strongly encouraged (though not absolutely
+    * required) to supply a locator: if it does so, it must supply
+    * the locator to the application by invoking this method before
+    * invoking any of the other methods in the DocumentHandler
+    * interface.</p>
+    *
+    * <p>The locator allows the application to determine the end
+    * position of any document-related event, even if the parser is
+    * not reporting an error.  Typically, the application will
+    * use this information for reporting its own errors (such as
+    * character content that does not match an application's
+    * business rules).  The information returned by the locator
+    * is probably not sufficient for use with a search engine.</p>
+    *
+    * <p>Note that the locator will return correct information only
+    * during the invocation of the events in this interface.  The
+    * application should not attempt to use it at any other time.</p>
+    *
+    * @param locator An object that can return the location of
+    *                any SAX document event.
+    * @see Locator#Locator
+    */
+
+    virtual void setDocumentLocator(Locator* const locator) = 0;
+
+  /**
+    * Receive notification of the beginning of a document.
+    *
+    * <p>The SAX parser will invoke this method only once, before any
+    * other methods in this interface or in DTDHandler (except for
+    * setDocumentLocator).</p>
+    *
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    */
+    virtual void startDocument() = 0;
+
+  /**
+    * Receive notification of the beginning of an element.
+    *
+    * <p>The Parser will invoke this method at the beginning of every
+    * element in the XML document; there will be a corresponding
+    * endElement() event for every startElement() event (even when the
+    * element is empty). All of the element's content will be
+    * reported, in order, before the corresponding endElement()
+    * event.</p>
+    *
+    * <p>If the element name has a namespace prefix, the prefix will
+    * still be attached.  Note that the attribute list provided will
+    * contain only attributes with explicit values (specified or
+    * defaulted): #IMPLIED attributes will be omitted.</p>
+    *
+    * @param name The element type name.
+    * @param attrs The attributes attached to the element, if any.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see #endElement
+    * @see AttributeList#AttributeList 
+    */
+    virtual void startElement
+    (
+        const   XMLCh* const    name
+        ,       AttributeList&  attrs
+    ) = 0;
+
+    //@}
+
+private :
+    /** @name Unimplemented Constructors and operators */
+    //@{
+    /** Copy constructor */
+    DocumentHandler(const DocumentHandler&);
+    /** Assignment operator */
+    void operator=(const DocumentHandler&);
+    //@}
+};
+
+#endif
diff --git a/src/sax/Dummy.cpp b/src/sax/Dummy.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5993bd5d5c3bcb06f0ce9b8a2bffb9a1b93187be
--- /dev/null
+++ b/src/sax/Dummy.cpp
@@ -0,0 +1,78 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:44  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:44:55  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#include <sax/AttributeList.hpp>
+#include <sax/DocumentHandler.hpp>
+#include <sax/DTDHandler.hpp>
+#include <sax/EntityResolver.hpp>
+#include <sax/ErrorHandler.hpp>
+#include <sax/HandlerBase.hpp>
+#include <sax/InputSource.hpp>
+#include <sax/Locator.hpp>
+#include <sax/Parser.hpp>
+#include <sax/SAXException.hpp>
+#include <sax/SAXParseException.hpp>
diff --git a/src/sax/EntityResolver.hpp b/src/sax/EntityResolver.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..11ea3cf1985aa7b4301d564ed27ef68f88fcad13
--- /dev/null
+++ b/src/sax/EntityResolver.hpp
@@ -0,0 +1,214 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:44  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:44:56  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef ENTITYRESOLVER_HPP
+#define ENTITYRESOLVER_HPP
+
+#include <util/XML4CDefs.hpp>
+
+class InputSource;
+
+/**
+  * Basic interface for resolving entities.
+  *
+  * <p>If a SAX application needs to implement customized handling
+  * for external entities, it must implement this interface and
+  * register an instance with the SAX parser using the parser's
+  * setEntityResolver method.</p>
+  *
+  * <p>The parser will then allow the application to intercept any
+  * external entities (including the external DTD subset and external
+  * parameter entities, if any) before including them.</p>
+  *
+  * <p>Many SAX applications will not need to implement this interface,
+  * but it will be especially useful for applications that build
+  * XML documents from databases or other specialised input sources,
+  * or for applications that use URI types other than URLs.</p>
+  *
+  * <p>The following resolver would provide the application
+  * with a special character stream for the entity with the system
+  * identifier "http://www.myhost.com/today":</p>
+  *
+  *<pre>
+  *#include <sax/EntityResolver.hpp>
+  *#include <sax/InputSource.hpp>
+  *
+  *class MyResolver : public EntityResolver {
+  *  public:
+  *    InputSource resolveEntity (const XMLCh* const publicId, 
+  *                               const XMLCh* const systemId);
+  *   ...
+  *   };
+  *
+  *  MyResolver::resolveEntity {
+  *    if (XMLString::compareString(systemId, "http://www.myhost.com/today")) {
+  *      MyReader* reader = new MyReader();
+  *      return new InputSource(reader);
+  *    } else {
+  *      return null;
+  *    }
+  *  }
+  *
+  *</pre>
+  *
+  * <p>The application can also use this interface to redirect system
+  * identifiers to local URIs or to look up replacements in a catalog
+  * (possibly by using the public identifier).</p>
+  *
+  * <p>The HandlerBase class implements the default behaviour for
+  * this interface, which is simply always to return null (to request
+  * that the parser use the default system identifier).</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:44  twl
+  * Initial revision
+  *
+  * Revision 1.3  1999/11/08 20:44:56  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see Parser#setEntityResolver
+  * @see InputSource#InputSource
+  * @see HandlerBase#HandlerBase 
+  */
+class SAX_EXPORT EntityResolver
+{
+public:
+    /** @name Constructors and Destructor */
+    //@{
+
+    /** Default Constructor */
+    EntityResolver()
+    {
+    }
+
+    /** Destructor */
+    virtual ~EntityResolver()
+    {
+    }
+
+    //@}
+
+    /** @name The EntityResolver interface */
+    //@{
+
+  /**
+    * Allow the application to resolve external entities.
+    *
+    * <p>The Parser will call this method before opening any external
+    * entity except the top-level document entity (including the
+    * external DTD subset, external entities referenced within the
+    * DTD, and external entities referenced within the document
+    * element): the application may request that the parser resolve
+    * the entity itself, that it use an alternative URI, or that it
+    * use an entirely different input source.</p>
+    *
+    * <p>Application writers can use this method to redirect external
+    * system identifiers to secure and/or local URIs, to look up
+    * public identifiers in a catalogue, or to read an entity from a
+    * database or other input source (including, for example, a dialog
+    * box).</p>
+    *
+    * <p>If the system identifier is a URL, the SAX parser must
+    * resolve it fully before reporting it to the application.</p>
+    *
+    * @param publicId The public identifier of the external entity
+    *        being referenced, or null if none was supplied.
+    * @param systemId The system identifier of the external entity
+    *        being referenced.
+    * @return An InputSource object describing the new input source,
+    *         or null to request that the parser open a regular
+    *         URI connection to the system identifier.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @exception IOException An IO exception,
+    *            possibly the result of creating a new InputStream
+    *            or Reader for the InputSource.
+    * @see InputSource#InputSource
+    */
+    virtual InputSource* resolveEntity
+    (
+        const   XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    ) = 0;
+
+    //@}
+
+private :
+    /** Unimplemented constructors and operators */
+
+    //@{
+
+    /** Copy constructor */
+    EntityResolver(const EntityResolver&);
+
+    /** Assignment operator */
+    void operator=(const EntityResolver&);
+
+    //@}
+};
+
+#endif
diff --git a/src/sax/ErrorHandler.hpp b/src/sax/ErrorHandler.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..a4661e171fe8de2e52edef6f6caa7113f1391209
--- /dev/null
+++ b/src/sax/ErrorHandler.hpp
@@ -0,0 +1,204 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:45  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:45:00  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef ERRORHANDLER_HPP
+#define ERRORHANDLER_HPP
+
+class SAXParseException;
+
+/**
+  * Basic interface for SAX error handlers.
+  *
+  * <p>If a SAX application needs to implement customized error
+  * handling, it must implement this interface and then register an
+  * instance with the SAX parser using the parser's setErrorHandler
+  * method.  The parser will then report all errors and warnings
+  * through this interface.</p>
+  *
+  * <p> The parser shall use this interface instead of throwing an
+  * exception: it is up to the application whether to throw an
+  * exception for different types of errors and warnings.  Note,
+  * however, that there is no requirement that the parser continue to
+  * provide useful information after a call to fatalError (in other
+  * words, a SAX driver class could catch an exception and report a
+  * fatalError).</p>
+  *
+  * <p>The HandlerBase class provides a default implementation of this
+  * interface, ignoring warnings and recoverable errors and throwing a
+  * SAXParseException for fatal errors.  An application may extend
+  * that class rather than implementing the complete interface
+  * itself.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:45  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:45:00  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see Parser#setErrorHandler
+  * @see SAXParseException#SAXParseException 
+  * @see HandlerBase#HandlerBase
+  */
+
+class SAX_EXPORT ErrorHandler
+{
+public:
+    /** @name Constructors and Destructor */
+    //@{
+    /** Default constructor */
+    ErrorHandler()
+    {
+    }
+
+    /** Desctructor */
+    virtual ~ErrorHandler()
+    {
+    }
+    //@}
+
+    /** @name The error handler interface */
+    //@{
+   /**
+    * Receive notification of a warning.
+    *
+    * <p>SAX parsers will use this method to report conditions that
+    * are not errors or fatal errors as defined by the XML 1.0
+    * recommendation.  The default behaviour is to take no action.</p>
+    *
+    * <p>The SAX parser must continue to provide normal parsing events
+    * after invoking this method: it should still be possible for the
+    * application to process the document through to the end.</p>
+    *
+    * @param exception The warning information encapsulated in a
+    *                  SAX parse exception.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see SAXParseException#SAXParseException 
+    */
+    virtual void warning(const SAXParseException& exception) = 0;
+
+  /**
+    * Receive notification of a recoverable error.
+    *
+    * <p>This corresponds to the definition of "error" in section 1.2
+    * of the W3C XML 1.0 Recommendation.  For example, a validating
+    * parser would use this callback to report the violation of a
+    * validity constraint.  The default behaviour is to take no
+    * action.</p>
+    *
+    * <p>The SAX parser must continue to provide normal parsing events
+    * after invoking this method: it should still be possible for the
+    * application to process the document through to the end.  If the
+    * application cannot do so, then the parser should report a fatal
+    * error even if the XML 1.0 recommendation does not require it to
+    * do so.</p>
+    *
+    * @param exception The error information encapsulated in a
+    *                  SAX parse exception.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see SAXParseException#SAXParseException 
+    */
+    virtual void error(const SAXParseException& exception) = 0;
+
+  /**
+    * Receive notification of a non-recoverable error.
+    *
+    * <p>This corresponds to the definition of "fatal error" in
+    * section 1.2 of the W3C XML 1.0 Recommendation.  For example, a
+    * parser would use this callback to report the violation of a
+    * well-formedness constraint.</p>
+    *
+    * <p>The application must assume that the document is unusable
+    * after the parser has invoked this method, and should continue
+    * (if at all) only for the sake of collecting addition error
+    * messages: in fact, SAX parsers are free to stop reporting any
+    * other events once this method has been invoked.</p>
+    *
+    * @param exception The error information encapsulated in a
+    *                  SAX parse exception.  
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see SAXParseException#SAXParseException
+    */
+    virtual void fatalError(const SAXParseException& exception) = 0;
+
+    //@}
+
+private :
+    /** @name Unimplemented constructors and operators */
+    //@{
+    /** Copy constructor */
+    ErrorHandler(const ErrorHandler&);
+
+    /** Assignment operator */
+    void operator=(const ErrorHandler&);
+    //@}
+};
+
+#endif
diff --git a/src/sax/HandlerBase.hpp b/src/sax/HandlerBase.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..fc3aceaf01222ff3247c5b03d702085459a8db1c
--- /dev/null
+++ b/src/sax/HandlerBase.hpp
@@ -0,0 +1,488 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:45  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:45:00  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef HANDLERBASE_HPP
+#define HANDLERBASE_HPP
+
+#include <sax/DocumentHandler.hpp>
+#include <sax/DTDHandler.hpp>
+#include <sax/EntityResolver.hpp>
+#include <sax/ErrorHandler.hpp>
+#include <sax/SAXParseException.hpp>
+
+class Locator;
+class AttributeList;
+
+/**
+  * Default base class for handlers.
+  *
+  * <p>This class implements the default behaviour for four SAX
+  * interfaces: EntityResolver, DTDHandler, DocumentHandler,
+  * and ErrorHandler.</p>
+  *
+  * <p>Application writers can extend this class when they need to
+  * implement only part of an interface; parser writers can
+  * instantiate this class to provide default handlers when the
+  * application has not supplied its own.</p>
+  *
+  * <p>Note that the use of this class is optional.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:45  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:45:00  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see EntityResolver#EntityResolver
+  * @see DTDHandler#DTDHandler
+  * @see DocumentHandler#DocumentHandler
+  * @see ErrorHandler#ErrorHandler
+  */
+
+class SAX_EXPORT HandlerBase :
+
+    public EntityResolver, public DTDHandler, public DocumentHandler
+    , public ErrorHandler
+{
+public:
+    /** @name Default handlers for the DocumentHandler interface */
+    //@{
+  /**
+    * Receive notification of character data inside an element.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method to take specific actions for each chunk of character data
+    * (such as adding the data to a node or buffer, or printing it to
+    * a file).</p>
+    *
+    * @param chars The characters.
+    * @param length The number of characters to use from the
+    *               character array.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see DocumentHandler#characters
+    */
+    virtual void characters
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+    );
+
+  /**
+    * Receive notification of the end of the document.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass to take specific actions at the beginning
+    * of a document (such as finalising a tree or closing an output
+    * file).</p>
+    *
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see DocumentHandler#endDocument
+    */
+    virtual void endDocument();
+
+  /**
+    * Receive notification of the end of an element.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass to take specific actions at the end of
+    * each element (such as finalising a tree node or writing
+    * output to a file).</p>
+    *
+    * @param name The element type name.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see DocumentHandler#endElement
+    */
+    virtual void endElement(const XMLCh* const name);
+
+  /**
+    * Receive notification of ignorable whitespace in element content.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method to take specific actions for each chunk of ignorable
+    * whitespace (such as adding data to a node or buffer, or printing
+    * it to a file).</p>
+    *
+    * @param chars The whitespace characters.
+    * @param length The number of characters to use from the
+    *               character array.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see DocumentHandler#ignorableWhitespace
+    */
+    virtual void ignorableWhitespace
+    (
+        const   XMLCh* const    chars
+        , const unsigned int    length
+    );
+
+  /**
+    * Receive notification of a processing instruction.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass to take specific actions for each
+    * processing instruction, such as setting status variables or
+    * invoking other methods.</p>
+    *
+    * @param target The processing instruction target.
+    * @param data The processing instruction data, or null if
+    *             none is supplied.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see DocumentHandler#processingInstruction
+    */
+    virtual void processingInstruction
+    (
+        const   XMLCh* const    target
+        , const XMLCh* const    data
+    );
+
+    virtual void resetDocument();
+    //@}
+
+    /** @name Default implementation of DocumentHandler interface */
+
+    //@{
+  /**
+    * Receive a Locator object for document events.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass if they wish to store the locator for use
+    * with other document events.</p>
+    *
+    * @param locator A locator for all SAX document events.
+    * @see DocumentHandler#setDocumentLocator
+    * @see Locator
+    */
+    virtual void setDocumentLocator(Locator* const locator);
+
+  /**
+    * Receive notification of the beginning of the document.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass to take specific actions at the beginning
+    * of a document (such as allocating the root node of a tree or
+    * creating an output file).</p>
+    *
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see DocumentHandler#startDocument
+    */
+    virtual void startDocument();
+
+  /**
+    * Receive notification of the start of an element.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass to take specific actions at the start of
+    * each element (such as allocating a new tree node or writing
+    * output to a file).</p>
+    *
+    * @param name The element type name.
+    * @param attributes The specified or defaulted attributes.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see DocumentHandler#startElement
+    */
+    virtual void startElement
+    (
+        const   XMLCh* const    name
+        ,       AttributeList&  attributes
+    );
+
+    //@}
+
+    /** @name Default implementation of the EntityResolver interface. */
+
+    //@{
+  /**
+    * Resolve an external entity.
+    *
+    * <p>Always return null, so that the parser will use the system
+    * identifier provided in the XML document.  This method implements
+    * the SAX default behaviour: application writers can override it
+    * in a subclass to do special translations such as catalog lookups
+    * or URI redirection.</p>
+    *
+    * @param publicId The public identifer, or null if none is
+    *                 available.
+    * @param systemId The system identifier provided in the XML 
+    *                 document.
+    * @return The new input source, or null to require the
+    *         default behaviour.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see EntityResolver#resolveEntity
+    */
+    virtual InputSource* resolveEntity
+    (
+        const   XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    );
+
+    //@}
+
+    /** @name Default implementation of the ErrorHandler interface */
+    //@{
+   /**
+    * Receive notification of a recoverable parser error.
+    *
+    * <p>The default implementation does nothing.  Application writers
+    * may override this method in a subclass to take specific actions
+    * for each error, such as inserting the message in a log file or
+    * printing it to the console.</p>
+    *
+    * @param exception The warning information encoded as an exception.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see ErrorHandler#warning
+    * @see SAXParseException#SAXParseException
+    */
+    virtual void error(const SAXParseException& exception);
+
+  /**
+    * Report a fatal XML parsing error.
+    *
+    * <p>The default implementation throws a SAXParseException.
+    * Application writers may override this method in a subclass if
+    * they need to take specific actions for each fatal error (such as
+    * collecting all of the errors into a single report): in any case,
+    * the application must stop all regular processing when this
+    * method is invoked, since the document is no longer reliable, and
+    * the parser may no longer report parsing events.</p>
+    *
+    * @param e The error information encoded as an exception.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see ErrorHandler#fatalError
+    * @see SAXParseException#SAXParseException
+    */
+    virtual void fatalError(const SAXParseException& exception);
+
+  /**
+    * Receive notification of a parser warning.
+    *
+    * <p>The default implementation does nothing.  Application writers
+    * may override this method in a subclass to take specific actions
+    * for each warning, such as inserting the message in a log file or
+    * printing it to the console.</p>
+    *
+    * @param e The warning information encoded as an exception.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @see ErrorHandler#warning
+    * @see SAXParseException#SAXParseException
+    */
+    virtual void warning(const SAXParseException& exception);
+
+    virtual void resetErrors();
+
+    //@}
+
+
+    /** @name Default implementation of DTDHandler interface. */
+    //@{
+
+  /**
+    * Receive notification of a notation declaration.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass if they wish to keep track of the notations
+    * declared in a document.</p>
+    *
+    * @param name The notation name.
+    * @param publicId The notation public identifier, or null if not
+    *                 available.
+    * @param systemId The notation system identifier.
+    * @see DTDHandler#notationDecl
+    */
+    virtual void notationDecl
+    (
+        const   XMLCh* const    name
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+    );
+
+    virtual void resetDocType();
+
+  /**
+    * Receive notification of an unparsed entity declaration.
+    *
+    * <p>By default, do nothing.  Application writers may override this
+    * method in a subclass to keep track of the unparsed entities
+    * declared in a document.</p>
+    *
+    * @param name The entity name.
+    * @param publicId The entity public identifier, or null if not
+    *                 available.
+    * @param systemId The entity system identifier.
+    * @param notationName The name of the associated notation.
+    * @see DTDHandler#unparsedEntityDecl
+    */
+    virtual void unparsedEntityDecl
+    (
+        const   XMLCh* const    name
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+        , const XMLCh* const    notationName
+    );
+    //@}
+};
+
+
+// ---------------------------------------------------------------------------
+//  HandlerBase: Inline default implementations
+// ---------------------------------------------------------------------------
+inline void HandlerBase::characters(const   XMLCh* const    chars
+                                    , const unsigned int    length)
+{
+}
+
+inline void HandlerBase::endDocument()
+{
+}
+
+inline void HandlerBase::endElement(const XMLCh* const name)
+{
+}
+
+inline void HandlerBase::error(const SAXParseException& exception)
+{
+}
+
+inline void HandlerBase::fatalError(const SAXParseException& exception)
+{
+    throw exception;
+}
+
+inline void
+HandlerBase::ignorableWhitespace(   const   XMLCh* const chars
+                                    , const unsigned int length)
+{
+}
+
+inline void HandlerBase::notationDecl(  const   XMLCh* const name
+                                        , const XMLCh* const publicId
+                                        , const XMLCh* const systemId)
+{
+}
+
+inline void
+HandlerBase::processingInstruction( const   XMLCh* const target
+                                    , const XMLCh* const data)
+{
+}
+
+inline void HandlerBase::resetErrors()
+{
+}
+
+inline void HandlerBase::resetDocument()
+{
+}
+
+inline void HandlerBase::resetDocType()
+{
+}
+
+inline InputSource*
+HandlerBase::resolveEntity( const   XMLCh* const publicId
+                            , const XMLCh* const systemId)
+{
+    return 0;
+}
+
+inline void
+HandlerBase::unparsedEntityDecl(const   XMLCh* const name
+                                , const XMLCh* const publicId
+                                , const XMLCh* const systemId
+                                , const XMLCh* const notationName)
+{
+}
+
+inline void HandlerBase::setDocumentLocator(Locator* const locator)
+{
+}
+
+inline void HandlerBase::startDocument()
+{
+}
+
+inline void
+HandlerBase::startElement(  const   XMLCh* const    name
+                            ,       AttributeList&  attributes)
+{
+}
+
+inline void HandlerBase::warning(const SAXParseException& exception)
+{
+}
+
+#endif
diff --git a/src/sax/InputSource.cpp b/src/sax/InputSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7821f74fe8b1014d518d5f892d48e7f5896afb02
--- /dev/null
+++ b/src/sax/InputSource.cpp
@@ -0,0 +1,142 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:45  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:45:01  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include    <util/XMLString.hpp>
+#include    <sax/InputSource.hpp>
+
+
+
+// ---------------------------------------------------------------------------
+//  InputSource: Constructors and Destructor
+// ---------------------------------------------------------------------------
+InputSource::InputSource(const XMLCh* const systemId) :
+
+    fEncoding(0)
+    , fPublicId(0)
+    , fSystemId(XMLString::replicate(systemId))
+{
+}
+
+InputSource::InputSource(const  XMLCh* const systemId
+                        , const XMLCh* const publicId) :
+
+    fEncoding(0)
+    , fPublicId(XMLString::replicate(publicId))
+    , fSystemId(XMLString::replicate(systemId))
+{
+}
+
+InputSource::InputSource(const char* const systemId) :
+
+    fEncoding(0)
+    , fPublicId(0)
+    , fSystemId(XMLString::transcode(systemId))
+{
+}
+
+InputSource::InputSource(const  char* const systemId
+                        , const char* const publicId) :
+
+    fEncoding(0)
+    , fPublicId(XMLString::transcode(publicId))
+    , fSystemId(XMLString::transcode(systemId))
+{
+}
+
+InputSource::~InputSource()
+{
+    delete [] fEncoding;
+    delete [] fPublicId;
+    delete [] fSystemId;
+}
+
+
+// ---------------------------------------------------------------------------
+//  InputSource: Setter methods
+// ---------------------------------------------------------------------------
+void InputSource::setEncoding(const XMLCh* const encodingStr)
+{
+    delete [] fEncoding;
+    fEncoding = XMLString::replicate(encodingStr);
+}
+
+
+void InputSource::setPublicId(const XMLCh* const publicId)
+{
+    delete [] fPublicId;
+    fPublicId = XMLString::replicate(publicId);
+}
+
+
+void InputSource::setSystemId(const XMLCh* const systemId)
+{
+    delete [] fSystemId;
+    fSystemId = XMLString::replicate(systemId);
+}
diff --git a/src/sax/InputSource.hpp b/src/sax/InputSource.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..1f504490b0a0d3beb3c4d9e7527fcea2dba0c5a4
--- /dev/null
+++ b/src/sax/InputSource.hpp
@@ -0,0 +1,295 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:46  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:45:01  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef INPUTSOURCE_HPP
+#define INPUTSOURCE_HPP
+
+#include <util/XML4CDefs.hpp>
+
+class BinInputStream;
+
+
+/**
+  * A single input source for an XML entity.
+  *
+  * <p>This class encapsulates information about an input source in a
+  * single object, which may include a public identifier or a system
+  * identifier</p>
+  *
+  * <p>There are two places that the application will deliver this input
+  * source to the parser: as the argument to the Parser::parse method, or as
+  * the return value of the EntityResolver::resolveEntity method.</p>
+  *
+  * <p>InputSource is never used directly, but is the base class for a number
+  * of derived classes for particular types of input sources. Derivatives are
+  * provided (in the internal/ directory) for URL input sources, memory buffer
+  * input sources, and so on.</p>
+  *
+  * <p>When it is time to parse the input described by an input source, it
+  * will be asked to create a binary stream for that source. That stream will
+  * be used to input the data of the source. The derived class provides the
+  * implementation of the makeStream() method, and provides a type of stream
+  * of the correct type for the input source it represents.
+  *
+  * <p>An InputSource object belongs to the application: the parser never
+  * modifies them in any way. They are always passed by const reference so
+  * the parser will make a copy of any input sources that it must keep 
+  * around beyond the call.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:46  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:45:01  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see Parser#parse
+  * @see EntityResolver#resolveEntity
+  */
+class SAX_EXPORT InputSource
+{
+public:
+    // -----------------------------------------------------------------------
+    //  All constructors are hidden, just the destructor is available
+    // -----------------------------------------------------------------------
+    virtual ~InputSource();
+
+
+    // -----------------------------------------------------------------------
+    /** @name Virtual input source interface */
+    //@{
+  /**
+    * Makes the byte stream for this input source.
+    *
+    * <p>The derived class must create and return a binary input stream of an
+    * appropriate type for its kind of data source. The returned stream must
+    * be dynamically allocated and becomes the parser's property.
+    * </p>
+    *
+    * @see BinInputStream
+    */
+    virtual BinInputStream* makeStream() const = 0;
+
+    //@}
+
+
+    // -----------------------------------------------------------------------
+    /** @name Getter methods */
+    //@{
+  /**
+    * An input source can be set to force the parser to assume a particular
+    * encoding for the data that input source reprsents, via the setEncoding()
+    * method. This method returns name of the encoding that is to be forced.
+    * If the encoding has never been forced, it returns a null pointer.
+    *
+    * @return The forced encoding, or null if none was supplied.
+    * @see #setEncoding
+    */
+    const XMLCh* getEncoding() const;
+
+
+  /**
+    * Get the public identifier for this input source.
+    *
+    * @return The public identifier, or null if none was supplied.
+    * @see #setPublicId
+    */
+    const XMLCh* getPublicId() const;
+
+
+  /**
+    * Get the system identifier for this input source.
+    *
+    * <p>If the system ID is a URL, it will be fully resolved.</p>
+    *
+    * @return The system identifier.
+    * @see #setSystemId
+    */
+    const XMLCh* getSystemId() const;
+
+    //@}
+
+
+    // -----------------------------------------------------------------------
+    /** @name Setter methods */
+    //@{
+
+  /**
+    * Set the encoding which will be required for use with the XML text read
+    * via a stream opened by this input source.
+    *
+    * <p>This is usually not set, allowing the encoding to be sensed in the
+    * usual XML way. However, in some cases, the encoding in the file is known
+    * to be incorrect because of intermediate transcoding, for instance
+    * encapsulation within a MIME document.
+    *
+    * @param encodingStr The name of the encoding to force.
+    */
+    void setEncoding(const XMLCh* const encodingStr);
+
+
+  /**
+    * Set the public identifier for this input source.
+    *
+    * <p>The public identifier is always optional: if the application writer
+    * includes one, it will be provided as part of the location information.</p>
+    *
+    * @param publicId The public identifier as a string.
+    * @see Locator#getPublicId
+    * @see SAXParseException#getPublicId
+    * @see #getPublicId
+    */
+    void setPublicId(const XMLCh* const publicId);
+
+  /**
+    * Set the system identifier for this input source.
+    *
+    * <p>Set the system identifier for this input source.
+    *
+    * </p>The system id is always required. The public id may be used to map
+    * to another system id, but the system id must always be present as a fall
+    * back.
+    *
+    * <p>If the system ID is a URL, it must be fully resolved.</p>
+    *
+    * @param systemId The system identifier as a string.
+    * @see #getSystemId
+    * @see Locator#getSystemId
+    * @see SAXParseException#getSystemId
+    */
+    void setSystemId(const XMLCh* const systemId);
+
+    //@}
+
+
+protected :
+    // -----------------------------------------------------------------------
+    //  Hidden constructors
+    // -----------------------------------------------------------------------
+    InputSource(const XMLCh* const systemId);
+    InputSource
+    (
+        const   XMLCh* const    systemId
+        , const XMLCh* const    publicId
+    );
+    InputSource(const char* const systemId);
+    InputSource
+    (
+        const   char* const systemId
+        , const char* const publicId
+    );
+
+
+private:
+    // -----------------------------------------------------------------------    
+    //  Unimplemented constructors and operators
+    // -----------------------------------------------------------------------    
+    InputSource(const InputSource&);
+    void operator=(const InputSource&);
+
+
+    // -----------------------------------------------------------------------    
+    //  Private data members
+    //
+    //  fEncoding
+    //      This is the encoding to use. Usually this is null, which means
+    //      to use the information found in the file itself. But, if set,
+    //      this encoding will be used without question.
+    //
+    //  fPublicId
+    //      This is the optional public id for the input source. It can be
+    //      null if none is desired.
+    //
+    //  fSystemId
+    //      This is the system id for the input source. This is what is
+    //      actually used to open the source.
+    // -----------------------------------------------------------------------    
+    XMLCh*  fEncoding;
+    XMLCh*  fPublicId;
+    XMLCh*  fSystemId;
+};
+
+
+// ---------------------------------------------------------------------------
+//  InputSource: Getter methods
+// ---------------------------------------------------------------------------
+inline const XMLCh* InputSource::getEncoding() const 
+{
+    return fEncoding;
+}
+
+inline const XMLCh* InputSource::getPublicId() const 
+{
+    return fPublicId;
+}
+
+inline const XMLCh* InputSource::getSystemId() const 
+{
+    return fSystemId;
+}
+
+#endif
diff --git a/src/sax/Locator.hpp b/src/sax/Locator.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..7841ed7c60a954fe0fe964bc5ca6815ccbaebb8d
--- /dev/null
+++ b/src/sax/Locator.hpp
@@ -0,0 +1,176 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:46  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:45:01  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef LOCATOR_HPP
+#define LOCATOR_HPP
+
+#include <util/XML4CDefs.hpp>
+/**
+  * Interface for associating a SAX event with a document location.
+  *
+  * <p>If a SAX parser provides location information to the SAX
+  * application, it does so by implementing this interface and then
+  * passing an instance to the application using the document
+  * handler's setDocumentLocator method.  The application can use the
+  * object to obtain the location of any other document handler event
+  * in the XML source document.</p>
+  *
+  * <p>Note that the results returned by the object will be valid only
+  * during the scope of each document handler method: the application
+  * will receive unpredictable results if it attempts to use the
+  * locator at any other time.</p>
+  *
+  * <p>SAX parsers are not required to supply a locator, but they are
+  * very strong encouraged to do so.  If the parser supplies a
+  * locator, it must do so before reporting any other document events.
+  * If no locator has been set by the time the application receives
+  * the startDocument event, the application should assume that a
+  * locator is not available.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:46  twl
+  * Initial revision
+  *
+  * Revision 1.3  1999/11/08 20:45:01  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see DocumentHandler#setDocumentLocator 
+  */
+
+class SAX_EXPORT Locator
+{
+public:
+
+    /** @name Constructors and Destructor */
+    //@{
+    /** Default constructor */
+    Locator()
+    {
+    }
+
+    /** Destructor */
+    virtual ~Locator()
+    {
+    }
+
+    //@}
+
+    /** @name The locator interface */
+    //@{
+  /**
+    * Return the public identifier for the current document event.
+    * <p>This will be the public identifier
+    * @return A string containing the public identifier, or
+    *         null if none is available.
+    * @see #getSystemId
+    */
+    virtual const XMLCh* getPublicId() const = 0;
+
+  /**
+    * Return the system identifier for the current document event.
+    *
+    * <p>If the system identifier is a URL, the parser must resolve it
+    * fully before passing it to the application.</p>
+    *
+    * @return A string containing the system identifier, or null
+    *         if none is available.
+    * @see #getPublicId
+    */
+    virtual const XMLCh* getSystemId() const = 0;
+
+  /**
+    * Return the line number where the current document event ends.
+    * Note that this is the line position of the first character
+    * after the text associated with the document event.
+    * @return The line number, or -1 if none is available.
+    * @see #getColumnNumber
+    */
+    virtual int getLineNumber() const = 0;
+
+  /**
+    * Return the column number where the current document event ends.
+    * Note that this is the column number of the first
+    * character after the text associated with the document
+    * event.  The first column in a line is position 1.
+    * @return The column number, or -1 if none is available.
+    * @see #getLineNumber
+    */
+    virtual int getColumnNumber() const = 0;
+    //@}
+
+private :
+    /** @name Unimplemented constructors and operators */
+    //@{
+    /** Copy constructor */
+    Locator(const Locator&);
+
+    /** Assignment operator */
+    void operator=(const Locator&);
+    //@}
+};
+
+#endif
diff --git a/src/sax/Makefile.in b/src/sax/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..a1ea3ab0f0b8b729524a7f58b974c010c1e5b48a
--- /dev/null
+++ b/src/sax/Makefile.in
@@ -0,0 +1,140 @@
+#
+# The Apache Software License, Version 1.1
+# 
+# Copyright (c) 1999 The Apache Software Foundation.  All rights 
+# reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer. 
+# 
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 
+# 3. The end-user documentation included with the redistribution,
+#    if any, must include the following acknowledgment:  
+#       "This product includes software developed by the
+#        Apache Software Foundation (http://www.apache.org/)."
+#    Alternately, this acknowledgment may appear in the software itself,
+#    if and wherever such third-party acknowledgments normally appear.
+# 
+# 4. The names "Xerces" and "Apache Software Foundation" must
+#    not be used to endorse or promote products derived from this
+#    software without prior written permission. For written 
+#    permission, please contact apache\@apache.org.
+# 
+# 5. Products derived from this software may not be called "Apache",
+#    nor may "Apache" appear in their name, without prior written
+#    permission of the Apache Software Foundation.
+# 
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+# 
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com .  For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+# 
+#
+# $Log$
+# Revision 1.1  1999/11/09 01:07:46  twl
+# Initial revision
+#
+# Revision 1.3  1999/11/08 20:45:01  rahul
+# Swat for adding in Product name and CVS comment log variable.
+#:
+#
+
+PLATFORM = @platform@
+COMPILER = @compiler@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+LDFLAGS = @ldflags@
+LIBS = @libs@
+OSVER = @osver@
+USELIBWWW = @uselibwww@
+MESSAGELOADER = @messageloader@
+TRANSCODER = @transcoder@
+
+include ../Makefile.incl
+
+MODULE = sax
+
+SAX_CPP_PUBHEADERS = \
+	AttributeList.hpp \
+	DTDHandler.hpp \
+	DocumentHandler.hpp \
+	EntityResolver.hpp \
+	ErrorHandler.hpp \
+	HandlerBase.hpp \
+	InputSource.hpp \
+	Locator.hpp \
+	Parser.hpp \
+	SAXException.hpp \
+	SAXParseException.hpp
+
+SAX_CPP_PRIVHEADERS = 
+
+SAX_C_FILES = 
+
+SAX_CPP_OBJECTS = \
+	Dummy.o \
+	InputSource.o \
+	SAXParseException.o
+
+all:	includes $(SAX_CPP_OBJECTS) publish
+
+includes:	pubheaders $(SAX_C_FILES)
+
+pubheaders:
+	-mkdir -p $(XML_INC_DIR)/$(MODULE)
+	$(CP) $(SAX_CPP_PUBHEADERS) $(SAX_C_FILES) $(XML_INC_DIR)/$(MODULE)
+
+publish:
+	-mkdir -p ${ALL_OBJECTS_DIR}
+	$(CP) $(SAX_CPP_OBJECTS) $(ALL_OBJECTS_DIR)
+
+# this may generate unnecessary dependencies, but it makes life easier
+depend: includes
+	$(MAKE_DEPEND) $(XML_INCL) *.cpp > $(DEPFILE)
+
+clean:
+	@echo "Making clean in $(MODULE) ..."
+	$(RM) $(SAX_CPP_OBJECTS)
+
+distclean:	clean
+	$(RM) Makefile $(DEPFILE)
+	@echo "Removing all $(MODULE) header files ..."
+	@for file in $(SAX_CPP_PUBHEADERS); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@for file in $(SAX_C_FILES); do \
+	rm -f $(XML_INC_DIR)/$(MODULE)/$$file; \
+	done
+	@echo "Removing all $(MODULE) object files ..."
+	@for file in $(SAX_CPP_OBJECTS); do \
+	rm -f $(ALL_OBJECTS_DIR)/$$file; \
+	done
+
+install:
+	-mkdir -p $(PREFIX)/$(MODULE)
+	$(CP) $(SAX_CPP_PUBHEADERS) $(SAX_C_FILES) $(PREFIX)/$(MODULE)
diff --git a/src/sax/Parser.hpp b/src/sax/Parser.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..74bbd1c3c5c5e4c650764d4cd39e2507ef68e69c
--- /dev/null
+++ b/src/sax/Parser.hpp
@@ -0,0 +1,284 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:46  twl
+ * Initial revision
+ *
+ * Revision 1.3  1999/11/08 20:45:02  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+#ifndef PARSER_HPP
+#define PARSER_HPP
+
+class DTDHandler;
+class EntityResolver;
+class DocumentHandler;
+class ErrorHandler;
+class InputSource;
+
+/**
+  * Basic interface for SAX (Simple API for XML) parsers.
+  *
+  * All SAX parsers must implement this basic interface: it allows
+  * applications to register handlers for different types of events
+  * and to initiate a parse from a URI, or a character stream.
+  *
+  * All SAX parsers must also implement a zero-argument constructor
+  * (though other constructors are also allowed).
+  *
+  * SAX parsers are reusable but not re-entrant: the application
+  * may reuse a parser object (possibly with a different input source)
+  * once the first parse has completed successfully, but it may not
+  * invoke the parse() methods recursively within a parse.
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:46  twl
+  * Initial revision
+  *
+  * Revision 1.3  1999/11/08 20:45:02  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see EntityResolver#EntityResolver
+  * @see DTDHandler#DTDHandler
+  * @see DocumentHandler#DocumentHandler
+  * @see ErrorHandler#ErrorHandler
+  * @see HandlerBase#HandlerBase
+  * @see InputSource#InputSource
+  */
+
+#include <util/XML4CDefs.hpp>
+
+class SAX_EXPORT Parser 
+{
+public:
+    /** @name Constructors and Destructor */
+    // -----------------------------------------------------------------------
+    //  Constructors and Destructor
+    // -----------------------------------------------------------------------
+    //@{
+    /** The default constructor */
+    Parser()
+    {
+    }
+    /** The destructor */
+    virtual ~Parser()
+    {
+    }
+    //@}
+
+    //-----------------------------------------------------------------------
+    // The parser interface
+    //-----------------------------------------------------------------------
+    /** @name The parser interfaces */
+    //@{
+  /**
+    * Allow an application to register a custom entity resolver.
+    *
+    * If the application does not register an entity resolver, the
+    * SAX parser will resolve system identifiers and open connections
+    * to entities itself (this is the default behaviour implemented in
+    * HandlerBase).
+    *
+    * Applications may register a new or different entity resolver
+    * in the middle of a parse, and the SAX parser must begin using
+    * the new resolver immediately.
+    *
+    * @param resolver The object for resolving entities.
+    * @see EntityResolver#EntityResolver
+    * @see HandlerBase#HandlerBase
+    */
+    virtual void setEntityResolver(EntityResolver* const resolver) = 0;
+     
+  /**
+    * Allow an application to register a DTD event handler.
+    *
+    * If the application does not register a DTD handler, all DTD
+    * events reported by the SAX parser will be silently ignored (this
+    * is the default behaviour implemented by HandlerBase).
+    *
+    * Applications may register a new or different handler in the middle
+    * of a parse, and the SAX parser must begin using the new handler
+    * immediately.
+    *
+    * @param handler The DTD handler.
+    * @see DTDHandler#DTDHandler
+    * @see HandlerBase#HandlerBase
+    */
+    virtual void setDTDHandler(DTDHandler* const handler) = 0;
+
+  /**
+    * Allow an application to register a document event handler.
+    *
+    * If the application does not register a document handler, all
+    * document events reported by the SAX parser will be silently
+    * ignored (this is the default behaviour implemented by
+    * HandlerBase).
+    *
+    * Applications may register a new or different handler in the
+    * middle of a parse, and the SAX parser must begin using the new
+    * handler immediately.
+    *
+    * @param handler The document handler.
+    * @see DocumentHandler#DocumentHandler
+    * @see HandlerBase#HandlerBase
+    */
+    virtual void setDocumentHandler(DocumentHandler* const handler) = 0;
+
+  /**
+    * Allow an application to register an error event handler.
+    *
+    * If the application does not register an error event handler,
+    * all error events reported by the SAX parser will be silently
+    * ignored, except for fatalError, which will throw a SAXException
+    * (this is the default behaviour implemented by HandlerBase).
+    *
+    * Applications may register a new or different handler in the
+    * middle of a parse, and the SAX parser must begin using the new
+    * handler immediately.
+    *
+    * @param handler The error handler.
+    * @see ErrorHandler#ErrorHandler
+    * @see SAXException#SAXException
+    * @see HandlerBase#HandlerBase
+    */
+    virtual void setErrorHandler(ErrorHandler* const handler) = 0;
+
+  /**
+    * Parse an XML document.
+    *
+    * The application can use this method to instruct the SAX parser
+    * to begin parsing an XML document from any valid input
+    * source (a character stream, a byte stream, or a URI).
+    *
+    * Applications may not invoke this method while a parse is in
+    * progress (they should create a new Parser instead for each
+    * additional XML document).  Once a parse is complete, an
+    * application may reuse the same Parser object, possibly with a
+    * different input source.
+    *
+    * @param source The input source for the top-level of the
+    *               XML document.
+    * @param reuseValidator Indicates whether the validator should be
+    *               reused, ignoring any external subset. If true, there
+    *               cannot be any internal subset.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @exception XMLException An exception from the parser or client
+    *            handler code.
+    * @see InputSource#InputSource
+    * @see #setEntityResolver
+    * @see #setDTDHandler
+    * @see #setDocumentHandler
+    * @see #setErrorHandler
+    */
+    virtual void parse
+    (
+        const   InputSource&    source
+        , const bool            reuseValidator = false
+    ) = 0;
+
+  /**
+    * Parse an XML document from a system identifier (URI).
+    *
+    * This method is a shortcut for the common case of reading a
+    * document from a system identifier.  It is the exact equivalent
+    * of the following:
+    *
+    * parse(new URLInputSource(systemId));
+    *
+    * If the system identifier is a URL, it must be fully resolved
+    * by the application before it is passed to the parser.
+    *
+    * @param systemId The system identifier (URI).
+    * @param reuseValidator Indicates whether the validator should be
+    *               reused, ignoring any external subset. If true, there
+    *               cannot be any internal subset.
+    * @exception SAXException Any SAX exception, possibly
+    *            wrapping another exception.
+    * @exception XMLException An exception from the parser or client
+    *            handler code.
+    * @see #parse(InputSource)
+    */
+    virtual void parse
+    (
+        const   XMLCh* const    systemId
+        , const bool            reuseValidator = false
+    ) = 0;
+
+    virtual void parse
+    (
+        const   char* const     systemId
+        , const bool            reuseValidator = false
+    ) = 0;
+    //@}
+
+
+private :
+    /** @name Unimplemented constructors and operators */
+    //@{
+    /** The copy constructor, you cannot call this directly */
+    Parser(const Parser&);
+
+    /** The assignment operator, you cannot call this directly */
+    void operator=(const Parser&);
+    //@}
+};
+
+#endif
diff --git a/src/sax/SAXException.hpp b/src/sax/SAXException.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e170c7e494d4edf734344dfbbc2b6401a9f03240
--- /dev/null
+++ b/src/sax/SAXException.hpp
@@ -0,0 +1,150 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:47  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:45:02  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef SAXEXCEPTION_HPP
+#define SAXEXCEPTION_HPP
+
+#include <util/XMLString.hpp>
+#include <util/XMLUni.hpp>
+
+
+/**
+  * Encapsulate a general SAX error or warning.
+  *
+  * <p>This class can contain basic error or warning information from
+  * either the XML SAX parser or the application: a parser writer or
+  * application writer can subclass it to provide additional
+  * functionality.  SAX handlers may throw this exception or
+  * any exception subclassed from it.</p>
+  *
+  * <p>If the application needs to pass through other types of
+  * exceptions, it must wrap those exceptions in a SAXException
+  * or an exception derived from a SAXException.</p>
+  *
+  * <p>If the parser or application needs to include information
+  * about a specific location in an XML document, it should use the
+  * SAXParseException subclass.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:47  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:45:02  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see SAXParseException#SAXParseException
+  */
+class SAX_EXPORT SAXException
+{
+public:
+    /** @name Constructors and Destructor */
+    //@{
+    /** Default constructor 
+     */
+    SAXException() :
+
+        fMsg(XMLString::replicate(XMLUni::fgZeroLenString))
+    {
+    }
+
+  /**
+    * Create a new SAXException.
+    *
+    * @param msg The error or warning message.
+    */
+    SAXException(const XMLCh* const msg) :
+
+        fMsg(XMLString::replicate(msg))
+    {
+    }
+
+    SAXException(const char* const msg) :
+
+        fMsg(XMLString::transcode(msg))
+    {
+    }
+
+
+    /** Destructor */
+    virtual ~SAXException()
+    {
+    }
+
+    //@}
+
+
+    const XMLCh* getMessage() const
+    {
+        return fMsg;
+    }
+
+
+private :
+    XMLCh* fMsg;
+};
+
+#endif
diff --git a/src/sax/SAXParseException.cpp b/src/sax/SAXParseException.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..64882e0d23106cb497eb07b63ed7abeacd19bad8
--- /dev/null
+++ b/src/sax/SAXParseException.cpp
@@ -0,0 +1,164 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:47  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:45:02  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+//  Includes
+// ---------------------------------------------------------------------------
+#include    <util/XMLString.hpp>
+#include    <sax/Locator.hpp>
+#include    <sax/SAXParseException.hpp>
+
+
+// ---------------------------------------------------------------------------
+//  SAXParseException: Constructors and Destructor
+// ---------------------------------------------------------------------------
+SAXParseException::SAXParseException(const  XMLCh* const    message
+                                    , const Locator&        locator) :
+    SAXException(message)
+    , fColumnNumber(locator.getColumnNumber())
+    , fLineNumber(locator.getLineNumber())
+    , fPublicId(XMLString::replicate(locator.getPublicId()))
+    , fSystemId(XMLString::replicate(locator.getSystemId()))
+{
+}
+
+SAXParseException::SAXParseException(const  XMLCh* const    message
+                                    , const XMLCh* const    publicId
+                                    , const XMLCh* const    systemId
+                                    , const unsigned int    lineNumber
+                                    , const unsigned int    columnNumber) :
+    SAXException(message)
+    , fColumnNumber(columnNumber)
+    , fLineNumber(lineNumber)
+    , fPublicId(XMLString::replicate(publicId))
+    , fSystemId(XMLString::replicate(systemId))
+{
+}
+
+SAXParseException::SAXParseException(const SAXParseException& toCopy) :
+
+    SAXException(toCopy)
+    , fColumnNumber(toCopy.fColumnNumber)
+    , fLineNumber(toCopy.fLineNumber)
+    , fPublicId(0)
+    , fSystemId(0)
+{
+    fPublicId = XMLString::replicate(toCopy.fPublicId);
+    fSystemId = XMLString::replicate(toCopy.fSystemId);
+}
+
+SAXParseException::~SAXParseException()
+{
+    delete [] fPublicId;
+    delete [] fSystemId;
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXParseException: Public operators
+// ---------------------------------------------------------------------------
+SAXParseException&
+SAXParseException::operator=(const SAXParseException& toAssign)
+{
+    if (this == &toAssign)
+        return *this;
+
+    fColumnNumber = toAssign.fColumnNumber;
+    fLineNumber = toAssign.fLineNumber;
+
+    delete [] fPublicId;
+    delete [] fSystemId;
+    fPublicId = XMLString::replicate(toAssign.fPublicId);
+    fSystemId = XMLString::replicate(toAssign.fSystemId);
+
+    return *this;
+}
+
+
+// ---------------------------------------------------------------------------
+//  SAXParseException: Getter methods
+// ---------------------------------------------------------------------------
+const XMLCh* SAXParseException::getPublicId() const
+{
+    return fPublicId;
+}
+
+const XMLCh* SAXParseException::getSystemId() const
+{
+    return fSystemId;
+}
+
+unsigned int SAXParseException::getLineNumber() const
+{
+    return fLineNumber;
+}
+
+
+unsigned int SAXParseException::getColumnNumber() const
+{
+    return fColumnNumber;
+}
diff --git a/src/sax/SAXParseException.hpp b/src/sax/SAXParseException.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..da74cb9778f2fcaa6653808cf3b3930fb1505c90
--- /dev/null
+++ b/src/sax/SAXParseException.hpp
@@ -0,0 +1,212 @@
+/*
+ * The Apache Software License, Version 1.1
+ * 
+ * Copyright (c) 1999 The Apache Software Foundation.  All rights 
+ * reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:  
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ * 
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written 
+ *    permission, please contact apache\@apache.org.
+ * 
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com .  For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/**
+ * $Log$
+ * Revision 1.1  1999/11/09 01:07:47  twl
+ * Initial revision
+ *
+ * Revision 1.2  1999/11/08 20:45:02  rahul
+ * Swat for adding in Product name and CVS comment log variable.
+ *
+ */
+
+
+#ifndef SAXPARSEEXCEPTION_HPP
+#define SAXPARSEEXCEPTION_HPP
+
+#include    <sax/SAXException.hpp>
+
+class Locator;
+
+/**
+  * Encapsulate an XML parse error or warning.
+  *
+  * <p>This exception will include information for locating the error
+  * in the original XML document.  Note that although the application
+  * will receive a SAXParseException as the argument to the handlers
+  * in the ErrorHandler interface, the application is not actually
+  * required to throw the exception; instead, it can simply read the
+  * information in it and take a different action.</p>
+  *
+  * <p>Since this exception is a subclass of SAXException, it
+  * inherits the ability to wrap another exception.</p>
+  *
+  * $Log$
+  * Revision 1.1  1999/11/09 01:07:47  twl
+  * Initial revision
+  *
+  * Revision 1.2  1999/11/08 20:45:02  rahul
+  * Swat for adding in Product name and CVS comment log variable.
+  *
+  * @see SAXException#SAXException
+  * @see Locator#Locator
+  * @see ErrorHandler#ErrorHandler
+  */
+class SAX_EXPORT SAXParseException : public SAXException
+{
+public:
+    /** @name Constructors and Destructor */
+    //@{
+  /**
+    * Create a new SAXParseException from a message and a Locator.
+    *
+    * <p>This constructor is especially useful when an application is
+    * creating its own exception from within a DocumentHandler
+    * callback.</p>
+    *
+    * @param message The error or warning message.
+    * @param locator The locator object for the error or warning.
+    * @see Locator#Locator
+    * @see Parser#setLocale 
+    */
+    SAXParseException(const XMLCh* const message, const Locator& locator);
+
+
+  /**
+    * Create a new SAXParseException.
+    *
+    * <p>This constructor is most useful for parser writers.</p>
+    *
+    * <p>If the system identifier is a URL, the parser must resolve it
+    * fully before creating the exception.</p>
+    *
+    * @param message The error or warning message.
+    * @param publicId The public identifer of the entity that generated
+    *                 the error or warning.
+    * @param systemId The system identifer of the entity that generated
+    *                 the error or warning.
+    * @param lineNumber The line number of the end of the text that
+    *                   caused the error or warning.
+    * @param columnNumber The column number of the end of the text that
+    *                     caused the error or warning.
+    * @see Parser#setLocale
+    */
+    SAXParseException
+    (
+        const   XMLCh* const    message
+        , const XMLCh* const    publicId
+        , const XMLCh* const    systemId
+        , const unsigned int    lineNumber
+        , const unsigned int    columnNumber
+    );
+
+    SAXParseException(const SAXParseException& toCopy);
+
+    /** Destructor */
+    ~SAXParseException();
+
+    //@}
+
+    SAXParseException& operator=(const SAXParseException& toAssign);
+
+    /** @name Getter methods */
+    //@{
+   /**
+    * The column number of the end of the text where the exception occurred.
+    *
+    * <p>The first column in a line is position 1.</p>
+    *
+    * @return An integer representing the column number, or -1
+    *         if none is available.
+    * @see Locator#getColumnNumber
+    */
+    unsigned int getColumnNumber() const;
+  /**
+    * The line number of the end of the text where the exception occurred.
+    *
+    * @return An integer representing the line number, or -1
+    *         if none is available.
+    * @see Locator#getLineNumber
+    */
+    unsigned int getLineNumber() const;
+  /**
+    * Get the public identifier of the entity where the exception occurred.
+    *
+    * @return A string containing the public identifier, or null
+    *         if none is available.
+    * @see Locator#getPublicId
+    */
+    const XMLCh* getPublicId() const;
+  /**
+    * Get the system identifier of the entity where the exception occurred.
+    *
+    * <p>If the system identifier is a URL, it will be resolved
+    * fully.</p>
+    *
+    * @return A string containing the system identifier, or null
+    *         if none is available.
+    * @see Locator#getSystemId
+    */
+    const XMLCh* getSystemId() const;
+    //@}
+
+private:
+    /** @name Data Members */
+    //@{
+    /** The column in the source text where the error occured. */
+    unsigned int    fColumnNumber;
+    /** The line in the source text where the error occured. */
+    unsigned int    fLineNumber;
+    /** The public id of the file where the error occured. */
+    XMLCh*          fPublicId;
+    /** The system id of the file where the error occured. */
+    XMLCh*          fSystemId;
+    //@}
+
+};
+
+#endif