From 11d95d32907a29898e6a1ba624af4b54ad306cd2 Mon Sep 17 00:00:00 2001
From: Khaled Noaman <knoaman@apache.org>
Date: Wed, 13 Feb 2002 16:11:06 +0000
Subject: [PATCH] Update samples to use SAX2 features/properties constants from
 XMLUni.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@173494 13f79535-47bb-0310-9956-ffa450edef68
---
 samples/SAX2Count/SAX2Count.cpp | 21 ++++++++++++---------
 samples/SAX2Print/SAX2Print.cpp | 19 +++++++++++--------
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/samples/SAX2Count/SAX2Count.cpp b/samples/SAX2Count/SAX2Count.cpp
index b745b9eaa..d1a2f130e 100644
--- a/samples/SAX2Count/SAX2Count.cpp
+++ b/samples/SAX2Count/SAX2Count.cpp
@@ -56,6 +56,9 @@
 
 /*
 * $Log$
+* Revision 1.16  2002/02/13 16:11:06  knoaman
+* Update samples to use SAX2 features/properties constants from XMLUni.
+*
 * Revision 1.15  2002/02/06 16:36:51  knoaman
 * Added a new flag '-p' to SAX2 samples to set the 'namespace-prefixes' feature.
 *
@@ -256,24 +259,24 @@ int main(int argC, char* argV[])
     //  the command line, set it to validate or not.
     //
     SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();
-    parser->setFeature(XMLString::transcode("http://xml.org/sax/features/namespaces"), doNamespaces);
-    parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/schema"), doSchema);
-    parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/schema-full-checking"), schemaFullChecking);
-    parser->setFeature(XMLString::transcode("http://xml.org/sax/features/namespace-prefixes"), namespacePrefixes);
+    parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, doNamespaces);
+    parser->setFeature(XMLUni::fgSAX2XercesSchema, doSchema);
+    parser->setFeature(XMLUni::fgSAX2XercesSchemaFullChecking, schemaFullChecking);
+    parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, namespacePrefixes);
 
     if (valScheme == SAX2XMLReader::Val_Auto)
     {
-        parser->setFeature(XMLString::transcode("http://xml.org/sax/features/validation"), true);
-        parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/dynamic"), true);
+        parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
+        parser->setFeature(XMLUni::fgSAX2XercesDynamic, true);
     }
     if (valScheme == SAX2XMLReader::Val_Never)
     {
-        parser->setFeature(XMLString::transcode("http://xml.org/sax/features/validation"), false);
+        parser->setFeature(XMLUni::fgSAX2CoreValidation, false);
     }
     if (valScheme == SAX2XMLReader::Val_Always)
     {
-        parser->setFeature(XMLString::transcode("http://xml.org/sax/features/validation"), true);
-        parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/dynamic"), false);
+        parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
+        parser->setFeature(XMLUni::fgSAX2XercesDynamic, false);
     }
 
     //
diff --git a/samples/SAX2Print/SAX2Print.cpp b/samples/SAX2Print/SAX2Print.cpp
index d42ed97aa..91700e9f6 100644
--- a/samples/SAX2Print/SAX2Print.cpp
+++ b/samples/SAX2Print/SAX2Print.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.9  2002/02/13 16:11:06  knoaman
+ * Update samples to use SAX2 features/properties constants from XMLUni.
+ *
  * Revision 1.8  2002/02/06 16:36:51  knoaman
  * Added a new flag '-p' to SAX2 samples to set the 'namespace-prefixes' feature.
  *
@@ -285,24 +288,24 @@ int main(int argC, char* argV[])
     //
     if (valScheme == SAX2XMLReader::Val_Auto)
     {
-        parser->setFeature(XMLString::transcode("http://xml.org/sax/features/validation"), true);
-        parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/dynamic"), true);
+        parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
+        parser->setFeature(XMLUni::fgSAX2XercesDynamic, true);
     }
 
     if (valScheme == SAX2XMLReader::Val_Never)
     {
-        parser->setFeature(XMLString::transcode("http://xml.org/sax/features/validation"), false);
+        parser->setFeature(XMLUni::fgSAX2CoreValidation, false);
     }
 
     if (valScheme == SAX2XMLReader::Val_Always)
     {
-        parser->setFeature(XMLString::transcode("http://xml.org/sax/features/validation"), true);
-        parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/dynamic"), false);
+        parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
+        parser->setFeature(XMLUni::fgSAX2XercesDynamic, false);
     }
 
-    parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/schema"), doSchema);
-    parser->setFeature(XMLString::transcode("http://apache.org/xml/features/validation/schema-full-checking"), schemaFullChecking);
-    parser->setFeature(XMLString::transcode("http://xml.org/sax/features/namespace-prefixes"), namespacePrefixes);
+    parser->setFeature(XMLUni::fgSAX2XercesSchema, doSchema);
+    parser->setFeature(XMLUni::fgSAX2XercesSchemaFullChecking, schemaFullChecking);
+    parser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, namespacePrefixes);
 
     //
     //  Create the handler object and install it as the document and error
-- 
GitLab