Extracts the given set of nodes from the TOraXML.
procedure Extract(RetDoc: TOraXML; XPathExpr: string; NSmap: string = '');
Call the Extract method to extract the given set of nodes from the TOraXML. This set of nodes is specified by the XPathExpr expression. The original document remains unchanged. If no nodes match the specified expression, returns NULL document. RetDoc parameter is a destination TOraXML object which holds the operation result. RetDoc object must be created before passing it as a parameter. Use XPathExpr parameter to specify what nodes to search for. The NSmap parameter is a namespace that can be used to identify the mapping of prefix(es) specified in the XPath_string to the corresponding namespace(s). The format is "xmlns=a.com xmlns:b=b.com".
var RetDoc: TOraXML; Str: string; begin ... Edit; TOraXMLField(FieldByName('XMLField')).AsXML.AsString := '<root> '+ '<x xmlns:edi=''http://ecommerce.org/schema''> '+ '<b>32.18</b> '+ '<edi:price units=''Euro''>32.18</edi:price> '+ '</x> '+ '</root>'; Post; ... RetDoc := TOraXML.Create(); RetDoc.OCISvcCtx := OraSession1.OCISvcCtx; try with TOraXMLField(FieldByName('XMLField')).AsXML do begin Extract(RetDoc, '//edi:price', 'xmlns:edi=http://ecommerce.org/schema'); Str := RetDoc.AsString; Extract(RetDoc, '/root/x/b'); Str := RetDoc.AsString; // Str = '<b>32.18</b>' end; finally RetDoc.Free; end; end;