SOAP "ID" and "href" handling in the serialized xml stream.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@730 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2009-03-06 20:41:44 +00:00
parent 76b3f1fc67
commit 4217df162b
4 changed files with 176 additions and 4 deletions

View File

@@ -34,7 +34,15 @@ type
function FilterList(const ALIst : IDOMNodeList; const ANodeName : DOMString):IDOMNodeList;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
function FilterList(const ANode : TDOMNode; const ANodeName : DOMString):IDOMNodeList;overload;{$IFDEF USE_INLINE}inline;{$ENDIF}
function SelectSingleNode(
const AXPathExpression : DOMString;
const AContextNode : TDOMNode;
const AErrorIfMore : Boolean
) : TDOMNode;
resourcestring
SERR_XpathExpectingOneNode = 'Xpath expression expecting a single node while got %d node : %s.';
implementation
uses XmlDoc;
@@ -168,7 +176,7 @@ type
);
end;
function FilterList(const ALIst : IDOMNodeList; const ANodeName : widestring):IDOMNodeList ;
function FilterList(const ALIst : IDOMNodeList; const ANodeName : DOMString):IDOMNodeList ;
begin
Result := TDOMNodeSelectListImp.Create(ALIst,ANodeName);
end;
@@ -178,6 +186,25 @@ begin
Result := FilterList(ANode.ChildNodes,ANodeName);
end;
function SelectSingleNode(
const AXPathExpression : DOMString;
const AContextNode : TDOMNode;
const AErrorIfMore : Boolean
) : TDOMNode;
var
locSelect : IDOMNodeSelect;
ns : TDOMNodeList;
begin
Result := nil;
locSelect := AContextNode as IDOMNodeSelect;
ns := locSelect.selectNodes(AXPathExpression);
if ( ns <> nil ) and ( ns.length > 0 ) then begin
if AErrorIfMore and ( ns.length > 1 ) then
raise Exception.CreateFmt(SERR_XpathExpectingOneNode,[ns.length,AXPathExpression]);
Result := ns[0];
end;
end;
{ TDOMNodeSelectListImp }
constructor TDOMNodeSelectListImp.Create(