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/06 17:36:51 UTC

cvs commit: xml-xerces/c/scripts sanityTest.pl

knoaman     02/02/06 08:36:51

  Modified:    c/samples/SAX2Count SAX2Count.cpp
               c/samples/SAX2Print SAX2Print.cpp
               c/scripts sanityTest.pl
  Log:
  Added a new flag '-p' to SAX2 samples to set the 'namespace-prefixes' feature.
  
  Revision  Changes    Path
  1.15      +11 -0     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SAX2Count.cpp	1 Feb 2002 22:38:52 -0000	1.14
  +++ SAX2Count.cpp	6 Feb 2002 16:36:51 -0000	1.15
  @@ -56,6 +56,9 @@
   
   /*
   * $Log: SAX2Count.cpp,v $
  +* Revision 1.15  2002/02/06 16:36:51  knoaman
  +* Added a new flag '-p' to SAX2 samples to set the 'namespace-prefixes' feature.
  +*
   * Revision 1.14  2002/02/01 22:38:52  peiyongz
   * sane_include
   *
  @@ -127,6 +130,7 @@
               "                Default to off (Input file is an XML file).\n"
               "    -v=xxx      Validation scheme [always | never | auto*].\n"
               "    -f          Enable full schema constraint checking processing. Defaults to off.\n"
  +            "    -p          Enable namespace-prefixes feature. Defaults to off.\n"
               "    -n          Disable namespace processing. Defaults to on.\n"
               "                NOTE: THIS IS OPPOSITE FROM OTHER SAMPLES.\n"
               "    -s          Disable schema processing. Defaults to on.\n"
  @@ -170,6 +174,7 @@
       bool                         schemaFullChecking = false;
       bool                         doList = false;
       bool                         errorOccurred = false;
  +    bool                         namespacePrefixes = false;
   
       int argInd;
       for (argInd = 1; argInd < argC; argInd++)
  @@ -223,6 +228,11 @@
           {
               doList = true;
           }
  +         else if (!strcmp(argV[argInd], "-p")
  +              ||  !strcmp(argV[argInd], "-P"))
  +        {
  +            namespacePrefixes = true;
  +        }
           else
           {
               cerr << "Unknown option '" << argV[argInd]
  @@ -249,6 +259,7 @@
       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);
   
       if (valScheme == SAX2XMLReader::Val_Auto)
       {
  
  
  
  1.8       +11 -1     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SAX2Print.cpp	1 Feb 2002 22:40:44 -0000	1.7
  +++ SAX2Print.cpp	6 Feb 2002 16:36:51 -0000	1.8
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: SAX2Print.cpp,v $
  + * Revision 1.8  2002/02/06 16:36:51  knoaman
  + * Added a new flag '-p' to SAX2 samples to set the 'namespace-prefixes' feature.
  + *
    * Revision 1.7  2002/02/01 22:40:44  peiyongz
    * sane_include
    *
  @@ -117,7 +120,7 @@
   static bool					        expandNamespaces= false ;
   static bool                     doSchema        = true;
   static bool                     schemaFullChecking = false;
  -
  +static bool                     namespacePrefixes = false;
   
   
   // ---------------------------------------------------------------------------
  @@ -136,6 +139,7 @@
                "    -e          Expand Namespace Alias with URI's.\n"
                "    -x=XXX      Use a particular encoding for output (LATIN1*).\n"
                "    -f          Enable full schema constraint checking processing. Defaults to off.\n"
  +             "    -p          Enable namespace-prefixes feature. Defaults to off.\n"
                "    -s          Disable schema processing. Defaults to on.\n"
                "                NOTE: THIS IS OPPOSITE FROM OTHER SAMPLES.\n"
                "    -?          Show this help.\n\n"
  @@ -245,6 +249,11 @@
           {
               schemaFullChecking = true;
           }
  +         else if (!strcmp(argV[parmInd], "-p")
  +              ||  !strcmp(argV[parmInd], "-P"))
  +        {
  +            namespacePrefixes = true;
  +        }
            else
           {
               cerr << "Unknown option '" << argV[parmInd]
  @@ -293,6 +302,7 @@
   
       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);
   
       //
       //  Create the handler object and install it as the document and error
  
  
  
  1.11      +3 -3      xml-xerces/c/scripts/sanityTest.pl
  
  Index: sanityTest.pl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/scripts/sanityTest.pl,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- sanityTest.pl	5 Feb 2002 13:38:54 -0000	1.10
  +++ sanityTest.pl	6 Feb 2002 16:36:51 -0000	1.11
  @@ -56,7 +56,7 @@
   #
   
   #
  -# $Id: sanityTest.pl,v 1.10 2002/02/05 13:38:54 tng Exp $
  +# $Id: sanityTest.pl,v 1.11 2002/02/06 16:36:51 knoaman Exp $
   #
   
   
  @@ -101,13 +101,13 @@
   system ("SAX2Count");
   system ("SAX2Count -v=never personal.xml");
   system ("SAX2Count personal.xml");
  -system ("SAX2Count personal-schema.xml");
  +system ("SAX2Count -p personal-schema.xml");
   
   #  Run SAX2Print
   system ("SAX2Print");
   system ("SAX2Print -v=never personal.xml");
   system ("SAX2Print personal.xml");
  -system ("SAX2Print personal-schema.xml");
  +system ("SAX2Print -p personal-schema.xml");
   
   #  Run MemParse
   system ("MemParse");
  
  
  

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