You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2002/02/13 17:11:06 UTC

cvs commit: xml-xerces/c/samples/SAX2Print SAX2Print.cpp

knoaman     02/02/13 08:11:06

  Modified:    c/samples/SAX2Count SAX2Count.cpp
               c/samples/SAX2Print SAX2Print.cpp
  Log:
  Update samples to use SAX2 features/properties constants from XMLUni.
  
  Revision  Changes    Path
  1.16      +12 -9     xml-xerces/c/samples/SAX2Count/SAX2Count.cpp
  
  Index: SAX2Count.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAX2Count/SAX2Count.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SAX2Count.cpp	6 Feb 2002 16:36:51 -0000	1.15
  +++ SAX2Count.cpp	13 Feb 2002 16:11:06 -0000	1.16
  @@ -56,6 +56,9 @@
   
   /*
   * $Log: SAX2Count.cpp,v $
  +* 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 @@
       //  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);
       }
   
       //
  
  
  
  1.9       +11 -8     xml-xerces/c/samples/SAX2Print/SAX2Print.cpp
  
  Index: SAX2Print.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAX2Print/SAX2Print.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SAX2Print.cpp	6 Feb 2002 16:36:51 -0000	1.8
  +++ SAX2Print.cpp	13 Feb 2002 16:11:06 -0000	1.9
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: SAX2Print.cpp,v $
  + * 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 @@
       //
       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
  
  
  

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