• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how to format a not well formed xml into well formed

New Here ,
Oct 08, 2014 Oct 08, 2014

Copy link to clipboard

Copied

Hi,

Here's what I'm trying to do: I have a build a report based on query results. In the query result, one field is a CLOB (which contains XML. The XML contains two tags - "description" and "count"). I want to read (&parse) the XML and store the "description" and "count" in a hashmap. But when I try to parse it, I end up in an error. I'm currently  using XmlParse but I got an error "The markup following the root element should be well formed."  I immediately used IsXml() to find out if the XML I am reading is well formed.  And the answer is "NO".

Could someone help me in converting it into a "well formed" one?

(This is what I've tried: I appended "<?xml version="1.0" encoding="UTF-8"?>" to the XML I'm reading coz it was missing this.  I later used XmlFormat to convert the XML into a string format.  But IsXML tells me that even this is not well formed.)

Thanks much for your help!

Views

532

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 08, 2014 Oct 08, 2014

Copy link to clipboard

Copied

LATEST

XML encodes information is a specific way. Well-formedness determines whether or not a string is an XML document in the first place.

However, as well-formedness can be broken by any arbitrary number of factors, it is in general impossible to automate the repair process to recover a well-formed XML document. You have to do it manually, using an XML or a text editor.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation