You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2006/03/31 16:52:50 UTC

svn commit: r390436 - in /xerces/c/trunk: Projects/Win32/BCB6/Xerces-all/XercesLib/ Projects/Win32/BCC.551/Xerces-all/XercesLib/ Projects/Win32/VC6/xerces-all/XercesLib/ Projects/Win32/VC7.1/xerces-all/XercesLib/ Projects/Win32/VC7/xerces-all/XercesLib...

Author: amassari
Date: Fri Mar 31 06:52:46 2006
New Revision: 390436

URL: http://svn.apache.org/viewcvs?rev=390436&view=rev
Log:
Make DOMLSParser and DOMLSSerializer use DOMLSInput and DOMLSOutput for specification of parameters

Added:
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.cpp   (with props)
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.hpp   (with props)
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.cpp   (with props)
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.hpp   (with props)
Modified:
    xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr
    xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak
    xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp
    xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj
    xerces/c/trunk/Projects/Win32/VC7/xerces-all/XercesLib/XercesLib.vcproj
    xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj
    xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp
    xerces/c/trunk/src/Makefile.am
    xerces/c/trunk/src/Makefile.in
    xerces/c/trunk/src/xercesc/dom/DOM.hpp
    xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp
    xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp
    xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp
    xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp
    xerces/c/trunk/src/xercesc/dom/DOMLSResourceResolver.hpp
    xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.hpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp
    xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.cpp
    xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.hpp
    xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.cpp
    xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.hpp
    xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp
    xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp
    xerces/c/trunk/tests/src/DOM/Normalizer/Normalizer.cpp
    xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp
    xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp

Modified: xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr (original)
+++ xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr Fri Mar 31 06:52:46 2006
@@ -255,6 +255,8 @@
       ..\..\..\..\..\Build\Win32\BCB6\obj\DOMImplementationListImpl.obj 
       ..\..\..\..\..\Build\Win32\BCB6\obj\DOMImplementationRegistry.obj 
       ..\..\..\..\..\Build\Win32\BCB6\obj\DOMLocatorImpl.obj 
+      ..\..\..\..\..\Build\Win32\BCB6\obj\DOMLSInputImpl.obj 
+      ..\..\..\..\..\Build\Win32\BCB6\obj\DOMLSOutputImpl.obj 
       ..\..\..\..\..\Build\Win32\BCB6\obj\DOMLSSerializerImpl.obj 
       ..\..\..\..\..\Build\Win32\BCB6\obj\DOMNamedNodeMapImpl.obj 
       ..\..\..\..\..\Build\Win32\BCB6\obj\DOMNodeIDMap.obj 

Modified: xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak (original)
+++ xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak Fri Mar 31 06:52:46 2006
@@ -291,6 +291,8 @@
     $(TARGETPATH)\obj\DOMStringListImpl.obj \
     $(TARGETPATH)\obj\DOMLSParserImpl.obj \
     $(TARGETPATH)\obj\DOMLSSerializerImpl.obj \
+    $(TARGETPATH)\obj\DOMLSInputImpl.obj \
+    $(TARGETPATH)\obj\DOMLSOutputImpl.obj \
     $(TARGETPATH)\obj\DOMLSException.obj \
     $(TARGETPATH)\obj\Wrapper4InputSource.obj \
     $(TARGETPATH)\obj\Wrapper4DOMLSInput.obj \

Modified: xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp (original)
+++ xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp Fri Mar 31 06:52:46 2006
@@ -2983,6 +2983,22 @@
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.hpp
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\..\..\..\src\xercesc\dom\impl\DOMLSSerializerImpl.cpp
 # End Source File
 # Begin Source File

Modified: xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj (original)
+++ xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj Fri Mar 31 06:52:46 2006
@@ -2608,6 +2608,18 @@
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLocatorImpl.hpp">
 				</File>
 				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.cpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.hpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.cpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.hpp">
+				</File>
+				<File
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSSerializerImpl.cpp">
 				</File>
 				<File

Modified: xerces/c/trunk/Projects/Win32/VC7/xerces-all/XercesLib/XercesLib.vcproj
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/Projects/Win32/VC7/xerces-all/XercesLib/XercesLib.vcproj?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC7/xerces-all/XercesLib/XercesLib.vcproj (original)
+++ xerces/c/trunk/Projects/Win32/VC7/xerces-all/XercesLib/XercesLib.vcproj Fri Mar 31 06:52:46 2006
@@ -1924,6 +1924,12 @@
 					<File
 						RelativePath="..\..\..\..\..\src\xercesc\validators\schema\identity\IdentityConstraint.hpp">
 					</File>
+		            <File
+			            RelativePath="..\..\..\..\..\src\xercesc\validators\schema\identity\IdentityConstraintHandler.cpp">
+		            </File>
+		            <File
+			            RelativePath="..\..\..\..\..\src\xercesc\validators\schema\identity\IdentityConstraintHandler.hpp">
+		            </File>
 					<File
 						RelativePath="..\..\..\..\..\src\xercesc\validators\schema\identity\ValueStore.cpp">
 					</File>
@@ -2160,13 +2166,13 @@
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMAttrNSImpl.hpp">
 				</File>
 				<File
-					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMCDATASectionImpl.cpp">
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMCasts.hpp">
 				</File>
 				<File
-					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMCDATASectionImpl.hpp">
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMCDATASectionImpl.cpp">
 				</File>
 				<File
-					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMCasts.hpp">
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMCDATASectionImpl.hpp">
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMCharacterDataImpl.cpp">
@@ -2253,10 +2259,16 @@
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationImpl.cpp">
 				</File>
 				<File
-					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationRegistry.cpp">
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationImpl.hpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationListImpl.cpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationListImpl.hpp">
 				</File>
 				<File
-					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationimpl.hpp">
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMImplementationRegistry.cpp">
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLocatorImpl.cpp">
@@ -2265,6 +2277,24 @@
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLocatorImpl.hpp">
 				</File>
 				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.cpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.hpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.cpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.hpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSSerializerImpl.cpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSSerializerImpl.hpp">
+				</File>
+				<File
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMNamedNodeMapImpl.cpp">
 				</File>
 				<File
@@ -2331,6 +2361,12 @@
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMRangeImpl.hpp">
 				</File>
 				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMStringListImpl.cpp">
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMStringListImpl.hpp">
+				</File>
+				<File
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMStringPool.cpp">
 				</File>
 				<File
@@ -2355,12 +2391,6 @@
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMTypeInfoImpl.hpp">
 				</File>
 				<File
-					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMWriterImpl.cpp">
-				</File>
-				<File
-					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMWriterImpl.hpp">
-				</File>
-				<File
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\XSDElementNSImpl.cpp">
 				</File>
 				<File
@@ -2368,12 +2398,6 @@
 				</File>
 			</Filter>
 		</Filter>
-		<File
-			RelativePath="..\..\..\..\..\src\xercesc\validators\schema\identity\IdentityConstraintHandler.cpp">
-		</File>
-		<File
-			RelativePath="..\..\..\..\..\src\xercesc\validators\schema\identity\IdentityConstraintHandler.hpp">
-		</File>
 		<File
 			RelativePath="..\..\..\..\..\src\xercesc\util\MsgLoaders\Win32\Version.rc">
 			<FileConfiguration

Modified: xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj (original)
+++ xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj Fri Mar 31 06:52:46 2006
@@ -3477,6 +3477,22 @@
 					>
 				</File>
 				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.cpp"
+                    >
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSInputImpl.hpp"
+                    >
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.cpp"
+                    >
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSOutputImpl.hpp"
+                    >
+				</File>
+				<File
 					RelativePath="..\..\..\..\..\src\xercesc\dom\impl\DOMLSSerializerImpl.cpp"
 					>
 				</File>

Modified: xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp (original)
+++ xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp Fri Mar 31 06:52:46 2006
@@ -68,9 +68,6 @@
 #include <xercesc/util/PlatformUtils.hpp>
 
 #include <xercesc/dom/DOM.hpp>
-#include <xercesc/dom/DOMImplementation.hpp>
-#include <xercesc/dom/DOMImplementationLS.hpp>
-#include <xercesc/dom/DOMLSSerializer.hpp>
 
 #include <xercesc/framework/StdOutFormatTarget.hpp>
 #include <xercesc/framework/LocalFileFormatTarget.hpp>
@@ -434,9 +431,10 @@
             XMLCh tempStr[3] = {chLatin_L, chLatin_S, chNull};
             DOMImplementation *impl          = DOMImplementationRegistry::getDOMImplementation(tempStr);
             DOMLSSerializer   *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+            DOMLSOutput       *theOutputDesc = ((DOMImplementationLS*)impl)->createLSOutput();
 
             // set user specified output encoding
