auriemma    00/09/22 10:54:48

  Modified:    c/samples/XPathWrapper TestDriver.cpp TestDriver.dsp
                        XPathWrapper.cpp XPathWrapper.hpp
  Log:
  Resolve issues for AIX and removed depencency on <string>.
  
  Revision  Changes    Path
  1.4       +14 -7     xml-xalan/c/samples/XPathWrapper/TestDriver.cpp
  
  Index: TestDriver.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/XPathWrapper/TestDriver.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestDriver.cpp    2000/08/29 17:03:05     1.3
  +++ TestDriver.cpp    2000/09/22 17:54:38     1.4
  @@ -2,6 +2,10 @@
   
   
   
  +#include <PlatformSupport/DOMStringHelper.hpp>
  +
  +
  +
   #include <iostream>
   #include <fstream>
   
  @@ -21,25 +25,24 @@
        using std::cout;
        using std::endl;
        using std::ifstream;
  -     using std::string;
        using std::vector;
   #endif
   
        if (argc < 4)
        {
                cerr << "Usage: TestDriver XMLFilePath Context XPathExpression" 
<< endl;
  -
                return -1;
        }
   
  -     string          theXML;
  +     CharVectorType          theXML;
   
        ifstream        in(argv[1]);
   
        // slow and dirty dump of the xml file into a buffer
        char c;
        while(in.get(c))
  -             theXML += c;
  +             theXML.push_back(c);
  +     theXML.push_back('\0');
   
        ///////////////////////////////////////////..
   
  @@ -48,16 +51,20 @@
   
        try
        {
  +             CharVectorType xmlContext, xmlPath;
  +             CopyStringToVector(argv[2], xmlContext);
  +             CopyStringToVector(argv[3], xmlPath);
  +
                // call evaluate, passing in the XML string, the context string 
and the xpath string
  -             const vector<string>    result = helper.evaluate(theXML, 
argv[2], argv[3]);
  +             const XPathWrapper::CharVectorTypeVectorType    result = 
helper.evaluate(theXML, xmlContext, xmlPath);
   
                // take the resulting string vector     and do whatever you 
want with it:
                size_t len = result.size();
   
  -             cout<< "the result set has " << len << " strings\n";
  +             cout << "the result set has " << len << " strings\n";
   
                for (size_t i=0; i<len; i++)
  -                     cout<< "item " << (i+1) << "= \"" << result[i] << "\"" 
<< endl;
  +                     cout << "item " << (i+1) << "= \"" << result[i] << "\"" 
<< endl;
        }
        catch(const XMLException&)
        {
  
  
  
  1.4       +2 -2      xml-xalan/c/samples/XPathWrapper/TestDriver.dsp
  
  Index: TestDriver.dsp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/XPathWrapper/TestDriver.dsp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestDriver.dsp    2000/06/05 18:43:09     1.3
  +++ TestDriver.dsp    2000/09/22 17:54:38     1.4
  @@ -50,7 +50,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
  -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
odbccp32.lib /nologo /subsystem:console /machine:I386
  +# ADD LINK32 ..\..\Build\Win32\VC6\Release\PlatformSupport.lib  kernel32.lib 
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib 
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib 
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib 
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console 
/machine:I386
   
   !ELSEIF  "$(CFG)" == "TestDriver - Win32 Debug"
   
  @@ -74,7 +74,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 
/pdbtype:sept
  -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
  +# ADD LINK32 ..\..\Build\Win32\VC6\Debug\PlatformSupport.lib /nologo 
/subsystem:console /debug /machine:I386 /pdbtype:sept
   
   !ENDIF 
   
  
  
  
  1.8       +17 -18    xml-xalan/c/samples/XPathWrapper/XPathWrapper.cpp
  
  Index: XPathWrapper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/XPathWrapper/XPathWrapper.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XPathWrapper.cpp  2000/08/31 19:33:15     1.7
  +++ XPathWrapper.cpp  2000/09/22 17:54:39     1.8
  @@ -2,7 +2,6 @@
   
   
   
  -#include <string>
   #include <vector>
   #include <cassert>
   #include <iostream>
  @@ -50,7 +49,6 @@
   #if !defined(XALAN_NO_NAMESPACES)
   using std::cerr;
   using std::endl;
  -using std::string;
   using std::vector;
   #endif
   
  @@ -63,11 +61,11 @@
   {
   public:
   
  -     vector<string>
  +     XPathWrapper::CharVectorTypeVectorType
        evaluate(
  -             const string&   xml, 
  -             const string&   context, 
  -             const string&   expr)
  +             const CharVectorType&   xml, 
  +             const CharVectorType&   context, 
  +             const CharVectorType&   expr)
        {
                //initialize Xerces...
                try
  @@ -81,7 +79,7 @@
                        throw;
                }
   
  -             vector<string>  theResultList;
  +             XPathWrapper::CharVectorTypeVectorType  theResultList;
   
                {
                        // Initialize the XPath subsystem...
  @@ -96,8 +94,7 @@
                        try
                        {
                                // parse XML and get root element
  -                             MemBufInputSource inStream((const 
XMLByte*)xml.c_str(), 
  -                                     xml.length(), "foo", false);
  +                             MemBufInputSource 
inStream((XMLByte*)c_str(xml), xml.size(), "foo", false);
   
                                XalanDocument* const    doc = 
theLiaison.parseXMLStream(inStream);
                                assert(doc != 0);
  @@ -125,7 +122,7 @@
                                // first get the context nodeset
                                XPath* const    contextXPath = 
theXPathFactory.create();
                                theXPathProcessor.initXPath(*contextXPath,
  -                                                                             
        XalanDOMString(context.c_str()),
  +                                                                             
        c_str(context),
                                                                                
        ElementPrefixResolverProxy(rootElem, theEnvSupport, theSupport),
                                                                                
        theEnvSupport);
   
  @@ -165,7 +162,7 @@
                                        // and now get the result of the 
primary xpath expression
                                        XPath* const    xpath = 
theXPathFactory.create();
                                        theXPathProcessor.initXPath(*xpath,
  -                                                                             
                XalanDOMString(expr.c_str()),
  +                                                                             
                c_str(expr),
                                                                                
                ElementPrefixResolverProxy(rootElem, theEnvSupport, theSupport),
                                                                                
                theEnvSupport);
   
  @@ -197,7 +194,7 @@
                                                                else
                                                                        str = 
theSupport.getNodeData(*node);
   
  -                                                             
theResultList.push_back(DOMStringToStdString(str));
  +                                                             
theResultList.push_back(TranscodeToLocalCodePage(str));
                                                        }
   
                                                        break;
  @@ -205,7 +202,7 @@
   
                                                default:
                                                {
  -                                                     
theResultList.push_back(DOMStringToStdString(xObj->str()));
  +                                                     
theResultList.push_back(TranscodeToLocalCodePage(xObj->str()));
   
                                                        break;
                                                }
  @@ -246,11 +243,13 @@
   
   
   
  -vector<string>
  +XPathWrapper::CharVectorTypeVectorType
   XPathWrapper::evaluate(
  -     const string&   xml, 
  -     const string&   context, 
  -     const string&   path)
  +             const CharVectorType&   xml, 
  +             const CharVectorType&   context, 
  +             const CharVectorType&   path)
   {
  -     return pImpl->evaluate(xml,context,path);
  +     return pImpl->evaluate(xml, context, path);
   }
  +
  +
  
  
  
  1.5       +24 -15    xml-xalan/c/samples/XPathWrapper/XPathWrapper.hpp
  
  Index: XPathWrapper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/XPathWrapper/XPathWrapper.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XPathWrapper.hpp  2000/08/29 17:03:05     1.4
  +++ XPathWrapper.hpp  2000/09/22 17:54:39     1.5
  @@ -63,11 +63,24 @@
   
   
   
  -#include <string>
  +#include <PlatformSupport/DOMStringHelper.hpp>
  +
  +
  +
  +#include <XalanDOM/XalanDOMString.hpp>
  +
  +
  +
   #include <vector>
   
   
   
  +#if defined(XALAN_NEEDS_EXPLICIT_TEMPLATE_INSTANTIATION)
  +#include <stl/_vector.c>
  +#endif
  +
  +
  +
   #if defined(WIN32)
   #if defined(_XPathWrapper)
   #define XALAN_XPATHWRAPPER_EXPORT XALAN_PLATFORM_EXPORT
  @@ -89,6 +102,12 @@
   
   public:
   
  +#if defined(XALAN_NO_NAMESPACES)
  +     typedef vector<CharVectorType> CharVectorTypeVectorType;        
  +#else
  +     typedef std::vector<CharVectorType> CharVectorTypeVectorType;   
  +#endif       
  +
        XPathWrapper();
   
        virtual
  @@ -97,20 +116,11 @@
        // Given an xml document and an xpath context and expression in the 
form of (ascii) string objects,
        // this function parses the XML document, evaluates the xpath and 
returns the result, as a list of 
        // string objects
  -
  -#if defined(XALAN_NO_NAMESPACES)
  -     vector<string>
  +     CharVectorTypeVectorType
        evaluate(
  -             const string&   xml, 
  -             const string&   context, 
  -             const string&   path);
  -#else
  -     std::vector<std::string>
  -     evaluate(
  -             const std::string&      xml, 
  -             const std::string&      context, 
  -             const std::string&      path);
  -#endif
  +             const CharVectorType&   xml, 
  +             const CharVectorType&   context, 
  +             const CharVectorType&   path);
   
   private:
   
  @@ -122,7 +132,6 @@
   
        bool
        operator==(const XPathWrapper&) const;
  -
   
        XPathWrapperImpl* const         pImpl;
   };
  
  
  

Reply via email to