Layer7 API Management

  • 1.  Apply JSON Transformation

    Posted Nov 08, 2017 06:10 AM

    I need to convert the below JSON to XML 

     

    {"bookstore":{"1234":["abc","xyz","lhvl"],"2345":["abc","xyz","lhvl"]}}

     

    but i am getting error saying "Converted XML is invalid.  The content of elements must consist of well-formed character data or markup."

     

    The same when i try converting using few online JSON to XML converters works fine.What could be the issue?

     

    Regards,

    Sonalee Shyam 



  • 2.  Re: Apply JSON Transformation
    Best Answer

    Broadcom Employee
    Posted Nov 08, 2017 08:56 AM

    Hi Sonalee,

     

    It looks like this is failing as it is not adhering to XML element naming:

     

    XML elements must follow these naming rules:

     

    Names can contain letters, numbers, and other characters
    Names cannot start with a number or punctuation character
    Names cannot start with the letters xml (or XML, or Xml, etc)
    Names cannot contain spaces

     

    Ref:

    https://www.w3schools.com/xml/xml_elements.asp

     

     

    Regards,

    Joe