-            theSerializer->setEncoding(gOutputEncoding);
+            theOutputDesc->setEncoding(gOutputEncoding);
 
             // plug in user's own filter
             if (gUseFilter)
@@ -482,9 +480,10 @@
             //
             XMLFormatTarget *myFormTarget;
             if (goutputfile)
-                myFormTarget = new LocalFileFormatTarget(goutputfile);
+                myFormTarget=new LocalFileFormatTarget(goutputfile);
             else
-                myFormTarget = new StdOutFormatTarget();
+                myFormTarget=new StdOutFormatTarget();
+            theOutputDesc->setByteStream(myFormTarget);
 
             // get the DOM representation
             DOMNode                     *doc = parser->getDocument();
@@ -492,9 +491,10 @@
             //
             // do the serialization through DOMLSSerializer::write();
             //
-            theSerializer->write(doc, myFormTarget);
+            theSerializer->write(doc, theOutputDesc);
 
-            delete theSerializer;
+            theOutputDesc->release();
+            theSerializer->release();
 
             //
             // Filter, formatTarget and error handler

Modified: xerces/c/trunk/src/Makefile.am
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/Makefile.am?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/Makefile.am (original)
+++ xerces/c/trunk/src/Makefile.am Fri Mar 31 06:52:46 2006
@@ -355,6 +355,8 @@
 	xercesc/dom/impl/DOMTreeWalkerImpl.hpp \
 	xercesc/dom/impl/DOMTypeInfoImpl.hpp \
 	xercesc/dom/impl/DOMLSSerializerImpl.hpp \
+	xercesc/dom/impl/DOMLSInputImpl.hpp \
+	xercesc/dom/impl/DOMLSOutputImpl.hpp \
 	xercesc/dom/impl/XSDElementNSImpl.hpp
 							  
 domimpl_sources	= \
@@ -396,6 +398,8 @@
 	xercesc/dom/impl/DOMTreeWalkerImpl.cpp \
 	xercesc/dom/impl/DOMTypeInfoImpl.cpp \
 	xercesc/dom/impl/DOMLSSerializerImpl.cpp \
+	xercesc/dom/impl/DOMLSInputImpl.cpp \
+	xercesc/dom/impl/DOMLSOutputImpl.cpp \
 	xercesc/dom/impl/XSDElementNSImpl.cpp
 
 

Modified: xerces/c/trunk/src/Makefile.in
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/Makefile.in?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/Makefile.in (original)
+++ xerces/c/trunk/src/Makefile.in Fri Mar 31 06:52:46 2006
@@ -223,6 +223,8 @@
 	xercesc/dom/impl/DOMTreeWalkerImpl.lo \
 	xercesc/dom/impl/DOMTypeInfoImpl.lo \
 	xercesc/dom/impl/DOMLSSerializerImpl.lo \
+	xercesc/dom/impl/DOMLSInputImpl.lo \
+	xercesc/dom/impl/DOMLSOutputImpl.lo \
 	xercesc/dom/impl/XSDElementNSImpl.lo
 am_libdomimpl_la_OBJECTS = $(am__objects_4)
 libdomimpl_la_OBJECTS = $(am_libdomimpl_la_OBJECTS)
@@ -1208,6 +1210,8 @@
 	xercesc/dom/impl/DOMTreeWalkerImpl.hpp \
 	xercesc/dom/impl/DOMTypeInfoImpl.hpp \
 	xercesc/dom/impl/DOMLSSerializerImpl.hpp \
+	xercesc/dom/impl/DOMLSInputImpl.hpp \
+	xercesc/dom/impl/DOMLSOutputImpl.hpp \
 	xercesc/dom/impl/XSDElementNSImpl.hpp
 
 domimpl_sources = \
@@ -1249,6 +1253,8 @@
 	xercesc/dom/impl/DOMTreeWalkerImpl.cpp \
 	xercesc/dom/impl/DOMTypeInfoImpl.cpp \
 	xercesc/dom/impl/DOMLSSerializerImpl.cpp \
+	xercesc/dom/impl/DOMLSInputImpl.cpp \
+	xercesc/dom/impl/DOMLSOutputImpl.cpp \
 	xercesc/dom/impl/XSDElementNSImpl.cpp
 
 framework_headers = \
@@ -2223,6 +2229,10 @@
 xercesc/dom/impl/DOMLSSerializerImpl.lo:  \
 	xercesc/dom/impl/$(am__dirstamp) \
 	xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
+xercesc/dom/impl/DOMLSInputImpl.lo: xercesc/dom/impl/$(am__dirstamp) \
+	xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
+xercesc/dom/impl/DOMLSOutputImpl.lo: xercesc/dom/impl/$(am__dirstamp) \
+	xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
 xercesc/dom/impl/XSDElementNSImpl.lo:  \
 	xercesc/dom/impl/$(am__dirstamp) \
 	xercesc/dom/impl/$(DEPDIR)/$(am__dirstamp)
@@ -3170,6 +3180,10 @@
 	-rm -f xercesc/dom/impl/DOMImplementationListImpl.lo
 	-rm -f xercesc/dom/impl/DOMImplementationRegistry.$(OBJEXT)
 	-rm -f xercesc/dom/impl/DOMImplementationRegistry.lo
+	-rm -f xercesc/dom/impl/DOMLSInputImpl.$(OBJEXT)
+	-rm -f xercesc/dom/impl/DOMLSInputImpl.lo
+	-rm -f xercesc/dom/impl/DOMLSOutputImpl.$(OBJEXT)
+	-rm -f xercesc/dom/impl/DOMLSOutputImpl.lo
 	-rm -f xercesc/dom/impl/DOMLSSerializerImpl.$(OBJEXT)
 	-rm -f xercesc/dom/impl/DOMLSSerializerImpl.lo
 	-rm -f xercesc/dom/impl/DOMLocatorImpl.$(OBJEXT)
@@ -3776,6 +3790,8 @@
 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationImpl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationListImpl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMImplementationRegistry.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLSInputImpl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLSOutputImpl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLSSerializerImpl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMLocatorImpl.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/dom/impl/$(DEPDIR)/DOMNamedNodeMapImpl.Plo@am__quote@

Modified: xerces/c/trunk/src/xercesc/dom/DOM.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOM.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOM.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOM.hpp Fri Mar 31 06:52:46 2006
@@ -64,6 +64,7 @@
 #include <xercesc/dom/DOMImplementationRegistry.hpp>
 #include <xercesc/dom/DOMImplementationSource.hpp>
 #include <xercesc/dom/DOMLSInput.hpp>
+#include <xercesc/dom/DOMLSOutput.hpp>
 #include <xercesc/dom/DOMLocator.hpp>
 #include <xercesc/dom/DOMTypeInfo.hpp>
 #include <xercesc/dom/DOMUserDataHandler.hpp>

Modified: xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp Fri Mar 31 06:52:46 2006
@@ -163,7 +163,7 @@
      * @see DOMLSInput
      * @since DOM Level 3
      */
-    virtual DOMLSInput* createLSInput() = 0;
+    virtual DOMLSInput* createLSInput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
 
     /**
      * Create a new "empty" LSOutput.
@@ -173,7 +173,7 @@
      * @see LSOutput
      * @since DOM Level 3
      */
-    virtual DOMLSOutput* createLSOutput() = 0;
+    virtual DOMLSOutput* createLSOutput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
     //@}
 };
 

Modified: xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp Fri Mar 31 06:52:46 2006
@@ -27,7 +27,7 @@
 XERCES_CPP_NAMESPACE_BEGIN
 
 
-class BinInputStream;
+class InputSource;
 
 
 /**
@@ -99,16 +99,19 @@
     //  Getter methods
     // -----------------------------------------------------------------------
     /**
-     * Makes the byte stream for this input source.
+     * String data to parse. If provided, this will always be treated as a sequence of 16-bit units (UTF-16 encoded characters). 
+     * It is not a requirement to have an XML declaration when using stringData. If an XML declaration is present, the value of 
+     * the encoding attribute will be ignored.
      *
-     * <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>
+     */
+    virtual const XMLCh* getStringData() const = 0;
+
+    /**
+     * Returns the byte stream for this input source.
      *
-     * @see BinInputStream
+     * @see InputSource
      */
-    virtual BinInputStream* getByteStream() const = 0;
+    virtual InputSource* getByteStream() const = 0;
 
     /**
      * An input source can be set to force the parser to assume a particular
@@ -159,6 +162,20 @@
     // -----------------------------------------------------------------------
     //  Setter methods
     // -----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
+    /**
+     * Sets the UTF-16 string for this input source.
+     *
+     */
+    virtual void setStringData(const XMLCh* data) = 0;
+
+    /**
+     * Sets the byte stream for this input source.
+     *
+     * @see BinInputStream
+     */
+    virtual void setByteStream(InputSource* stream) = 0;
+
     /**
      * Set the encoding which will be required for use with the XML text read
      * via a stream opened by this input source.
@@ -228,7 +245,7 @@
      *
      * @see #getIssueFatalErrorIfNotFound
      */
