Skip to content

Basic XML validation

Dan Visel requested to merge 858-xml-validation into main

This is for #858 (closed); basically, after we generate JATS, it's run through an XML parser server-side to see if it's valid XML or not. This does not check if it's valid JATS; that's the next (and more complicated) step.

If the generated JATS fails, the first error is sent back as a response to the query rather than JATS; this is reported on the browser console. Because our JATS is fairly primitive at this point, this step should not fail publicly; it's more likely that this will fail when the JATS code is changed, so the messaging is targeted to developers. To see a sample error, set failXML to true at the top of server/jatsexport/graphql.js; this will feed the parser some messed-up XML (what's in errorJats), and the browser will report the error.

Merge request reports