ngbabu has asked for the wisdom of the Perl Monks concerning the following question:
XML Code:while($file=~m/<\?CLG\.MDFO[^>]+?ID="O(.+?)"[^>]+?IDREF="C(.+? +)"[^>]+?>(.+?)<\?CLG\.MDFC[^>]+?ID="C\1"[^>]+?IDREF="O\2"[^>]+?>/msgi +) { my $mdfomdfc=$&; my $ln = line($`); if($mdfomdfc=~m/<\?CLG\.MDFO[^>]+>\n?<([A-Z.]+)[ ]?.+?>\n? +(.+?)\n?<\/(\1)>\n?(<\?.+?\?>)?\n?<\?CLG\.MDFC[^>]+>/msgi) { my $stag = $1; my $etag = $3; if($stag ne $etag) {print FOUT "<p><font color=\"red\">$path:</font> <fon +t color=\"green\">Warning: ".$warn++."</font><font color=\"darkteal\" +>: Line: $ln </font>\ <font color=\"blue\">Check: MDFO tag is pl +aced before <$stag tag, the MDFC tag should close after the same & +lt;$stag tag.</font></p>";} } }
<?CLG.MDFO ID="O001001M004000" IDREF="C001001M004000" ACTION="REPLACED +" LEVEL="STRUCTURE" COMMAND="EXPLICIT" ACTIVE.DOC="306D0754" ACTIVE.L +OC="AR:1;PT:4" MOD.LEVEL="1" PASSIVE.LOC="AR:5"?> <ARTICLE IDENTIFIER="005"> <TI.ART>Article 5</TI.ART> <STI.ART>Recovery of costs</STI.ART> <?CLG.MDFO ID="O002001M003000" IDREF="C002001M003000" ACTION="REPLACED +" LEVEL="STRUCTURE" COMMAND="EXPLICIT" ACTIVE.DOC="308D0162" ACTIVE.L +OC="AR:1;PT:3" MOD.LEVEL="1" PASSIVE.LOC="AR:5;PA:1"?> <PARAG123 IDENTIFIER="005.001"> <NO.PARAG>1.</NO.PARAG> <ALINEA>All costs resulting from issuing the accompanying documents pu +rsuant to Article 2(2) shall be borne by the food business operator r +esponsible for the consignment or its representative.</ALINEA> </PARAG123> <?CLG.MDFC ID="C002001M003000" IDREF="O002001M003000"?> <PARAG IDENTIFIER="005.002"> <NO.PARAG>2.</NO.PARAG> <ALINEA>All costs related to official measures taken by the competent +authorities as regards non-compliant consignments shall be borne by t +he food business operator responsible for the consignment or its repr +esentative.</ALINEA> </PARAG> </ARTICLE> <?no_smark?> <?CLG.MDFC ID="C001001M004000" IDREF="O001001M004000"?>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Not able to Matching nested item
by Anonymous Monk on May 31, 2008 at 09:04 UTC | |
|
Re: Not able to Matching nested item
by pc88mxer (Vicar) on May 31, 2008 at 14:16 UTC | |
|
Re: Not able to Matching nested item
by pc88mxer (Vicar) on May 31, 2008 at 18:26 UTC |