-    virtual void setIssueFatalErrorIfNotFound(const bool flag) = 0;
+    virtual void setIssueFatalErrorIfNotFound(bool flag) = 0;
 
 
     /**
@@ -247,7 +264,7 @@
      *
      * Access to a released object will lead to unexpected result.
      */
-    virtual void              release() = 0;
+    virtual void release() = 0;
     //@}
 };
 

Modified: xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp Fri Mar 31 06:52:46 2006
@@ -1,5 +1,5 @@
-#ifndef DOMLSInput_HEADER_GUARD_
-#define DOMLSInput_HEADER_GUARD_
+#ifndef DOMLSOutput_HEADER_GUARD_
+#define DOMLSOutput_HEADER_GUARD_
 
 /*
  * Copyright 2002,2004 The Apache Software Foundation.
@@ -27,14 +27,12 @@
 XERCES_CPP_NAMESPACE_BEGIN
 
 
-class BinInputStream;
+class XMLFormatTarget;
 
 
 /**
   * This interface represents an output destination for data.
   *
-  * Xerces currently doesn't use <code>DOMLSOutput</code> objects
-  *
   * @see XMLFormatTarget
   * @since DOM Level 3
   */
@@ -81,13 +79,18 @@
     //  Getter methods
     // -----------------------------------------------------------------------
     /**
+     * Returns the byte stream for this input source.
+     *
+     * @see InputSource
+     */
+    virtual XMLFormatTarget* getByteStream() const = 0;
+
+    /**
      * 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.
      *
-     * <p><b>"Experimental - subject to change"</b></p>
-     *
      * @return The forced encoding, or null if none was supplied.
      * @see #setEncoding
      * @since DOM Level 3
@@ -97,8 +100,6 @@
     /**
      * Get the system identifier for this input source.
      *
-     * <p><b>"Experimental - subject to change"</b></p>
-     *
      * <p>If the system ID is a URL, it will be fully resolved.</p>
      *
      * @return The system identifier.
@@ -111,6 +112,13 @@
     //  Setter methods
     // -----------------------------------------------------------------------
     /**
+     * Sets the byte stream for this input source.
+     *
+     * @see BinInputStream
+     */
+    virtual void setByteStream(XMLFormatTarget* stream) = 0;
+
+    /**
      * Set the encoding which will be required for use with the XML text read
      * via a stream opened by this input source.
      *
@@ -119,8 +127,6 @@
      * to be incorrect because of intermediate transcoding, for instance
      * encapsulation within a MIME document.
      *
-     * <p><b>"Experimental - subject to change"</b></p>
-     *
      * @param encodingStr The name of the encoding to force.
      * @since DOM Level 3
      */
@@ -135,8 +141,6 @@
      *
      * <p>If the system ID is a URL, it must be fully resolved.</p>
      *
-     * <p><b>"Experimental - subject to change"</b></p>
-     *
      * @param systemId The system identifier as a string.
      * @see #getSystemId
      * @since DOM Level 3
@@ -149,21 +153,6 @@
     // -----------------------------------------------------------------------
     /** @name Non-standard Extension */
     //@{
-
-    /**
-     * 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>
-     *
-     * <p><b>"Experimental - subject to change"</b></p>
-     *
-     * @see BinInputStream
-     */
-    virtual BinInputStream* makeStream() const = 0;
-
     /**
      * Called to indicate that this DOMLSOutput is no longer in use
      * and that the implementation may relinquish any resources associated with it.

Modified: xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMLSParser.hpp Fri Mar 31 06:52:46 2006
@@ -451,7 +451,7 @@
       * @see resetDocumentPool
       * @since DOM Level 3
       */
-    virtual DOMDocument* parse(const DOMLSInput& source) = 0;
+    virtual DOMDocument* parse(const DOMLSInput* source) = 0;
 
     /**
       * Parse an XML document from a location identified by a URI reference [IETF RFC 2396]. 
@@ -578,7 +578,7 @@
       */
     virtual void parseWithContext
     (
-        const   DOMLSInput&     source
+        const   DOMLSInput*     source
         ,       DOMNode*        contextNode
         , const unsigned short  action
     ) = 0;
@@ -641,8 +641,6 @@
       * is enabled, the parser will cache the grammars for re-use. If a grammar
       * key is found in the pool, no caching of any grammar will take place.
       *
-      * <p><b>"Experimental - subject to change"</b></p>
-      *
       * @param source A const reference to the DOMLSInput object which
       *               points to the schema grammar file to be preparsed.
       * @param grammarType The grammar type (Schema or DTD).
@@ -659,7 +657,7 @@
       *
       * @see DOMLSInput#DOMLSInput
       */
