1

I have some json data which is accessed from a third party server. It contains large content and starts like

   [
   {
      "id":1845,
      "title":"Llm In Transnational Oil, Gas And Energy Law By Online Learning",
      "category_id":4,
      "sub_category_id":null,
      "timestamp":"2013-05-15T11:56:19.168508Z",
      "start_time":"2013-09-29T15:00:00+01:00",
      "end_time":"2014-12-19T19:30:00+00:00",
      "summary":"Develop a deep, practical understanding of how to resolve the challenges posed\r\nby national authorities to oil, gas and energy production.\r\n"
...

I cannot convert this JSON to XML, even using JSONSerializer and XMLSerializer. I got the following error: ncname 0*20 illegal character

I also tried some org.json libraries like JSONTokenizer and JSONArray which retrieve only text but do not generate any XML output.

Balder
  • 8,623
  • 4
  • 39
  • 61
Hala Rowan
  • 169
  • 6
  • Show us the code you have tried. –  Mar 24 '14 at 08:42
  • 1
    The format of a `ncname` is defined here: http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName From the error it seems like your JSON is mapped to a key that doesn't conform to that rule. `0x20` indicates a space character somewhere the parser doesn't allow one. – mabi Mar 24 '14 at 08:42
  • Also, a possible duplicate of http://stackoverflow.com/q/7928535/785663 – mabi Mar 24 '14 at 08:45

0 Answers0