views:

73

answers:

2

Hi,

I need to parse a xml string to obtain the xml DOM, the problem I'm facing is with the self closing html tag like <br /> giving me the error of Tag mismatch expected </br>.

I'm aware this can be overcome by using <br></br> instead of <br /> in the string, but is there a way this can be done without making the above change.

please help...

  • Rob
+1  A: 

The self closing tag is entirely valid. I suspect you have a mismatched element elsewhere in your XML.

Brian Agnew
+1  A: 
Tag mismatch expected </br>

means you have forgotten to self-close the element. <br/> is just fine, but I think you've missed one or more HTML-style <br>s in your document. If you don't get a line number from your parser, you can always try loading the XML into a browser or validator to get a hint of where the problem is.

bobince