XML Parsing: Mixed content is not supported

A system I’m integrating with returns Mixed content XML from its REST API. It would be helpful if the XML Parser snap could handle that, even ignoring that part of the XML or giving a warning rather than just failing to parse.

Example error:
`

{“error”:“Failed to convert xml to json”,“stacktrace”:“com.snaplogic.api.ExecutionException: Encountered XML Mixed content\n\tat com.snaplogic.snap.api.xml.XmlUtilsImpl.throwMixedContentException(XmlUtilsImpl.java:1161)\n\tat com.snaplogic.snap.api.xml.XmlUtilsImpl.copyEventsFrom(XmlUtilsImpl.java:745)\n\tat com.snaplogic.snap.api.xml.XmlUtilsImpl.convertToJson(XmlUtilsImpl.java:261)\n\tat com.snaplogic.snaps.transform.XmlParser.doWork(XmlParser.java:358)\n\tat com.snaplogic.snap.api.SimpleBinarySnap.execute(SimpleBinarySnap.java:57)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl.executeSnap(SnapRunnableImpl.java:709)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl.execute(SnapRunnableImpl.java:489)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:770)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl.access$000(SnapRunnableImpl.java:108)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl$1.run(SnapRunnableImpl.java:335)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl$1.run(SnapRunnableImpl.java:331)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat javax.security.auth.Subject.doAs(Subject.java:422)\n\tat org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:330)\n\tat com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:108)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\nCaused by: javax.xml.stream.XMLStreamException: Mixed content is not supported: ’ ==== (’\n\tat de.odysseus.staxon.json.JsonXMLStreamWriter.writeData(JsonXMLStreamWriter.java:246)\n\tat de.odysseus.staxon.base.AbstractXMLStreamWriter.writeCharacters(AbstractXMLStreamWriter.java:277)\n\tat de.odysseus.staxon.event.SimpleXMLEventWriter.add(SimpleXMLEventWriter.java:93)\n\tat com.snaplogic.snap.api.xml.XmlUtilsImpl.copyEventsFrom(XmlUtilsImpl.java:739)\n\t… 20 more\n”,“reason”:“Mixed content is not supported: ’ ==== (’”,“resolution”:“Please check if the xml data is well formed”,“snap_details”:{“label”:“XML Parser”}}

`

1 Like