30#include <com/sun/star/uno/Reference.h>
31#include <com/sun/star/uno/Sequence.h>
33#include <com/sun/star/xml/xpath/XXPathAPI.hpp>
34#include <com/sun/star/xml/dom/XNode.hpp>
35#include <com/sun/star/xml/dom/XNodeList.hpp>
36#include <com/sun/star/xml/xpath/XXPathObject.hpp>
37#include <com/sun/star/xml/xpath/XXPathExtension.hpp>
38#include <com/sun/star/lang/XServiceInfo.hpp>
39#include <com/sun/star/uno/XComponentContext.hpp>
43 typedef std::map<OUString, OUString>
nsmap_t;
44 typedef std::vector< css::uno::Reference<css::xml::xpath::XXPathExtension> >
extensions_t;
46 typedef ::cppu::WeakImplHelper
47 < css::xml::xpath::XXPathAPI
48 , css::lang::XServiceInfo
58 const css::uno::Reference< css::uno::XComponentContext >
m_xContext;
63 explicit CXPathAPI(
const css::uno::Reference< css::uno::XComponentContext >& );
73 virtual void SAL_CALL
registerNS(
const OUString& aPrefix,
const OUString& aURI)
override;
75 virtual void SAL_CALL
unregisterNS(
const OUString& aPrefix,
const OUString& aURI)
override;
80 virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL
selectNodeList(
const css::uno::Reference< css::xml::dom::XNode >& contextNode,
const OUString& str)
override;
85 virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL
selectNodeListNS(
const css::uno::Reference< css::xml::dom::XNode >& contextNode,
const OUString& str,
const css::uno::Reference< css::xml::dom::XNode >& namespaceNode)
override;
90 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL
selectSingleNode(
const css::uno::Reference< css::xml::dom::XNode >& contextNode,
const OUString& str)
override;
95 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL
selectSingleNodeNS(
const css::uno::Reference< css::xml::dom::XNode >& contextNode,
const OUString& str,
const css::uno::Reference< css::xml::dom::XNode >& namespaceNode)
override;
97 virtual css::uno::Reference< css::xml::xpath::XXPathObject > SAL_CALL
eval(
const css::uno::Reference< css::xml::dom::XNode >& contextNode,
const OUString& str)
override;
99 virtual css::uno::Reference< css::xml::xpath::XXPathObject > SAL_CALL
evalNS(
const css::uno::Reference< css::xml::dom::XNode >& contextNode,
const OUString& str,
const css::uno::Reference< css::xml::dom::XNode >& namespaceNode)
override;
102 virtual void SAL_CALL
registerExtensionInstance(
const css::uno::Reference< css::xml::xpath::XXPathExtension>& aExtension)
override;
virtual void SAL_CALL registerNS(const OUString &aPrefix, const OUString &aURI) override
CXPathAPI(const css::uno::Reference< css::uno::XComponentContext > &)
virtual css::uno::Reference< css::xml::xpath::XXPathObject > SAL_CALL evalNS(const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str, const css::uno::Reference< css::xml::dom::XNode > &namespaceNode) override
same as eval but registers all namespace declarations found on namespaceNode
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL selectSingleNode(const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str) override
Use an XPath string to select a single node.
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL selectSingleNodeNS(const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str, const css::uno::Reference< css::xml::dom::XNode > &namespaceNode) override
Use an XPath string to select a single node.
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL selectNodeList(const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str) override
Use an XPath string to select a nodelist.
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL unregisterNS(const OUString &aPrefix, const OUString &aURI) override
const css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL registerExtension(const OUString &aName) override
uses the service manager to create an instance of the service denoted by aName.
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL selectNodeListNS(const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str, const css::uno::Reference< css::xml::dom::XNode > &namespaceNode) override
Use an XPath string to select a nodelist.
extensions_t m_extensions
virtual css::uno::Reference< css::xml::xpath::XXPathObject > SAL_CALL eval(const css::uno::Reference< css::xml::dom::XNode > &contextNode, const OUString &str) override
evaluates an XPath string.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL registerExtensionInstance(const css::uno::Reference< css::xml::xpath::XXPathExtension > &aExtension) override
registers the given extension instance to be used by XPath evaluations performed through this XPathAP...
std::map< OUString, OUString > nsmap_t
std::vector< css::uno::Reference< css::xml::xpath::XXPathExtension > > extensions_t
::cppu::WeakImplHelper< css::xml::xpath::XXPathAPI, css::lang::XServiceInfo > CXPathAPI_Base