Posted on 2006-06-03 01:42:43-07 by dandv
How do I determine if an element has a closing tag?
Consider this HTML code:
<p>Line 1.<br>Line 2.<br /></p>
My application needs to output the HTML with an RTF layer, preserving as much as possible from the HTML structure. The problem I'm running into is that HTML::Element doesn't allow me to detect that the <br> tag has no closing tag, the <br /> element is XML-properly empty (bonus point for being able to detect the space before the ending slash), and <p> does have a closing tag. Is there a way to distinguish between these three cases? Thanks, Dan -- http://automaticallyyours.info
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.