Thanks for the replies, everyone. I'm no XML purist, but I agree "that ain't XML".
However, the pragmatist in me believes there are circumstances that could benefit from an "XML patch" utility... Suppose I'm using multiple applications that are well-intended but not terribly well-behaved (and out of my control) that contribute markup that incorrectly nests new elements with existing elements. How do I handle the tag soup?
E.g., fairly well-defined nesting issues, as in my original note:
<a><b> this </a></b>
I know "heavily overlapped" elements are very problematic and have no straightforward solution:
<a> this <b> that </a> the other </b>
However, "trivially overlapped" elements should be much easier to handle:
<a> this <b></a> that </b>
I've begun looking at HTML-Tidy and it can handle some obvious nesting and overlap issues, so far, though it's clearly more HTML-oriented (with some XML support).
Generally, whether HTML-Tidy is able, I seek a utility that can "fix" these well-defined nesting issues (ideally, it would use given tag priorities to indicate which should be ancestors to which descendants) and trivially-overlapped elements. And if the errors are worse/unfixable, the utility gives up.
Thanks again for your indulgence, mighty monks.
- Jim W.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
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:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.