XMLParserItf Interface CATIXMLXPathFactory

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIXMLXPathFactory

Interface to instantiate XPath expressions.
Role: This interface is used to create XPath expressions. These XPath expressions use as a context node the DOM node which implements the interface. This context node can be either a CATIDOMDocument or a CATIDOMElement node.

The following code sample shows how an CATIXMLXPathFactory can be obtained from a CATIDOMElement to create and evaluate an XPath expression.

 CATIDOMElement_var x = ...;
 CATIXMLXPathFactory factory = x;
 if (factory != NULL_var) {
     CATIXMLXPathExpression_var xPath;
     hr = factory->CreateExpression("foo/bar", xPath);
     if (SUCCEEDED(hr) && (xPath != NULL_var)) {
          CATIDOMNodeList_var nodeList;
          hr = xPath->EvaluateAsNodeList(nodeList);
     }
 }
 
See also:


Method Index


o CreateExpression(CATUnicodeString&,CATIXMLXPathExpression_var&)
Creates a new XPath expression.

Methods


o CreateExpression
public virtual CreateExpression( const iExpression,
oPath)
Creates a new XPath expression.
Parameters:
iExpression
The text of the XPath expression.
oPath
The XPath expression represented by this object.
Returns:
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

This object is included in the file: CATIXMLXPathFactory.h
If needed, your Imakefile.mk should include the module: CatXmlItfExt

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.