dbertoni    01/06/06 15:29:42

  Modified:    c/samples/UseStylesheetParam UseStylesheetParam.cpp
  Log:
  Simplified sample.
  
  Revision  Changes    Path
  1.12      +15 -24    
xml-xalan/c/samples/UseStylesheetParam/UseStylesheetParam.cpp
  
  Index: UseStylesheetParam.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/samples/UseStylesheetParam/UseStylesheetParam.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- UseStylesheetParam.cpp    2001/04/19 18:46:26     1.11
  +++ UseStylesheetParam.cpp    2001/06/06 22:29:41     1.12
  @@ -37,33 +37,24 @@
                // Initialize Xalan.
                XalanTransformer::initialize();
   
  -             // Create a XalanTransformer.
  -             XalanTransformer theXalanTransformer;
  -
  -             // Our input files...The assumption is that the executable will 
be run
  -             // from same directory as the input files.
  -             const char*             theXMLFileName = "foo.xml";
  -             const char*             theXSLFileName = "foo.xsl";
  -
  -             // Our output target...
  -             const char*     theOutputFileName = "foo.out";
  -
  -             // Get the stylesheet parameter key (name) and
  -             // expression (a string expression).
  -             const char*     paramKey = argv[1];
  -             const char*     paramExpression = argv[2];
  +             {
  +                     // Create a XalanTransformer.
  +                     XalanTransformer        theXalanTransformer;
   
  -             // Set the stylesheet parameter.
  -             theXalanTransformer.setStylesheetParam(paramKey, 
paramExpression);
  +                     // Set the stylesheet parameter name and
  +                     // expression (a string expression).
  +                     theXalanTransformer.setStylesheetParam(argv[1], 
argv[2]);
   
  -             // Do the transform.
  -             theResult = theXalanTransformer.transform(theXMLFileName, 
theXSLFileName, theOutputFileName);
  +                     // Our input files...The assumption is that the 
executable will be run
  +                     // from same directory as the input files.
  +                     theResult = theXalanTransformer.transform("foo.xml", 
"foo.xsl", "foo.out");
       
  -             if(theResult != 0)
  -             {
  -                     cerr << "UseStylesheetParam Error: \n" << 
theXalanTransformer.getLastError()
  -                              << endl
  -                              << endl;
  +                     if(theResult != 0)
  +                     {
  +                             cerr << "UseStylesheetParam Error: \n" << 
theXalanTransformer.getLastError()
  +                                      << endl
  +                                      << endl;
  +                     }
                }
   
                // Terminate Xalan.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to