-    virtual Grammar* loadGrammar(const DOMLSInput& source,
+    virtual Grammar* loadGrammar(const DOMLSInput* source,
                                  const short grammarType,
                                  const bool toCache = false) = 0;
 
@@ -671,8 +669,6 @@
       * enabled, the parser will cache the grammars for re-use. If a grammar
       * key is found in the pool, no caching of any grammar will take place.
       *
-      * <p><b>"Experimental - subject to change"</b></p>
-      *
       * @param systemId A const XMLCh pointer to the Unicode string which
       *                 contains the path to the XML grammar file to be
       *                 preparsed.
@@ -699,8 +695,6 @@
       * file specified by the file path parameter. If the 'toCache' flag is
       * enabled, the parser will cache the grammars for re-use. If a grammar
       * key is found in the pool, no caching of any grammar will take place.
-      *
-      * <p><b>"Experimental - subject to change"</b></p>
       *
       * @param systemId A const char pointer to a native string which contains
       *                 the path to the XML grammar file to be preparsed.

Modified: xerces/c/trunk/src/xercesc/dom/DOMLSResourceResolver.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSResourceResolver.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMLSResourceResolver.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMLSResourceResolver.hpp Fri Mar 31 06:52:46 2006
@@ -128,14 +128,11 @@
      * @see DOMLSInput#DOMLSInput
      * @since DOM Level 3
      */
-    virtual DOMLSInput* resolveResource
-    (
-        const   XMLCh* const    resourceType
-        , const XMLCh* const    namespaceUri
-        , const XMLCh* const    publicId
-        , const XMLCh* const    systemId
-        , const XMLCh* const    baseURI
-    ) = 0;
+    virtual DOMLSInput* resolveResource(  const XMLCh* const    resourceType
+                                        , const XMLCh* const    namespaceUri
+                                        , const XMLCh* const    publicId
+                                        , const XMLCh* const    systemId
+                                        , const XMLCh* const    baseURI) = 0;
 
     //@}
 

Modified: xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/DOMLSSerializer.hpp Fri Mar 31 06:52:46 2006
@@ -245,11 +245,13 @@
 #include <xercesc/dom/DOMLSSerializerFilter.hpp>
 #include <xercesc/dom/DOMErrorHandler.hpp>
 #include <xercesc/dom/DOMConfiguration.hpp>
-#include <xercesc/framework/XMLFormatter.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
 
-class CDOM_EXPORT DOMLSSerializer {
+class DOMLSOutput;
+
+class CDOM_EXPORT DOMLSSerializer 
+{
 protected :
     // -----------------------------------------------------------------------
     //  Hidden constructors
@@ -370,24 +372,6 @@
     //  Setter methods
     // -----------------------------------------------------------------------
     /**
-     * The character encoding in which the output will be written.
-     * <br> The encoding to use when writing is determined as follows: If the
-     * encoding attribute has been set, that value will be used.If the
-     * encoding attribute is <code>null</code> or empty, but the item to be
-     * written includes an encoding declaration, that value will be used.If
-     * neither of the above provides an encoding name, a default encoding of
-     * "UTF-8" will be used.
-     * <br>The default value is <code>null</code>.
-     *
-     *  <p><b>"Experimental - subject to change"</b></p>
-     *
-     * @param encoding    The character encoding in which the output will be written.
-     * @see   getEncoding
-     * @since DOM Level 3
-     */
-    virtual void           setEncoding(const XMLCh* const encoding) = 0;
-
-    /**
      * The end-of-line sequence of characters to be used in the XML being
      * written out. The only permitted values are these:
      * <dl>
@@ -431,22 +415,9 @@
     //  Getter methods
     // -----------------------------------------------------------------------
     /**
-     * Return the character encoding in which the output will be written.
-     *
-     *  <p><b>"Experimental - subject to change"</b></p>
-     *
-     * @return The character encoding used.
-     * @see   setEncoding
-     * @since DOM Level 3
-     */
-     virtual const XMLCh*       getEncoding() const = 0;
-
-    /**
      * Return the end-of-line sequence of characters to be used in the XML being
      * written out.
      *
-     *  <p><b>"Experimental - subject to change"</b></p>
-     *
      * @return             The end-of-line sequence of characters to be used.
      * @see   setNewLine
      * @since DOM Level 3
@@ -483,7 +454,7 @@
      * @since DOM Level 3
      */
     virtual bool       write(const DOMNode*         nodeToWrite,
-                             XMLFormatTarget* const destination) = 0;
+                             DOMLSOutput* const destination) = 0;
 
     /**
      * Write out the specified node as described above in the description of

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp Fri Mar 31 06:52:46 2006
@@ -22,6 +22,8 @@
 #include "DOMDocumentImpl.hpp"
 #include "DOMDocumentTypeImpl.hpp"
 #include "DOMLSSerializerImpl.hpp"
+#include "DOMLSInputImpl.hpp"
+#include "DOMLSOutputImpl.hpp"
 #include "DOMImplementationListImpl.hpp"
 
 #include <xercesc/dom/DOMDocument.hpp>
@@ -310,18 +312,14 @@
     return new (manager) DOMLSSerializerImpl(manager);
 }
 
-DOMLSInput* DOMImplementationImpl::createLSInput()
+DOMLSInput* DOMImplementationImpl::createLSInput(MemoryManager* const manager)
 {
-    throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0);
-
-    return 0;
+    return new (manager) DOMLSInputImpl(manager);
 }
 
-DOMLSOutput* DOMImplementationImpl::createLSOutput()
+DOMLSOutput* DOMImplementationImpl::createLSOutput(MemoryManager* const manager)
 {
-    throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0);
-
-    return 0;
+    return new (manager) DOMLSOutputImpl(manager);
 }
 
 // ------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.hpp Fri Mar 31 06:52:46 2006
@@ -81,8 +81,8 @@
                                         MemoryManager* const   manager = XMLPlatformUtils::fgMemoryManager,
                                         XMLGrammarPool*  const gramPool = 0);
     virtual DOMLSSerializer* createLSSerializer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
-    virtual DOMLSInput* createLSInput();
-    virtual DOMLSOutput* createLSOutput();
+    virtual DOMLSInput* createLSInput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+    virtual DOMLSOutput* createLSOutput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
 
     // ------------------------------------------------------------
     // DOMImplementationSource Virtual interface

Added: xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.cpp?rev=390436&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.cpp (added)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.cpp Fri Mar 31 06:52:46 2006
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2002-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+#include "DOMLSInputImpl.hpp"
+
+#include <xercesc/util/XMLString.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+DOMLSInputImpl::DOMLSInputImpl(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/)
+:fStringData(0)
+,fByteStream(0)
+,fEncoding(0)
+,fPublicId(0)
+,fSystemId(0)
+,fBaseURI(0)
+,fIssueFatalErrorIfNotFound(true)
+,fMemoryManager(manager)
+{
+}
+
+DOMLSInputImpl::~DOMLSInputImpl()
+{
+    fMemoryManager->deallocate(fEncoding);
+    fMemoryManager->deallocate(fPublicId);
+    fMemoryManager->deallocate(fSystemId);
+    fMemoryManager->deallocate(fBaseURI);
+}
+
+void DOMLSInputImpl::setStringData(const XMLCh* data)
+{
+    fStringData=data;
+}
+
+void DOMLSInputImpl::setByteStream(InputSource* stream)
+{
+    fByteStream=stream;
+}
+
+void DOMLSInputImpl::setEncoding(const XMLCh* const encodingStr)
+{
+    fMemoryManager->deallocate(fEncoding);
+    fEncoding = XMLString::replicate(encodingStr, fMemoryManager);
+}
+
+void DOMLSInputImpl::setPublicId(const XMLCh* const publicId)
+{
+    fMemoryManager->deallocate(fPublicId);
+    fPublicId = XMLString::replicate(publicId, fMemoryManager);
+}
+
+void DOMLSInputImpl::setSystemId(const XMLCh* const systemId)
+{
+    fMemoryManager->deallocate(fSystemId);
+    fSystemId = XMLString::replicate(systemId, fMemoryManager);
+}
+
+void DOMLSInputImpl::setBaseURI(const XMLCh* const baseURI)
+{
+    fMemoryManager->deallocate(fBaseURI);
+    fBaseURI = XMLString::replicate(baseURI, fMemoryManager);
+}
+
+void DOMLSInputImpl::setIssueFatalErrorIfNotFound(bool flag)
+{
+    fIssueFatalErrorIfNotFound=flag;
+}
+
+void DOMLSInputImpl::release()
+{
+    delete this;
+}
+
+
+XERCES_CPP_NAMESPACE_END
+

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.cpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.hpp?rev=390436&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.hpp (added)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.hpp Fri Mar 31 06:52:46 2006
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+
+#ifndef DOMLSInputImpl_HEADER_GUARD_
+#define DOMLSInputImpl_HEADER_GUARD_
+
+#include <xercesc/dom/DOM.hpp>
+#include <xercesc/dom/DOMLSInput.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+class CDOM_EXPORT DOMLSInputImpl : public XMemory, public DOMLSInput
+{
+
+public:
+
+    DOMLSInputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+    ~DOMLSInputImpl();
+
+    virtual const XMLCh* getStringData() const;
+    virtual InputSource* getByteStream() const;
+    virtual const XMLCh* getEncoding() const;
+    virtual const XMLCh* getPublicId() const;
+    virtual const XMLCh* getSystemId() const;
+    virtual const XMLCh* getBaseURI() const;
+
+    virtual void setStringData(const XMLCh* data);
+    virtual void setByteStream(InputSource* stream);
+    virtual void setEncoding(const XMLCh* const encodingStr);
+    virtual void setPublicId(const XMLCh* const publicId);
+    virtual void setSystemId(const XMLCh* const systemId);
+    virtual void setBaseURI(const XMLCh* const baseURI);
+
+    virtual void setIssueFatalErrorIfNotFound(bool flag);
+    virtual bool getIssueFatalErrorIfNotFound() const;
+    virtual void release();
+
+private:
+
+    /** unimplemented copy ctor and assignment operator */
+    DOMLSInputImpl(const DOMLSInputImpl&);
+    DOMLSInputImpl & operator = (const DOMLSInputImpl&);
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fStringData
+    //    We don't own it
+    //
+    //  fByteStream
+    //    We don't own it
+    //
+    //  fEncoding
+    //    We own it
+    //
+    //  fPublicId
+    //    We own it
+    //
+    //  fSystemId
+    //    We own it
+    //
+    //  fBaseURI
+    //    We own it
+    // 
+    // -----------------------------------------------------------------------
+
+    const XMLCh                  *fStringData;
+    InputSource                  *fByteStream;
+    XMLCh                        *fEncoding;
+    XMLCh                        *fPublicId;
+    XMLCh                        *fSystemId;
+    XMLCh                        *fBaseURI;
+    bool                         fIssueFatalErrorIfNotFound;
+    MemoryManager*               fMemoryManager;
+};
+
+inline const XMLCh* DOMLSInputImpl::getStringData() const
+{
+    return fStringData;
+}
+
+inline InputSource* DOMLSInputImpl::getByteStream() const
+{
+    return fByteStream;
+}
+
+inline const XMLCh* DOMLSInputImpl::getEncoding() const
+{
+    return fEncoding;
+}
+
+inline const XMLCh* DOMLSInputImpl::getPublicId() const
+{
+    return fPublicId;
+}
+
+inline const XMLCh* DOMLSInputImpl::getSystemId() const
+{
+    return fSystemId;
+}
+
+inline const XMLCh* DOMLSInputImpl::getBaseURI() const
+{
+    return fBaseURI;
+}
+
+inline bool DOMLSInputImpl::getIssueFatalErrorIfNotFound() const
+{
+    return fIssueFatalErrorIfNotFound;
+}
+
+
+XERCES_CPP_NAMESPACE_END
+
+#endif

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.hpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSInputImpl.hpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.cpp?rev=390436&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.cpp (added)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.cpp Fri Mar 31 06:52:46 2006
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2002-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+#include "DOMLSOutputImpl.hpp"
+
+#include <xercesc/util/XMLString.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+DOMLSOutputImpl::DOMLSOutputImpl(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/)
+:fByteStream(0)
+,fEncoding(0)
+,fSystemId(0)
+,fMemoryManager(manager)
+{
+}
+
+DOMLSOutputImpl::~DOMLSOutputImpl()
+{
+    fMemoryManager->deallocate(fEncoding);
+    fMemoryManager->deallocate(fSystemId);
+}
+
+void DOMLSOutputImpl::setByteStream(XMLFormatTarget* stream)
+{
+    fByteStream=stream;
+}
+
+void DOMLSOutputImpl::setEncoding(const XMLCh* const encodingStr)
+{
+    fMemoryManager->deallocate(fEncoding);
+    fEncoding = XMLString::replicate(encodingStr, fMemoryManager);
+}
+
+void DOMLSOutputImpl::setSystemId(const XMLCh* const systemId)
+{
+    fMemoryManager->deallocate(fSystemId);
+    fSystemId = XMLString::replicate(systemId, fMemoryManager);
+}
+
+void DOMLSOutputImpl::release()
+{
+    delete this;
+}
+
+
+XERCES_CPP_NAMESPACE_END
+

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.cpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.hpp?rev=390436&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.hpp (added)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.hpp Fri Mar 31 06:52:46 2006
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * $Id$
+ */
+
+
+#ifndef DOMLSOutputImpl_HEADER_GUARD_
+#define DOMLSOutputImpl_HEADER_GUARD_
+
+#include <xercesc/dom/DOM.hpp>
+#include <xercesc/dom/DOMLSOutput.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+class CDOM_EXPORT DOMLSOutputImpl : public XMemory, public DOMLSOutput
+{
+
+public:
+
+    DOMLSOutputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
+    ~DOMLSOutputImpl();
+
+    virtual XMLFormatTarget* getByteStream() const;
+    virtual const XMLCh* getEncoding() const;
+    virtual const XMLCh* getSystemId() const;
+
+    virtual void setByteStream(XMLFormatTarget* stream);
+    virtual void setEncoding(const XMLCh* const encodingStr);
+    virtual void setSystemId(const XMLCh* const systemId);
+
+    virtual void release();
+
+private:
+
+    /** unimplemented copy ctor and assignment operator */
+    DOMLSOutputImpl(const DOMLSOutputImpl&);
+    DOMLSOutputImpl & operator = (const DOMLSOutputImpl&);
+
+    // -----------------------------------------------------------------------
+    //  Private data members
+    //
+    //  fByteStream
+    //    We don't own it
+    //
+    //  fEncoding
+    //    We own it
+    //
+    //  fSystemId
+    //    We own it
+    // 
+    // -----------------------------------------------------------------------
+
+    XMLFormatTarget              *fByteStream;
+    XMLCh                        *fEncoding;
+    XMLCh                        *fSystemId;
+    MemoryManager*               fMemoryManager;
+};
+
+inline XMLFormatTarget* DOMLSOutputImpl::getByteStream() const
+{
+    return fByteStream;
+}
+
+inline const XMLCh* DOMLSOutputImpl::getEncoding() const
+{
+    return fEncoding;
+}
+
+inline const XMLCh* DOMLSOutputImpl::getSystemId() const
+{
+    return fSystemId;
+}
+
+XERCES_CPP_NAMESPACE_END
+
+#endif

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.hpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMLSOutputImpl.hpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp Fri Mar 31 06:52:46 2006
@@ -19,6 +19,7 @@
  */
 
 #include "DOMLSSerializerImpl.hpp"
+#include "DOMLSOutputImpl.hpp"
 #include "DOMErrorImpl.hpp"
 #include "DOMLocatorImpl.hpp"
 #include "DOMImplementationImpl.hpp"
@@ -286,7 +287,6 @@
 
 DOMLSSerializerImpl::~DOMLSSerializerImpl()
 {
-    fMemoryManager->deallocate(fEncoding);//delete [] fEncoding;
     fMemoryManager->deallocate(fNewLine);//delete [] fNewLine;
     delete fNamespaceStack;
     delete fSupportedParameters;
@@ -295,7 +295,6 @@
 
 DOMLSSerializerImpl::DOMLSSerializerImpl(MemoryManager* const manager)
 :fFeatures(0)
-,fEncoding(0)
 ,fNewLine(0)
 ,fErrorHandler(0)
 ,fFilter(0)
@@ -429,18 +428,6 @@
     return fSupportedParameters;
 }
 
-// we don't check the validity of the encoding set
-void DOMLSSerializerImpl::setEncoding(const XMLCh* const encoding)
-{
-    fMemoryManager->deallocate(fEncoding);//delete [] fEncoding;
-    fEncoding = XMLString::replicate(encoding, fMemoryManager);
-}
-
-const XMLCh* DOMLSSerializerImpl::getEncoding() const
-{
-    return fEncoding;
-}
-
 void DOMLSSerializerImpl::setNewLine(const XMLCh* const newLine)
 {
     fMemoryManager->deallocate(fNewLine);//delete [] fNewLine;
@@ -465,20 +452,97 @@
 //
 //
 //
-bool DOMLSSerializerImpl::write(const DOMNode*         nodeToWrite,
-                                XMLFormatTarget* const destination)
+bool DOMLSSerializerImpl::write(const DOMNode* nodeToWrite,
+                                DOMLSOutput* const destination)
 {
-    //init session vars
-    initSession(nodeToWrite);
+    XMLFormatTarget* pTarget=destination->getByteStream();
+    Janitor<XMLFormatTarget> janTarget(0);
+    if(!pTarget)
+    {
+        const XMLCh* szSystemId=destination->getSystemId();
+        if(!szSystemId)
+        {
+            //TODO: report error "missing target"
+            return false;
+        }
+        pTarget=new LocalFileFormatTarget(szSystemId, fMemoryManager);
+        janTarget.reset(pTarget);
+    }
+    /**
+     * When writing to a LSOutput, the encoding is found by looking at the encoding information 
+     * that is reachable through the LSOutput and the item to be written (or its owner document) in this order:
+     *
+     *  1. LSOutput.encoding,
+     *  2. Document.inputEncoding,
+     *  3. Document.xmlEncoding.
+     *
+     * If no encoding is reachable through the above properties, a default encoding of "UTF-8" will be used. 
+     * If the specified encoding is not supported an "unsupported-encoding" fatal error is raised.
+     */
+    fEncodingUsed = gUTF8;
+
+    const DOMDocument *docu = (nodeToWrite->getNodeType() == DOMNode::DOCUMENT_NODE)?
+                              (const DOMDocument*)nodeToWrite : nodeToWrite->getOwnerDocument();
+
+    const XMLCh* lsEncoding=destination->getEncoding();
+    if (lsEncoding && *lsEncoding)
+    {
+        fEncodingUsed = lsEncoding;
+    }
+    else if (docu)
+    {
+        const XMLCh* tmpEncoding = docu->getInputEncoding();
+
+        if ( tmpEncoding && *tmpEncoding)
+        {
+            fEncodingUsed = tmpEncoding;
+        }
+        else
+        {
+            tmpEncoding = docu->getXmlEncoding();
+
+            if ( tmpEncoding && *tmpEncoding)
+            {
+                fEncodingUsed = tmpEncoding;
+            }
+        }
+    }
+
+
+    /**
+     *  The end-of-line sequence of characters to be used in the XML being
+     *  written out. The only permitted values are these:
+     *     . null
+     *
+     *  Use a default end-of-line sequence. DOM implementations should choose
+     * the default to match the usual convention for text files in the
+     * environment being used. Implementations must choose a default
+     * sequence that matches one of those allowed by  2.11 "End-of-Line
+     * Handling".
+     *
+     *    CR    The carriage-return character (#xD)
+     *    CR-LF The carriage-return and line-feed characters (#xD #xA)
+     *    LF    The line-feed character (#xA)
+     *
+     *  The default value for this attribute is null
+     */
+    fNewLineUsed = (fNewLine && *fNewLine)? fNewLine : gEOLSeq;
+
+    /**
+     *  get Document Version
+     */
+    fDocumentVersion = docu?docu->getXmlVersion():XMLUni::fgVersion1_0;
+
+    fErrorCount = 0;
 
     try
     {
-        fFormatter = new (fMemoryManager) XMLFormatter(fEncodingUsed
-                                     ,fDocumentVersion
-                                     ,destination
-                                     ,XMLFormatter::NoEscapes
-                                     ,XMLFormatter::UnRep_CharRef
-                                     ,fMemoryManager);
+        fFormatter = new (fMemoryManager) XMLFormatter( fEncodingUsed
+                                                       ,fDocumentVersion
+                                                       ,pTarget
+                                                       ,XMLFormatter::NoEscapes
+                                                       ,XMLFormatter::UnRep_CharRef
+                                                       ,fMemoryManager);
     }
     catch (const TranscodingException& e)
     {
@@ -490,7 +554,7 @@
     {
         Janitor<XMLFormatter> janName(fFormatter);
         processNode(nodeToWrite);
-        destination->flush();
+        pTarget->flush();
     }
 
     //
@@ -502,13 +566,13 @@
     //
     catch (const TranscodingException&)
     {
-        destination->flush();
+        pTarget->flush();
         return false;
     }
 
     catch (const XMLDOMMsg::Codes)
     {
-        destination->flush();
+        pTarget->flush();
         return false;
     }
     catch(const OutOfMemoryException&)
@@ -517,7 +581,7 @@
     }
     catch (...)
     {
-        destination->flush();
+        pTarget->flush();
         throw;
     }
 
@@ -531,8 +595,9 @@
 
 bool DOMLSSerializerImpl::writeToURI(const DOMNode* nodeToWrite, const XMLCh* uri)
 {
-    LocalFileFormatTarget target(uri);
-    return write(nodeToWrite, &target);
+    DOMLSOutputImpl output(fMemoryManager);
+    output.setSystemId(uri);
+    return write(nodeToWrite, &output);
 }
 
 //
@@ -544,15 +609,14 @@
     MemBufFormatTarget  destination(1023, fMemoryManager);
     bool retVal;
 
-    // XMLCh is unicode, assume fEncoding as UTF-16
-    XMLCh* tempEncoding = fEncoding;
-    fEncoding = (XMLCh*) XMLUni::fgUTF16EncodingString;
-
     bool bBOMFlag=getFeature(BYTE_ORDER_MARK_ID);
     setFeature(BYTE_ORDER_MARK_ID, false);
     try
     {
-        retVal = write(nodeToWrite, &destination);
+        DOMLSOutputImpl output(fMemoryManager);
+        output.setByteStream(&destination);
+        output.setEncoding(XMLUni::fgUTF16EncodingString);
+        retVal = write(nodeToWrite, &output);
     }
     catch(const OutOfMemoryException&)
     {
@@ -564,92 +628,14 @@
         // there is a possibility that memory allocation
         // exception thrown in XMLBuffer class
         //
-        fEncoding = tempEncoding;
         setFeature(BYTE_ORDER_MARK_ID, bBOMFlag);
         return 0;
     }
 
-    fEncoding = tempEncoding;
     setFeature(BYTE_ORDER_MARK_ID, bBOMFlag);
     return (retVal ? XMLString::replicate((XMLCh*) destination.getRawBuffer(), fMemoryManager) : 0);
 }
 
-void DOMLSSerializerImpl::initSession(const DOMNode* const nodeToWrite)
-{
-
-/**
- * When writing to a LSOutput, the encoding is found by looking at the encoding information 
- * that is reachable through the LSOutput and the item to be written (or its owner document) in this order:
- *
- *  1. LSOutput.encoding,
- *  2. Document.inputEncoding,
- *  3. Document.xmlEncoding.
- *
- * If no encoding is reachable through the above properties, a default encoding of "UTF-8" will be used. 
- * If the specified encoding is not supported an "unsupported-encoding" fatal error is raised.
- */
-    fEncodingUsed = gUTF8;
-
-    if (fEncoding && *fEncoding)
-    {
-        fEncodingUsed = fEncoding;
-    }
-    else
-    {
-        const DOMDocument *docu = (nodeToWrite->getNodeType() == DOMNode::DOCUMENT_NODE)?
-                            (const DOMDocument*)nodeToWrite : nodeToWrite->getOwnerDocument();
-        if (docu)
-        {
-            const XMLCh* tmpEncoding = docu->getInputEncoding();
-
-            if ( tmpEncoding && *tmpEncoding)
-            {
-                fEncodingUsed = tmpEncoding;
-            }
-            else
-            {
-                tmpEncoding = docu->getXmlEncoding();
-
-                if ( tmpEncoding && *tmpEncoding)
-                {
-                    fEncodingUsed = tmpEncoding;
-                }
-            }
-        }
-    }
-
-    /**
-     *  The end-of-line sequence of characters to be used in the XML being
-     *  written out. The only permitted values are these:
-     *     . null
-     *
-     *  Use a default end-of-line sequence. DOM implementations should choose
-     * the default to match the usual convention for text files in the
-     * environment being used. Implementations must choose a default
-     * sequence that matches one of those allowed by  2.11 "End-of-Line
-     * Handling".
-     *
-     *    CR    The carriage-return character (#xD)
-     *    CR-LF The carriage-return and line-feed characters (#xD #xA)
-     *    LF    The line-feed character (#xA)
-     *
-     *  The default value for this attribute is null
-     */
-    fNewLineUsed = (fNewLine && *fNewLine)? fNewLine : gEOLSeq;
-
-    /**
-     *  get Document Version
-     */
-    const DOMDocument *docu = (nodeToWrite->getNodeType() == DOMNode::DOCUMENT_NODE)?
-                              (const DOMDocument*)nodeToWrite : nodeToWrite->getOwnerDocument();
-    if (docu)
-    {
-        fDocumentVersion = docu->getXmlVersion();
-    }
-
-    fErrorCount = 0;
-}
-
 //
 // Characters not representable in output encoding,
 //
@@ -787,7 +773,7 @@
             //
 
             if (getFeature(XML_DECLARATION)) {
-                // use the version and encoding resolved in initSession()
+                // use the version and encoding resolved 
                 *fFormatter << gXMLDecl_VersionInfo << fDocumentVersion << gXMLDecl_separator;
                 *fFormatter << gXMLDecl_EncodingDecl << fEncodingUsed << gXMLDecl_separator;
 
@@ -1704,42 +1690,42 @@
     if (!getFeature(BYTE_ORDER_MARK_ID))
         return;
 
-    if ((XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16LEncodingString)  == 0) ||
-        (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16LEncodingString2) == 0)  )
+    if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16LEncodingString)  == 0) ||
+        (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16LEncodingString2) == 0)  )
     {
         fFormatter->writeBOM(BOM_utf16le, 2);
     }
