You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/08/10 20:30:13 UTC

cvs commit: xml-xalan/c/src/TestXPath TestXPath.cpp

dbertoni    00/08/10 11:30:12

  Modified:    c/src/TestXPath TestXPath.cpp
  Log:
  Updated for XPath interface changes.
  
  Revision  Changes    Path
  1.13      +39 -27    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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestXPath.cpp	2000/07/28 22:00:21	1.12
  +++ TestXPath.cpp	2000/08/10 18:30:11	1.13
  @@ -109,7 +109,6 @@
   	theXPathProcessor.initXPath(theXPath,
   								theXPathString,
   								thePrefixResolver,
  -								theXObjectFactory,
   								theXPathEnvSupport);
   
   	XPathExecutionContextDefault	theExecutionContext(theXPathEnvSupport,
  @@ -421,9 +420,11 @@
   			PrintWriter&			thePrintWriter)
   {
   	XalanNode*							theResult = 0;
  +
  +	XPath* const	theXPath = theXPathFactory.create();
   
  -	XPathGuard	theXPath(theXPathFactory,
  -						 theXPathFactory.create());
  +	XPathGuard	theGuard(theXPathFactory,
  +						 theXPath);
   
   	XalanElement*				theNamespaceContext = 0;
   	ElementPrefixResolverProxy	thePrefixResolver(theNamespaceContext, theXPathEnvSupport, theXPathSupport);
  @@ -431,7 +432,7 @@
   
   	const XObject* const	theXObject =
   		ExecuteXPath(theXPathProcessor,
  -					 *theXPath.get(),
  +					 *theXPath,
   					 theContextNodeMatchPattern,
   					 theXPathEnvSupport,
   					 theXPathSupport,
  @@ -520,14 +521,15 @@
   				XalanElement* const				theNamespaceContext = 0;
   				ElementPrefixResolverProxy		thePrefixResolver(theNamespaceContext, theXPathEnvSupport, theXPathSupport);
   				NodeRefList						theContextNodeList;
  +
  +				XPath* const	theXPath = theXPathFactory.create();
   
  -				XPathGuard	theXPath(theXPathFactory,
  -									 theXPathFactory.create());
  +				XPathGuard		theGuard(theXPathFactory,
  +										 theXPath);
   
  -				theXPathProcessor.initXPath(*theXPath.get(),
  +				theXPathProcessor.initXPath(*theXPath,
   											theXPathString,
   											thePrefixResolver,
  -											theXObjectFactory,
   											theXPathEnvSupport);
   
   				bool	fDump = false;
  @@ -636,22 +638,24 @@
   				ElementPrefixResolverProxy		thePrefixResolver(theNamespaceContext, theXPathEnvSupport, theXPathSupport);
   				NodeRefList						theContextNodeList;
   
  -				XPathGuard	theXPath1(theXPathFactory,
  -									  theXPathFactory.create());
  +				XPath* const	theXPath1 = theXPathFactory.create();
   
  -				theXPathProcessor.initXPath(*theXPath1.get(),
  +				XPathGuard	theGuard1(theXPathFactory,
  +									  theXPath1);
  +
  +				theXPathProcessor.initXPath(*theXPath1,
   											"following-sibling::*",
   											thePrefixResolver,
  -											theXObjectFactory,
   											theXPathEnvSupport);
  +
  +				XPath* const	theXPath2 = theXPathFactory.create();
   
  -				XPathGuard	theXPath2(theXPathFactory,
  -									  theXPathFactory.create());
  +				XPathGuard	theGuard2(theXPathFactory,
  +									  theXPath2);
   
  -				theXPathProcessor.initXPath(*theXPath2.get(),
  +				theXPathProcessor.initXPath(*theXPath2,
   											"descendant::*",
   											thePrefixResolver,
  -											theXObjectFactory,
   											theXPathEnvSupport);
   
   				bool	fDump = false;
  @@ -818,11 +822,13 @@
   
   	for(int i = 0; theNumericTestInput[i] != 0; i++)
   	{
  -		XPathGuard	theXPath(theXPathFactory,
  -							 theXPathFactory.create());
  +		XPath* const	theXPath = theXPathFactory.create();
   
  +		XPathGuard		theGuard(theXPathFactory,
  +								 theXPath);
  +
   		TestNumericResult(theXPathProcessor,
  -						  *theXPath.get(),
  +						  *theXPath,
   						  theNumericTestInput[i],
   						  thePrintWriter,
   						  theNumericTestExpectedOutput[i],
  @@ -939,11 +945,13 @@
   
   	for(int i = 0; theStringTestInput[i] != 0; i++)
   	{
  -		XPathGuard	theXPath(theXPathFactory,
  -							 theXPathFactory.create());
  +		XPath* const	theXPath = theXPathFactory.create();
  +
  +		XPathGuard	theGuard(theXPathFactory,
  +							 theXPath);
   
   		TestStringResult(theXPathProcessor,
  -						 *theXPath.get(),
  +						 *theXPath,
   						 theStringTestInput[i],
   						 thePrintWriter,
   						 theStringTestExpectedOutput[i],
  @@ -1064,11 +1072,13 @@
   
   	for(int i = 0; theBooleanTestInput[i] != 0; i++)
   	{
  -		XPathGuard	theXPath(theXPathFactory,
  -							 theXPathFactory.create());
  +		XPath* const	theXPath = theXPathFactory.create();
   
  +		XPathGuard	theGuard(theXPathFactory,
  +							 theXPath);
  +
   		TestBooleanResult(theXPathProcessor,
  -						  *theXPath.get(),
  +						  *theXPath,
   						  theBooleanTestInput[i],
   						  thePrintWriter,
   						  theBooleanTestExpectedOutput[i],
  @@ -1220,7 +1230,7 @@
   
   int
   main(int			/* argc */,
  -	 const char*	argv[])
  +	 const char*	/* argv[] */)
   {
   #if !defined (XALAN_NO_NAMESPACES)
   	using std::cout;
  @@ -1231,7 +1241,7 @@
   	XPathEnvSupportDefault		theXPathEnvSupport;
   	DOMSupportDefault			theDOMSupport;
   	XPathSupportDefault			theXPathSupport(theDOMSupport);
  -	XObjectFactoryDefault		theXObjectFactory(theXPathEnvSupport, theXPathSupport);
  +	XObjectFactoryDefault		theXObjectFactory;
   	XPathFactoryDefault			theXPathFactory;
   	XPathProcessorImpl			theXPathProcessor;
   
  @@ -1246,4 +1256,6 @@
   		     theXPathSupport,
   			 theLiaison,
   			 thePrintWriter);
  +
  +	return 0;
   }