你也可以试试这个逻辑。
set serveroutput on
Declare
xl clob := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<time>13:12</time>
<date>02/15/13 </date>
<image1 src="path/to/image.jpeg" height="180" width="144" style="border-color:#800000" border="1" />
</soapenv:Body>
</soapenv:Envelope>';
v_parser Xmlparser.Parser;
v_doc XMLDOM.DOMDocument;
v_nodeList XMLDOM.DOMNodeList;
v_attribute varchar2(300);
Begin
v_parser := Xmlparser.newParser;
xmlparser.setValidationMode(v_parser, TRUE);
Xmlparser.parseClob(v_parser, xl);
v_doc := Xmlparser.getDocument(v_parser);
v_nodeList := xslprocessor.selectNodes(XMLDOM.makeNode(v_doc), '//image1');
v_attribute := XMLDOM.getAttribute((XMLDOM.makeElement(XMLDOM.item(v_nodeList, 0))), 'src');
dbms_output.put_line(v_attribute);
End;
输出:
路径/到/image.jpeg