-    else if ((XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16BEncodingString)  == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16BEncodingString2) == 0)  )
+    else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16BEncodingString)  == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16BEncodingString2) == 0)  )
     {
         fFormatter->writeBOM(BOM_utf16be, 2);
     }
-    else if ((XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16EncodingString)  == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16EncodingString2) == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16EncodingString3) == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16EncodingString4) == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16EncodingString5) == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16EncodingString6) == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUTF16EncodingString7) == 0)  ) 
+    else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString)  == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString2) == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString3) == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString4) == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString5) == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString6) == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUTF16EncodingString7) == 0)  ) 
     {
     	if (XMLPlatformUtils::fgXMLChBigEndian)
             fFormatter->writeBOM(BOM_utf16be, 2);
         else
             fFormatter->writeBOM(BOM_utf16le, 2);
     }
-    else if ((XMLString::compareIStringASCII(fEncoding, XMLUni::fgUCS4LEncodingString)  == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUCS4LEncodingString2) == 0)  )
+    else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4LEncodingString)  == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4LEncodingString2) == 0)  )
     {
         fFormatter->writeBOM(BOM_ucs4le, 4);
     }
-    else if ((XMLString::compareIStringASCII(fEncoding, XMLUni::fgUCS4BEncodingString)  == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUCS4BEncodingString2) == 0)  )
+    else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4BEncodingString)  == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4BEncodingString2) == 0)  )
     {
         fFormatter->writeBOM(BOM_ucs4be, 4);
     }
