Author: scantor
Date: Wed Jun 28 13:45:57 2017
New Revision: 1800169

URL: http://svn.apache.org/viewvc?rev=1800169&view=rev
Log:
Add disallow-doctype option to DOMCount.

Modified:
    xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp

Modified: xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp?rev=1800169&r1=1800168&r2=1800169&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp (original)
+++ xerces/c/trunk/samples/src/DOMCount/DOMCount.cpp Wed Jun 28 13:45:57 2017
@@ -64,6 +64,7 @@ static void usage()
             "    -n          Enable namespace processing. Defaults to off.\n"
             "    -s          Enable schema processing. Defaults to off.\n"
             "    -f          Enable full schema constraint checking. Defaults 
to off.\n"
+            "    -d          Disallow DOCTYPE. Defaults to false.\n"
             "    -locale=ll_CC specify the locale, default: en_US.\n"
             "    -p          Print out names of elements and attributes 
encountered.\n"
                    "    -?          Show this help.\n\n"
@@ -142,6 +143,7 @@ int main(int argC, char* argV[])
     bool                       doNamespaces       = false;
     bool                       doSchema           = false;
     bool                       schemaFullChecking = false;
+    bool                       disallowDoctype    = false;
     bool                       doList = false;
     bool                       errorOccurred = false;
     bool                       recognizeNEL = false;
@@ -199,6 +201,11 @@ int main(int argC, char* argV[])
         {
             doList = true;
         }
+         else if (!strcmp(argV[argInd], "-d")
+              ||  !strcmp(argV[argInd], "-D"))
+        {
+            disallowDoctype = true;
+        }
          else if (!strcmp(argV[argInd], "-special:nel"))
         {
             // turning this on will lead to non-standard compliance behaviour
@@ -270,6 +277,7 @@ int main(int argC, char* argV[])
     config->setParameter(XMLUni::fgXercesSchema, doSchema);
     config->setParameter(XMLUni::fgXercesHandleMultipleImports, true);
     config->setParameter(XMLUni::fgXercesSchemaFullChecking, 
schemaFullChecking);
+    config->setParameter(XMLUni::fgDOMDisallowDoctype, disallowDoctype);
 
     if (valScheme == AbstractDOMParser::Val_Auto)
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to