Troubleshooting

Your parser rejects or stalls on the cXML DOCTYPE

Every inbound cXML document fails to parse, with an error about the DOCTYPE, or every request takes seconds longer than it should and occasionally times out.

Short answer

Every cXML document begins with a DOCTYPE pointing at the cXML DTD on cxml.org. A parser either refuses that DOCTYPE — common when hardened against XXE, for example a Java parser configured to disallow DOCTYPE declarations — or tries to download the DTD on every request. Allow the DOCTYPE, turn off external entity and DTD loading, and validate separately if you need to.

Causes, most likely first

Ordered by how often each one turns out to be the culprit, not by how interesting it is. Work down the list.

  1. The parser rejects any DOCTYPE

    How to confirm: Every document fails with a message about the DOCTYPE, including ones you know are valid. Usually a security default or a hardening change made by someone else.

    Fix: Allow DOCTYPE declarations and disable external general entities, external parameter entities and external DTD loading. That keeps XXE protection and accepts cXML.

  2. The parser fetches the DTD for every document

    How to confirm: Each parse makes an outbound request to xml.cxml.org. Requests are slow when that host is slow, and fail when your servers have no outbound internet access.

    Fix: Turn off DTD loading. If you validate, keep a local copy of the DTD versions you accept and resolve them locally.

  3. Validation against a different DTD version

    How to confirm: Your local copy is older than the version the buyer declares, and elements added in later versions fail.

    Fix: Keep the DTD versions your buyers declare. Choose the copy from the version in the document’s DOCTYPE, not one fixed version.

  4. Your outbound documents point at a DTD address that does not exist

    How to confirm: The DOCTYPE in documents you send has a version number or path typed by hand that the buyer cannot resolve, and validating buyers reject it.

    Fix: Copy the DOCTYPE line exactly from the version the buyer has asked for.

If it is not on your side

If only one buyer’s documents fail, compare their DOCTYPE line with that of a buyer that works. A different version or a non-standard path in theirs tells you which DTD copy you are missing.

Check the document itself

Before chasing “Your parser rejects or stalls on the cXML DOCTYPE” further, paste the cXML or OCI payload into our free tester. It runs in your browser and reports the structural problems buyers reject on. The interactive demo plays the whole round trip from the buyer's seat.

Open the tester Play the demo

Related questions

Is turning off DTD loading safe?

Yes. It is the safer option. You lose automatic validation, which you can do separately with a local DTD if you need it, and you remove a network call and an attack surface from every request.

Do we need to validate inbound cXML against the DTD?

It is not required. Most suppliers parse the elements they need and check those explicitly, which gives clearer error messages than a DTD validator.

Rather not be the one debugging this?

A free PunchOut shop runs the PunchOut round trip for you: upload from Excel, test it, invite your buyer.

Start free Send us the error