To extract the lines between and including ones that start with <DTC> and end with </DTC>:
if (m|^\s*<DTC>| ... m|^\s*</DTC>|)
...is your data consisting of the C program...
See: tutorial on Flip/Flop operator: Flipin good, or a total flop?
<ShortDescription>The reductant pump needs to run slower than expect
+ed to keep the pressure.</ShortDescription>
<WarningLamp>No Warning Lamp</WarningLamp>
There are a number of Perl XML parsers that can deal with these lines after they have been extracted from the C code.
I looked again at the post and I think that the "C" code will not compile because the <DTC>...</DTC> stuff does not look like a comment block to the C compiler. I guess the blocks could be like:
/*XML doc start
XML doc end */
So that the C compiler will see the whole XML doc as a single comment block.
An alternate that is worth considering is Perl POD (Perl Plain Old Documentation) Perl POD. If you organize the "comments" in the C code right, the C compiler will be happy. And the Perl documentation generator will also be happy processing the raw C input file (a "=" as the first character on a line has special meaning). The Perl POD generators will make HTML web pages or man pages directly from the C source file, if the comments /*....*/ are done right.
/*Perl doc start
=some heading in Perl POD
=some other heading tag in Perl POD
Perl doc end */
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] |