dbertoni    00/02/17 12:27:42

  Modified:    c/src/TestXPath TestXPath.cpp
  Log:
  Changes for Linux build, and to match latest Xerces DOM signatures.
  
  Revision  Changes    Path
  1.5       +28 -11    xml-xalan/c/src/TestXPath/TestXPath.cpp
  
  Index: TestXPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/TestXPath/TestXPath.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestXPath.cpp     2000/01/26 20:30:23     1.4
  +++ TestXPath.cpp     2000/02/17 20:27:41     1.5
  @@ -69,6 +69,7 @@
   
   
   
  +#include <Include/DOMHelper.hpp>
   #include <PlatformSupport/DirectoryEnumerator.hpp>
   #include <PlatformSupport/DOMStringHelper.hpp>
   #include <DOMSupport/DOMSupportDefault.hpp>
  @@ -311,7 +312,17 @@
   }
   
   
  +template<class Source, class Target>
  +const Target&
  +XalanStaticCast(
  +     const Source&   theSource,
  +     const Target&   /* theTarget */)
  +{
  +     return static_cast<const Target&>(theSource);
  +}
  +
   
  +
   DOMString
   GetAttributeFromNode(
                        const DOM_Node&         theNode,
  @@ -322,9 +333,15 @@
        if (theNode.getNodeType() == DOM_Node::ELEMENT_NODE)
        {
                const DOM_Element&      theElement =
  -                                     static_cast<const 
DOM_Element&>(theNode);
  +//                                   static_cast<const 
DOM_Element&>(theNode);
  +//                                   
XalanDOMDowncast<DOM_Element>()(theNode);
  +                                     XalanStaticCast(theNode, theElement);
   
                theResult = theElement.getAttribute(theAttributeName);
  +
  +             if (0 == theElement)
  +             {
  +             }
        }
   
        return theResult;
  @@ -423,7 +440,7 @@
                                                                                
                 theXPathFactory.create());
   
        DOM_Element                                     theNamespaceContext;
  -     ElementPrefixResolverProxy      thePrefixResolver(theNamespaceContext, 
theXPathSupport);
  +     ElementPrefixResolverProxy      thePrefixResolver(theNamespaceContext, 
theXPathEnvSupport, theXPathSupport);
        NodeRefList                                     theContextNodeList;
   
        const XObject* const    theXObject =
  @@ -514,7 +531,7 @@
                        if (theContextNode != 0)
                        {
                                DOM_Element                                     
        theNamespaceContext;
  -                             ElementPrefixResolverProxy              
thePrefixResolver(theNamespaceContext, theXPathSupport);
  +                             ElementPrefixResolverProxy              
thePrefixResolver(theNamespaceContext, theXPathEnvSupport, theXPathSupport);
                                NodeRefList                                     
        theContextNodeList;
   
                                FactoryObjectAutoPointer<XPath>         
theXPath(&theXPathFactory,
  @@ -556,13 +573,13 @@
                                        const MutableNodeRefList&       
theResultList =
                                                theResult->mutableNodeset();
   
  -                                     const int       theLength = 
theResultList.getLength();
  +                                     const unsigned int      theLength = 
theResultList.getLength();
   
                                        if (theLength > 0)
                                        {
                                                
thePrintWriter.print(XMLStrL("<out>"));
   
  -                                             for (int i = 0; i < theLength; 
i++)
  +                                             for (unsigned int i = 0; i < 
theLength; i++)
                                                {
                                                        
thePrintWriter.print(theResultList.item(i).getNodeName());
                                                        thePrintWriter.print(L" 
");
  @@ -625,7 +642,7 @@
                        if (theContextNode != 0)
                        {
                                DOM_Element                                     
        theNamespaceContext;
  -                             ElementPrefixResolverProxy              
thePrefixResolver(theNamespaceContext, theXPathSupport);
  +                             ElementPrefixResolverProxy              
thePrefixResolver(theNamespaceContext, theXPathEnvSupport, theXPathSupport);
                                NodeRefList                                     
        theContextNodeList;
   
                                FactoryObjectAutoPointer<XPath>         
theXPath1(&theXPathFactory,
  @@ -690,7 +707,7 @@
                                                const MutableNodeRefList&       
theResultList =
                                                                
theResult1->mutableNodeset();
   
  -                                             const int       theLength = 
theResultList.getLength();
  +                                             const unsigned int      
theLength = theResultList.getLength();
   
                                                
thePrintWriter.print(XMLStrL("theResult1->str() == \""));
                                                
thePrintWriter.print(theResult1->str());
  @@ -699,7 +716,7 @@
   
                                                if (theLength > 0)
                                                {
  -                                                     for (int i = 0; i < 
theLength; i++)
  +                                                     for (unsigned int i = 
0; i < theLength; i++)
                                                        {
                                                                
thePrintWriter.print(theResultList.item(i).getNodeName());
                                                                
thePrintWriter.println();
  @@ -816,7 +833,7 @@
                                                  theXPathSupport,
                                                  theXObjectFactory,
                                                  DOM_Node(),
  -                                               
ElementPrefixResolverProxy(DOM_Element(), theXPathSupport),
  +                                               
ElementPrefixResolverProxy(DOM_Element(), theXPathEnvSupport, theXPathSupport),
                                                  NodeRefList());
        }
   }
  @@ -937,7 +954,7 @@
                                                 theXPathSupport,
                                                 theXObjectFactory,
                                                 DOM_Node(),
  -                                              
ElementPrefixResolverProxy(DOM_Element(), theXPathSupport),
  +                                              
ElementPrefixResolverProxy(DOM_Element(), theXPathEnvSupport, theXPathSupport),
                                                 NodeRefList());
        }
   }
  @@ -1054,7 +1071,7 @@
                                                  theXPathSupport,
                                                  theXObjectFactory,
                                                  DOM_Node(),
  -                                               
ElementPrefixResolverProxy(DOM_Element(), theXPathSupport),
  +                                               
ElementPrefixResolverProxy(DOM_Element(), theXPathEnvSupport, theXPathSupport),
                                                  NodeRefList());
        }
   }
  
  
  

Reply via email to