Reading xml with ill-formed content

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PrasanAry
    New Member
    • Mar 2008
    • 1

    Reading xml with ill-formed content

    Hi,
    I am using DOM to read from XML file. A sample of my XML is
    <doc>
    <content> This is content. It may have <tags> like this </content>
    </doc>

    Now when I do getElementsByTa gName(doc), I get an error telling me that the xml is not well formed, which is true since the <content> element has an ill-fromed <tags> in it.

    How do I parse xml documents like this?

    Thanks .
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    I suggest using XML Tidy to turn this document into an actual XML document.

    It may not work entirely, you may still have to correct some of the errors.

    Comment

    Working...