lazutils: xml: xpath namespace resolver, issue #25208

git-svn-id: trunk@43300 -
This commit is contained in:
mattias 2013-10-22 12:56:19 +00:00
parent d3bb162b11
commit d0f425ca24

View File

@ -315,8 +315,13 @@ type
property Value: DOMString read FValue;
end;
TXPathNSResolver = TDOMNode {!!! experimental};
TXPathNSResolver = class
protected
FNode: TDOMNode;
public
constructor Create(aNode: TDOMNode);
function LookupNamespaceURI(const aPrefix: DOMString): DOMString; virtual;
end;
{ XPath lexical scanner }
@ -2884,6 +2889,21 @@ begin
Result := TXPathNumberVariable.Create(num);
end;
{ TXPathNSResolver }
constructor TXPathNSResolver.Create(aNode: TDOMNode);
begin
inherited Create;
FNode := aNode;
end;
function TXPathNSResolver.LookupNamespaceURI(const aPrefix: DOMString): DOMString;
begin
if assigned(FNode) then
result := FNode.LookupNamespaceURI(aPrefix)
else
result := '';
end;
{ TXPathExpression }