Hello Everyone, My script contains:
<wsdl:message> </wsdl:message> <wsdl:message> </wsdl:message> <wsdl:message> </wsdl:message> <wsdl:portType> </wsdl:portType> <wsdl:service> </wsdl:service> I do get all the tags one below the other using perl below code: while ($flag){ my $start = index($temp_contents, '<wsdl:message'); my $end = index($temp_contents, '</wsdl:message>') + length('</wsdl:message>'); if ($start >0){ my $temp_message = substr($temp_contents, $start, ($end-$start)); push @messages, $temp_message; $flag =0; } else{ $flag = 0; } } Similarly for other tags as well. The problem is <wsdl:message tags are more than one. And if the give the above code, I end up getting just the first message tag. But I want to get all the message tags + contents between them to complete my file. My output should be like this: <wsdl:message name="dateRequest"> <wsdl:part name="text" type="xsd:string"> <wsdl:documentation>New Subroutine</wsdl:documentation> </wsdl:part> </wsdl:message> <wsdl:message name="dateResponse"> <wsdl:part name="dateReturn" type="xsd:float"> <wsdl:documentation>This returns date</wsdl:documentation> </wsdl:part> </wsdl:message> <wsdl:message name="sayHiRequest"> <wsdl:part name="name" type="xsd:string"> <wsdl:documentation>Name one</wsdl:documentation> </wsdl:part> <wsdl:part name="name2" type="xsd:string"> <wsdl:documentation>Name two</wsdl:documentation> </wsdl:part> </wsdl:message> <wsdl:message name="sayHiResponse"> <wsdl:part name="sayHiReturn" type="xsd:string" /> </wsdl:message> At present, according to my code, I get the first <wsdl:message> tag with its contents. Can anyone please tell me how to get rest of the message tags as well. Many Thanks, Jyo