The tag do not have attributes, there is no CDATA so it's all good.
The idea is good but the following code does not work with Ksh.
also we can have an empty tag, like this :Code:<bla> body </bla>
How do you loop in a XML fileCode:</bla>
and store the opening tag into $1 and the body of the tag inside $2 for treatment ?
thanks for helpingCode:if($input_xml_sample =~ /\<([A-Za-z0-9_\-]{1,40})\>(.*?)\<\/\1\>/s ) {
# \1 refers to contents matched within the 1st () group
$tag_name = $1; #get contents from first () group
$tag_contents = $2; # get contents from 2nd () group
$tag_contents =~ tr/\<\>/ /; # change < and > to spaces
}