String에 저장 한 XML 문서가 있습니다. 문자열은 다음과 같습니다.문자열 배열에서 문자열을 찾아 추출합니다.
<?xml version=\"1.0\" encoding=\"http://schemas.xmlsoap.org/soap/envelope/\" standalone=\"no\"?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"><axis2:ServiceGroupId xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\" wsa:IsReferenceParameter=\"true\">urn:uuid:2BC5F552AF3179755C1348038695049</axis2:ServiceGroupId><wsa:To>http://localhost:8081/axis2/services/TCAQSRBase</wsa:To><wsa:MessageID>urn:uuid:599362E68F35A38AFA1348038695733</wsa:MessageID><wsa:Action>http://www.transcat-plm.com/TCAQSRBase/TCAQSR_BAS_ServerGetOsVariable</wsa:Action></soapenv:Header><soapenv:Body><ns1:TCAQSR_BAS_ServerGetOsVariableInput xmlns:ns1=\"http://www.transcat-plm.com/TCAQSRBase/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"ns1:TCAQSR_BAS_ServerGetOsVariableInputType\"><ns1:TCAQSR_BAS_BaseServerGetInputKey>USERNAME</ns1:TCAQSR_BAS_BaseServerGetInputKey></ns1:TCAQSR_BAS_ServerGetOsVariableInput></soapenv:Body></soapenv:Envelope>
문자열에 문자열이 어떻게 표시되는지 알지 못합니다.
그러나 나는 <axis2:ServiceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">
과 </axis2:ServiceGroupId>
사이의 용어를 추출하고 싶습니다. 어느 것이 urn : uuid :이며 문자열에 결과를 저장하고 싶습니다. 나는 xpath를 알고 있지만, 제 경우에는 xpath를 사용할 수 없습니다.
정말 도움이 될 것입니다.
미리 감사.
XML 파서는 어떻게됩니까? – sp00m
@ sp00m 죄송합니다. 나는이 일에 대해 사전 지식이 없습니다. 그리고 XML 구문 분석기가 무엇인지 정확히 알지 못합니다. – Spaniard89