-    else if ((XMLString::compareIStringASCII(fEncoding, XMLUni::fgUCS4EncodingString)  == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUCS4EncodingString2) == 0) ||
-             (XMLString::compareIStringASCII(fEncoding, XMLUni::fgUCS4EncodingString3) == 0)  )
+    else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString)  == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString2) == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString3) == 0)  )
     {
 		if (XMLPlatformUtils::fgXMLChBigEndian)
 	        fFormatter->writeBOM(BOM_ucs4be, 4);

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.hpp Fri Mar 31 06:52:46 2006
@@ -27,6 +27,7 @@
 #include <xercesc/util/XMLDOMMsg.hpp>
 #include <xercesc/util/RefHashTableOf.hpp>
 #include <xercesc/util/RefVectorOf.hpp>
+#include <xercesc/framework/XMLFormatter.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
 
@@ -58,19 +59,16 @@
 
     virtual DOMConfiguration*       getDomConfig();
 
-    virtual void                    setEncoding(const XMLCh* const encoding);
-    virtual const XMLCh*            getEncoding() const;
-
     virtual void                    setNewLine(const XMLCh* const newLine);
     virtual const XMLCh*            getNewLine() const;
 
     virtual void                    setFilter(DOMLSSerializerFilter *filter);
     virtual DOMLSSerializerFilter*  getFilter() const;
 
-    virtual bool                    write(const DOMNode*         nodeToWrite,
-                                          XMLFormatTarget* const destination);
-    virtual bool                    writeToURI(const DOMNode*    nodeToWrite, 
-                                               const XMLCh*      uri);
+    virtual bool                    write(const DOMNode*        nodeToWrite,
+                                          DOMLSOutput* const    destination);
+    virtual bool                    writeToURI(const DOMNode*   nodeToWrite, 
+                                               const XMLCh*     uri);
     /**
 	  *  The caller is responsible for the release of the returned string
 	  */
@@ -96,7 +94,6 @@
     DOMLSSerializerImpl & operator = (const DOMLSSerializerImpl&);
 
     /** helper **/
-    void                          initSession(const DOMNode* const);
     void                          processNode(const DOMNode* const);
 
     void                          procCdataSection(const XMLCh*   const nodeValue
@@ -149,9 +146,6 @@
     //
     //  fFeatures
     //
-    //  fEncoding
-    //      own it
-    //
     //  fNewLine
     //      own it
     //
@@ -192,7 +186,6 @@
     // -----------------------------------------------------------------------
 
     int                           fFeatures;
-    XMLCh                        *fEncoding;
     XMLCh                        *fNewLine;
     DOMErrorHandler              *fErrorHandler;
     DOMLSSerializerFilter        *fFilter;

Modified: xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.cpp Fri Mar 31 06:52:46 2006
@@ -24,7 +24,12 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/framework/Wrapper4DOMLSInput.hpp>
 #include <xercesc/dom/DOMLSInput.hpp>
+#include <xercesc/dom/DOMLSResourceResolver.hpp>
 #include <xercesc/util/NullPointerException.hpp>
+#include <xercesc/util/XMLString.hpp>
+#include <xercesc/framework/MemBufInputSource.hpp>
+#include <xercesc/framework/LocalFileInputSource.hpp>
+#include <xercesc/framework/URLInputSource.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
 
@@ -32,11 +37,14 @@
 //  Wrapper4DOMLSInput: Constructor and Destructor
 // ---------------------------------------------------------------------------
 Wrapper4DOMLSInput::Wrapper4DOMLSInput(DOMLSInput* const inputSource,
-                                               const bool adoptFlag,
-                                               MemoryManager* const  manager) :
+                                       DOMLSResourceResolver* entityResolver,
+                                       const bool adoptFlag,
+                                       MemoryManager* const  manager) :
     InputSource(manager)
     , fAdoptInputSource(adoptFlag)
-    ,  fInputSource(inputSource)
+    , fForceXMLChEncoding(false)
+    , fInputSource(inputSource)
+    , fEntityResolver(entityResolver)
 {
     if (!inputSource)
         ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, getMemoryManager());
@@ -59,6 +67,8 @@
 
 const XMLCh* Wrapper4DOMLSInput::getEncoding() const
 {
+    if(fForceXMLChEncoding)
+        return XMLUni::fgXMLChEncodingString;
     return fInputSource->getEncoding();
 }
 
@@ -105,7 +115,44 @@
 // ---------------------------------------------------------------------------
 BinInputStream* Wrapper4DOMLSInput::makeStream() const
 {
-    return fInputSource->getByteStream();
+    // The LSParser will use the LSInput object to determine how to read data. The LSParser will look at the different inputs specified in the 
+    // LSInput in the following order to know which one to read from, the first one that is not null and not an empty string will be used:
+    //   1. LSInput.characterStream
+    //   2. LSInput.byteStream
+    //   3. LSInput.stringData
+    //   4. LSInput.systemId
+    //   5. LSInput.publicId
+    InputSource* binStream=fInputSource->getByteStream();
+    if(binStream)
+        return binStream->makeStream();
+    const XMLCh* xmlString=fInputSource->getStringData();
+    if(xmlString)
+    {
+        MemBufInputSource is((const XMLByte*)xmlString, XMLString::stringLen(xmlString)*sizeof(XMLCh), "", false, getMemoryManager());
+        is.setCopyBufToStream(false);
+        return is.makeStream();
+    }
+    const XMLCh* szSystemId=fInputSource->getSystemId();
+    if(szSystemId)
+    {
+        XMLURL urlTmp(getMemoryManager());
+        if (urlTmp.setURL(szSystemId, fInputSource->getBaseURI(), urlTmp) && !urlTmp.isRelative())
+        {
+            URLInputSource src(urlTmp, getMemoryManager());
+            return src.makeStream();
+        }          
+        LocalFileInputSource src(szSystemId, getMemoryManager());
+        return src.makeStream();
+    }
+    const XMLCh* szPublicId=fInputSource->getPublicId();
+    if(szPublicId && fEntityResolver)
+    {
+        DOMLSInput* is = fEntityResolver->resolveResource(XMLUni::fgDOMDTDType, 0, szPublicId, 0, fInputSource->getBaseURI());
+        if (is)
+            return Wrapper4DOMLSInput(is, fEntityResolver, true, getMemoryManager()).makeStream();
+    }
+
+    return 0;
 }
 
 XERCES_CPP_NAMESPACE_END

Modified: xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/Wrapper4DOMLSInput.hpp Fri Mar 31 06:52:46 2006
@@ -27,7 +27,7 @@
 XERCES_CPP_NAMESPACE_BEGIN
 
 class DOMLSInput;
-
+class DOMLSResourceResolver;
 
 /**
   * Wrap a DOMLSInput object to a SAX InputSource.
@@ -53,6 +53,7 @@
     Wrapper4DOMLSInput
     (
         DOMLSInput* const inputSource
+        , DOMLSResourceResolver* entityResolver = 0
         , const bool adoptFlag = true
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
@@ -216,8 +217,10 @@
     // -----------------------------------------------------------------------
     //  Private data members
     // -----------------------------------------------------------------------
-    bool            fAdoptInputSource;
-    DOMLSInput* fInputSource;
+    bool                    fAdoptInputSource,
+                            fForceXMLChEncoding;
+    DOMLSInput*             fInputSource;
+    DOMLSResourceResolver*  fEntityResolver;
 };
 
 XERCES_CPP_NAMESPACE_END

Modified: xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.cpp Fri Mar 31 06:52:46 2006
@@ -75,7 +75,7 @@
 // ---------------------------------------------------------------------------
 //  Wrapper4InputSource: Setter methods
 // ---------------------------------------------------------------------------
-void Wrapper4InputSource::setIssueFatalErrorIfNotFound(const bool flag)
+void Wrapper4InputSource::setIssueFatalErrorIfNotFound(bool flag)
 {
     fInputSource->setIssueFatalErrorIfNotFound(flag);
 }
@@ -102,9 +102,9 @@
 // ---------------------------------------------------------------------------
 //  Wrapper4InputSource: Stream methods
 // ---------------------------------------------------------------------------
-BinInputStream* Wrapper4InputSource::getByteStream() const
+InputSource* Wrapper4InputSource::getByteStream() const
 {
-    return fInputSource->makeStream();
+    return fInputSource;
 }
 
 // ---------------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/Wrapper4InputSource.hpp Fri Mar 31 06:52:46 2006
@@ -42,7 +42,7 @@
   /**
     * Constructor
     *
-    * Wrap a SAX InputSource and pretend it to be a DOMInputSource.
+    * Wrap a SAX InputSource and pretend it to be a DOMLSInput.
     * By default, the wrapper will adopt the SAX InputSource that is wrapped.
     *
     * @param  inputSource  The SAX InputSource to be wrapped
@@ -66,23 +66,26 @@
     /** @name Virtual input source interface */
     //@{
   /**
+    * This wrapper doesn't support character streams
+    *
+    */
+    virtual const XMLCh* getCharacterStream() const;
+
+  /**
     * Makes the byte stream for this input source.
     *
     * <p>The function will call the makeStream of the wrapped input source.
     * The returned stream becomes the parser's property.</p>
     *
-    * @see BinInputStream
+    * @see InputSource
     */
-    BinInputStream* getByteStream() const;
-
+    virtual InputSource* getByteStream() const;
     //@}
 
     // -----------------------------------------------------------------------
     /** @name Getter methods */
     //@{
   /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * 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 will delegate to the wrapped input source to return
@@ -92,12 +95,10 @@
     * @return The forced encoding, or null if none was supplied.
     * @see #setEncoding
     */
-    const XMLCh* getEncoding() const;
+    virtual const XMLCh* getEncoding() const;
 
 
   /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * Get the public identifier for this input source. Delegated to the
     * wrapped input source object.
     *
@@ -108,8 +109,6 @@
 
 
   /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * Get the system identifier for this input source. Delegated to the
     * wrapped input source object.
     *
@@ -121,22 +120,18 @@
     const XMLCh* getSystemId() const;
 
    /**
-     * Get the base URI to be used for resolving relative URIs to absolute
-     * URIs. If the baseURI is itself a relative URI, the behavior is
-     * implementation dependent. Delegated to the wrapped intput source
-     * object.
-     *
-     * <p><b>"Experimental - subject to change"</b></p>
-     *
-     * @return The base URI.
-     * @see #setBaseURI
-     * @since DOM Level 3
-     */
+    * Get the base URI to be used for resolving relative URIs to absolute
+    * URIs. If the baseURI is itself a relative URI, the behavior is
+    * implementation dependent. Delegated to the wrapped intput source
+    * object.
+    *
+    * @return The base URI.
+    * @see #setBaseURI
+    * @since DOM Level 3
+    */
     const XMLCh* getBaseURI() const;
 
- /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
+   /**
     * Get the flag that indicates if the parser should issue fatal error if this input source
     * is not found. Delegated to the wrapped input source object.
     *
@@ -154,8 +149,6 @@
     //@{
 
   /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * Set the encoding which will be required for use with the XML text read
     * via a stream opened by this input source. This will update the wrapped
     * input source object.
@@ -171,8 +164,6 @@
 
 
   /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * Set the public identifier for this input source. This will update the
     * wrapped input source object.
     *
@@ -187,8 +178,6 @@
     void setPublicId(const XMLCh* const publicId);
 
   /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * Set the system identifier for this input source. This will update the
     * wrapped input source object.
     *
@@ -211,8 +200,6 @@
     * implementation dependent. This will update the wrapped input source
     * object.
     *
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * @param baseURI The base URI.
     * @see #getBaseURI
     * @since DOM Level 3
@@ -220,8 +207,6 @@
     void setBaseURI(const XMLCh* const baseURI);
 
   /**
-    * <p><b>"Experimental - subject to change"</b></p>
-    *
     * Indicates if the parser should issue fatal error if this input source
     * is not found.  If set to false, the parser issue warning message
     * instead. This will update the wrapped input source object.
@@ -233,7 +218,7 @@
     *
     * @see #getIssueFatalErrorIfNotFound
     */
-    void setIssueFatalErrorIfNotFound(const bool flag);
+    void setIssueFatalErrorIfNotFound(bool flag);
 
    /**
     * Called to indicate that this DOMInputSource is no longer in use
@@ -267,6 +252,11 @@
 inline const XMLCh* Wrapper4InputSource::getBaseURI() const
 {
     return 0; // REVISIT - should we return an empty string?
+}
+
+inline const XMLCh* Wrapper4InputSource::getCharacterStream() const
+{
+    return 0;
 }
 
 // ---------------------------------------------------------------------------

Modified: xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.cpp Fri Mar 31 06:52:46 2006
@@ -156,9 +156,9 @@
 // ---------------------------------------------------------------------------
 //  DOMLSParserImpl: Setter methods
 // ---------------------------------------------------------------------------
-void DOMLSParserImpl::setFilter(DOMLSParserFilter* const)
+void DOMLSParserImpl::setFilter(DOMLSParserFilter* const filter)
 {
-    throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0, getMemoryManager());
+    fFilter = filter;
 }
 
 // ---------------------------------------------------------------------------
@@ -690,13 +690,13 @@
 // ---------------------------------------------------------------------------
 //  DOMLSParserImpl: Parsing methods
 // ---------------------------------------------------------------------------
-DOMDocument* DOMLSParserImpl::parse(const DOMLSInput& source)
+DOMDocument* DOMLSParserImpl::parse(const DOMLSInput* source)
 {
     // remove the abort filter, if present
     if(fFilter==&g_AbortFilter)
         fFilter=0;
 
-    Wrapper4DOMLSInput isWrapper((DOMLSInput*) &source, false, getMemoryManager());
+    Wrapper4DOMLSInput isWrapper((DOMLSInput*)source, fEntityResolver, false, getMemoryManager());
 
     AbstractDOMParser::parse(isWrapper);
     if (fUserAdoptsDocument)
@@ -731,7 +731,7 @@
         return getDocument();
 }
 
-void DOMLSParserImpl::parseWithContext(const DOMLSInput&,
+void DOMLSParserImpl::parseWithContext(const DOMLSInput*,
                                       DOMNode* ,
                                       const unsigned short)
 {
@@ -805,7 +805,7 @@
                                                           resourceIdentifier->getSystemId(), 
                                                           resourceIdentifier->getBaseURI());
         if (is)
-            return new (getMemoryManager()) Wrapper4DOMLSInput(is, true, getMemoryManager());    
+            return new (getMemoryManager()) Wrapper4DOMLSInput(is, fEntityResolver, true, getMemoryManager());    
     }
     if (fXMLEntityResolver) {
         return(fXMLEntityResolver->resolveEntity(resourceIdentifier));    
@@ -887,7 +887,7 @@
     return grammar;
 }
 
-Grammar* DOMLSParserImpl::loadGrammar(const DOMLSInput& source,
+Grammar* DOMLSParserImpl::loadGrammar(const DOMLSInput* source,
                                      const short grammarType,
                                      const bool toCache)
 {
@@ -901,7 +901,7 @@
 
     try
     {
-        Wrapper4DOMLSInput isWrapper((DOMLSInput*) &source, false, getMemoryManager());
+        Wrapper4DOMLSInput isWrapper((DOMLSInput*)source, fEntityResolver, false, getMemoryManager());
 
         setParseInProgress(true);
         if (grammarType == Grammar::DTDGrammarType) 

Modified: xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/DOMLSParserImpl.hpp Fri Mar 31 06:52:46 2006
@@ -140,7 +140,7 @@
     /**
       * @see DOMLSParser#parse
       */
-    virtual DOMDocument* parse(const DOMLSInput& source);
+    virtual DOMDocument* parse(const DOMLSInput* source);
 
     /**
       * @see DOMLSParser#parseURI
@@ -157,7 +157,7 @@
       */
     virtual void parseWithContext
     (
-        const   DOMLSInput&     source
+        const   DOMLSInput*     source
         ,       DOMNode*        contextNode
         , const unsigned short  action
     );
@@ -231,7 +231,7 @@
       *
       * @see DOMLSInput#DOMLSInput
       */
-    virtual Grammar* loadGrammar(const DOMLSInput& source,
+    virtual Grammar* loadGrammar(const DOMLSInput* source,
                              const short grammarType,
                              const bool toCache = false);
 

Modified: xerces/c/trunk/tests/src/DOM/Normalizer/Normalizer.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/tests/src/DOM/Normalizer/Normalizer.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/DOM/Normalizer/Normalizer.cpp (original)
+++ xerces/c/trunk/tests/src/DOM/Normalizer/Normalizer.cpp Fri Mar 31 06:52:46 2006
@@ -206,11 +206,16 @@
     XMLString::transcode("LS", tempStr, 99);
     DOMImplementation *impl          = DOMImplementationRegistry::getDOMImplementation(tempStr);
     DOMLSSerializer   *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+    DOMLSOutput       *theOutput     = ((DOMImplementationLS*)impl)->createLSOutput();
     theSerializer->getDomConfig()->setParameter(X("format-pretty-print"), true);
     XMLFormatTarget *myFormTarget;
     myFormTarget = new StdOutFormatTarget();
 
-    theSerializer->write(node,myFormTarget);
+    theOutput->setByteStream(myFormTarget);
+    theSerializer->write(node,theOutput);
+    delete myFormTarget;
+    theSerializer->release();
+    theOutput->release();
 }
 
 int main(int argc, char **argv) {

Modified: xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp (original)
+++ xerces/c/trunk/tests/src/MemHandlerTest/MemoryMonitor.cpp Fri Mar 31 06:52:46 2006
@@ -259,7 +259,7 @@
     DOMLSParserHandler domBuilderHandler;
     domBuilder->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, &domBuilderHandler);
 
-    // Instantiate the SAX2 domBuilder with its memory manager.
+    // Instantiate the SAX2 parser with its memory manager.
     MemoryMonitor *sax2MemMonitor = new MemoryMonitor();
     SAX2XMLReader *sax2parser = XMLReaderFactory::createXMLReader(sax2MemMonitor);
     SAXErrorHandler saxErrorHandler;

Modified: xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp?rev=390436&r1=390435&r2=390436&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp (original)
+++ xerces/c/trunk/tests/src/ThreadTest/ThreadTest.cpp Fri Mar 31 06:52:46 2006
@@ -778,10 +778,14 @@
             XMLString::transcode("LS", tempStr, 99);
             DOMImplementation *impl          = DOMImplementationRegistry::getDOMImplementation(tempStr);
             DOMLSSerializer   *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+            DOMLSOutput       *theOutput     = ((DOMImplementationLS*)impl)->createLSOutput();
             XMLFormatTarget   *myFormTarget  = new StdOutFormatTarget();
+            theOutput->setByteStream(myFormTarget);
             DOMNode           *doc           = fXercesDOMParser->getDocument();
-            theSerializer->write(doc,myFormTarget);
-            delete theSerializer;
+            theSerializer->write(doc,theOutput);
+            delete myFormTarget;
+            theSerializer->release();
+            theOutput->release();
         }
         catch (...)
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org