You've already forked lazarus-ccr
SOAP inline namespace handling, thanks to Christian Schiffler for patch
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2486 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -344,6 +344,7 @@ type
|
|||||||
const ANameSpace : string;
|
const ANameSpace : string;
|
||||||
const ACreateIfNotFound : Boolean
|
const ACreateIfNotFound : Boolean
|
||||||
):shortstring;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
):shortstring;{$IFDEF USE_INLINE}inline;{$ENDIF}
|
||||||
|
function FindXMLNodeWithNamespaceInSubScope(ANameSpace, ANodeName: string): TDOMNode;
|
||||||
protected
|
protected
|
||||||
function GetCurrentScope():String;
|
function GetCurrentScope():String;
|
||||||
function GetCurrentScopeObject():TDOMElement;
|
function GetCurrentScopeObject():TDOMElement;
|
||||||
@ -832,6 +833,42 @@ begin
|
|||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
function TSOAPBaseFormatter.FindXMLNodeWithNamespaceInSubScope(
|
||||||
|
ANameSpace,
|
||||||
|
ANodeName : string
|
||||||
|
) : TDOMNode;
|
||||||
|
|
||||||
|
function ScanNode(ANode: TDOMNode): TDOMNode;
|
||||||
|
var
|
||||||
|
AttrName : string;
|
||||||
|
begin
|
||||||
|
Result := nil;
|
||||||
|
if FindAttributeByValueInNode(ANameSpace, ANode, AttrName) then begin
|
||||||
|
if not IsStrEmpty(AttrName) then begin
|
||||||
|
AttrName := ExtractNameSpaceShortName(AttrName);
|
||||||
|
if not IsStrEmpty(AttrName) then begin
|
||||||
|
if(ANode.NodeName = AttrName + ':' + ANodeName) then
|
||||||
|
Result := ANode;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
locNode : TDOMNode;
|
||||||
|
begin
|
||||||
|
locNode := GetCurrentScopeObject();
|
||||||
|
Result := ScanNode(locNode);
|
||||||
|
if (Result <> nil) or not(locNode.HasChildNodes) then
|
||||||
|
exit;
|
||||||
|
locNode := locNode.FirstChild;
|
||||||
|
while (locNode <> nil) do begin
|
||||||
|
Result := ScanNode(locNode);
|
||||||
|
if (Result <> nil) then
|
||||||
|
Break;
|
||||||
|
locNode := locNode.NextSibling;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TSOAPBaseFormatter.InternalPutData(
|
function TSOAPBaseFormatter.InternalPutData(
|
||||||
const ANameSpace : string;
|
const ANameSpace : string;
|
||||||
@ -1047,6 +1084,8 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
locElt := GetCurrentScopeObject().GetAttributeNode(strNodeName);
|
locElt := GetCurrentScopeObject().GetAttributeNode(strNodeName);
|
||||||
end;
|
end;
|
||||||
|
if (locElt = nil) and (Style = Document) then
|
||||||
|
locElt := FindXMLNodeWithNamespaceInSubScope(ANameSpace,AName);
|
||||||
|
|
||||||
Result := ( locElt <> nil );
|
Result := ( locElt <> nil );
|
||||||
if Result then begin
|
if Result then begin
|
||||||
@ -1572,6 +1611,8 @@ begin
|
|||||||
( ( AScopeType = stArray ) and ( AStyle = asScoped ) )
|
( ( AScopeType = stArray ) and ( AStyle = asScoped ) )
|
||||||
then begin
|
then begin
|
||||||
locNode := stk.FindNode(strNodeName);
|
locNode := stk.FindNode(strNodeName);
|
||||||
|
if (locNode = nil) and (Style = Document) then
|
||||||
|
locNode := FindXMLNodeWithNamespaceInSubScope(nmspc,AScopeName);
|
||||||
end else begin
|
end else begin
|
||||||
locNode := stk.ScopeObject;
|
locNode := stk.ScopeObject;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user