mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 21:00:23 +02:00
lazutils: xml: xpath namespace resolver, issue #25208
git-svn-id: trunk@43300 -
This commit is contained in:
parent
d3bb162b11
commit
d0f425ca24
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user