Migrated from xerces=2.x
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 12 Feb 2018 02:52:13 +0000 (19:52 -0700)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 12 Feb 2018 02:52:13 +0000 (19:52 -0700)
Makefile
src/DIGFile/DIGFile.cpp

index e0b36a68847f74ca2ee554dd81f864c0af0668a9..6d96e10ae93491e936baac8029d3232ddede17a5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,10 +28,11 @@ SRC_CXX    = $(foreach dir,src/snark,$(wildcard src/snark/*.cpp))
 SRC_C      = $(foreach dir,src/snark,$(wildcard src/snark/*.c))
 OBJ_CXX    = $(patsubst src/snark/%.cpp,build/%.o,$(SRC_CXX))
 OBJ_C      = $(patsubst src/snark/%.c,build/%.o,$(SRC_C))
-INCLUDES   = -I./include -I$(XERCES)/include $(addprefix -I,$(DIGFILED),$(DIGFILESD),$(DIGFILERD)) -Iinclude/DIGFile -Iinclude/DIGFileSnark -Iinclude/DIGRand -I/usr/include
+INCLUDES   = -I./include $(addprefix -I,$(DIGFILED),$(DIGFILESD),$(DIGFILERD)) -Iinclude/DIGFile -Iinclude/DIGFileSnark -Iinclude/DIGRand -I/usr/include
 
-LIBPATH   = -L$(PREFIX)/lib -L$(XERCES)/lib
-LIBS      = $(LIBPATH) -lm -lxerces-c -lxerces-depdom -lDIGFile -lDIGFileSnark -lDIGRand
+#LIBPATH   = -L$(PREFIX)/lib -L$(XERCES)/lib
+LIBPATH   = -L$(PREFIX)/lib
+LIBS      = $(LIBPATH) -lm -lxerces-c -lDIGFile -lDIGFileSnark -lDIGRand
 
 SNARK14    = snark14
 INPUT      = snark14Input
@@ -44,7 +45,7 @@ DISPLAY_INC  = $(foreach dir,tools/Display,$(wildcard tools/Display/*.hpp))
 all: $(OBJDIR) $(LIBSDIR) $(BINDIR) $(BINDIR)/$(SNARK14) $(BINDIR)/$(DISPLAY) $(BINDIR)/$(INPUT)
 
 $(BINDIR)/$(SNARK14): $(LDIGFILED) $(LDIGFILESD) $(LDIGFILERD) $(OBJ_C) $(OBJ_CXX)
-       $(LD) $(LIBS) $(LDFLAGS) -o bin/$(SNARK14) $(OBJ_C) $(OBJ_CXX)
+       $(LD) $(LIBPATH) $(LDFLAGS) $(OBJ_C) $(OBJ_CXX) $(LIBS) -o bin/$(SNARK14)
 
 $(BINDIR)/$(DISPLAY): $(DISPLAY_SRC) $(DISPLAY_INC)
        cd tools/Display ; make
index 486a762d3181cab609e4235caeada099788e799d..2531529ccaaf9fcc69b63778c61864389aea3cc5 100644 (file)
@@ -2363,12 +2363,15 @@ int DIGFile::WriteXMLHeader()
   ///DOMPrintFilter   *myFilter = 0;
 
   try {
-               // get a serializer, an instance of DOMWriter
+               // get a serializer, an instance of DOMWriter (kmr Now DOMLSSerializer)
                XMLCh tempStr[100];
                XMLString::transcode("LS", tempStr, 99);
                DOMImplementation *impl          = DOMImplementationRegistry::getDOMImplementation(tempStr);
-               DOMWriter         *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
+               DOMLSSerializer   *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+                DOMConfiguration  *dc            = theSerializer->getDomConfig();
+                DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+                theOutput->setByteStream(mymFormTarget);
+                
                // set user specified end of line sequence and output encoding
                //theSerializer->setNewLine(gMyEOLSequence);
 
@@ -2376,8 +2379,9 @@ int DIGFile::WriteXMLHeader()
 
     static XMLCh* gOutputEncoding = 0;
 
-               theSerializer->setEncoding(gOutputEncoding);
-
+    // kmr theSerializer->setEncoding(gOutputEncoding);
+    theOutput->setEncoding(gOutputEncoding);
+    
                // plug in user's own filter
     /*
                if(gUseFilter) {
@@ -2399,24 +2403,24 @@ int DIGFile::WriteXMLHeader()
 
                // plug in user's own error handler
                DOMErrorHandler* myErrorHandler = new DOMPrintErrorHandler();
-               theSerializer->setErrorHandler(myErrorHandler);
+               dc->setParameter(XMLUni::fgDOMErrorHandler,myErrorHandler);
 
                // set feature if the serializer supports the feature/mode
     
     static bool gSplitCdataSections = true;
 
-               if(theSerializer->canSetFeature(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections))
-                       theSerializer->setFeature(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections);
+               if(dc->canSetParameter(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections))
+                       dc->setParameter(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections);
 
     static bool gDiscardDefaultContent = true;
                
-               if(theSerializer->canSetFeature(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent))
-                       theSerializer->setFeature(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent);
+               if(dc->canSetParameter(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent))
+                        dc->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent);
 
     static bool gFormatPrettyPrint = true;
 
-               if(theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint))
-                       theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint);
+               if(dc->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint))
+                       dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint);
 
     //
                // Plug in a format target to receive the resultant
@@ -2442,8 +2446,9 @@ int DIGFile::WriteXMLHeader()
 
     //((LocalFileFormatTarget*) myfFormTarget)->Target.setEscapeFlags();
 
-               theSerializer->writeNode(mymFormTarget, *Document);
-
+                //kmr          theSerializer->writeNode(mymFormTarget, *Document);
+                theSerializer->write(Document, theOutput);
+                delete theOutput;
                delete theSerializer;
 
     //