You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sc...@apache.org on 2017/07/11 00:18:21 UTC

svn commit: r1801549 - in /xerces/c/trunk: samples/expected/DOMPrint.log samples/src/DOMPrint/DOMPrint.cpp scripts/sanityTest_ExpectedResult.log

Author: scantor
Date: Tue Jul 11 00:18:21 2017
New Revision: 1801549

URL: http://svn.apache.org/viewvc?rev=1801549&view=rev
Log:
Add DOMCount option to suppress XML decl.

Modified:
    xerces/c/trunk/samples/expected/DOMPrint.log
    xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp
    xerces/c/trunk/scripts/sanityTest_ExpectedResult.log

Modified: xerces/c/trunk/samples/expected/DOMPrint.log
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/expected/DOMPrint.log?rev=1801549&r1=1801548&r2=1801549&view=diff
==============================================================================
--- xerces/c/trunk/samples/expected/DOMPrint.log (original)
+++ xerces/c/trunk/samples/expected/DOMPrint.log Tue Jul 11 00:18:21 2017
@@ -18,6 +18,7 @@ Options:
     -wddc=xxx   Enable/Disable discard-default-content.   Default on
     -wflt=xxx   Enable/Disable filtering.                 Default off
     -wfpp=xxx   Enable/Disable format-pretty-print.       Default off
+    -wfdecl=xxx Enable/Disable xml-declaration.           Default on
     -wbom=xxx   Enable/Disable write Byte-Order-Mark      Default off
     -xpath=xxx  Prints only the nodes matching the given XPath.
     -?          Show this help.

Modified: xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp?rev=1801549&r1=1801548&r2=1801549&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp (original)
+++ xerces/c/trunk/samples/src/DOMPrint/DOMPrint.cpp Tue Jul 11 00:18:21 2017
@@ -136,6 +136,7 @@ static bool                     gSplitCd
 static bool                     gDiscardDefaultContent = true;
 static bool                     gUseFilter             = false;
 static bool                     gFormatPrettyPrint     = false;
+static bool                     gXMLDeclaration        = true;
 static bool                     gWriteBOM              = false;
 
 static XercesDOMParser::ValSchemes    gValScheme       = XercesDOMParser::Val_Auto;
@@ -170,6 +171,7 @@ void usage()
             "    -wddc=xxx   Enable/Disable discard-default-content.   Default on\n"
             "    -wflt=xxx   Enable/Disable filtering.                 Default off\n"
             "    -wfpp=xxx   Enable/Disable format-pretty-print.       Default off\n"
+            "    -wfdecl=xxx Enable/Disable xml-declaration.           Default on\n"
             "    -wbom=xxx   Enable/Disable write Byte-Order-Mark      Default off\n"
             "    -xpath=xxx  Prints only the nodes matching the given XPath.\n"
             "    -?          Show this help.\n\n"
@@ -334,6 +336,21 @@ int main(int argC, char* argV[])
                 return 2;
             }
         }
+         else if (!strncmp(argV[parmInd], "-wfdecl=", 8))
+        {
+             const char* const parm = &argV[parmInd][8];
+
+             if (!strcmp(parm, "on"))
+                 gXMLDeclaration = true;
+             else if (!strcmp(parm, "off"))
+                 gXMLDeclaration = false;
+             else
+             {
+                 XERCES_STD_QUALIFIER cerr << "Unknown -wfdecl= value: " << parm << XERCES_STD_QUALIFIER endl;
+                 XMLPlatformUtils::Terminate();
+                 return 2;
+             }
+        }
          else if (!strncmp(argV[parmInd], "-wbom=", 6))
         {
             const char* const parm = &argV[parmInd][6];
@@ -479,6 +496,9 @@ int main(int argC, char* argV[])
 
             if (serializerConfig->canSetParameter(XMLUni::fgDOMWRTBOM, gWriteBOM))
                 serializerConfig->setParameter(XMLUni::fgDOMWRTBOM, gWriteBOM);
+            
+            if (serializerConfig->canSetParameter(XMLUni::fgDOMXMLDeclaration, gXMLDeclaration))
+                serializerConfig->setParameter(XMLUni::fgDOMXMLDeclaration, gXMLDeclaration);
 
             //
             // Plug in a format target to receive the resultant

Modified: xerces/c/trunk/scripts/sanityTest_ExpectedResult.log
URL: http://svn.apache.org/viewvc/xerces/c/trunk/scripts/sanityTest_ExpectedResult.log?rev=1801549&r1=1801548&r2=1801549&view=diff
==============================================================================
--- xerces/c/trunk/scripts/sanityTest_ExpectedResult.log (original)
+++ xerces/c/trunk/scripts/sanityTest_ExpectedResult.log Tue Jul 11 00:18:21 2017
@@ -650,6 +650,7 @@ Options:
     -wddc=xxx   Enable/Disable discard-default-content.   Default on
     -wflt=xxx   Enable/Disable filtering.                 Default off
     -wfpp=xxx   Enable/Disable format-pretty-print.       Default off
+    -wfdecl=xxx Enable/Disable xml-declaration.           Default on
     -wbom=xxx   Enable/Disable write Byte-Order-Mark      Default off
     -xpath=xxx  Prints only the nodes matching the given XPath.
     -?          Show this help.



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