How do we validate OpenClinica's REST XML responses?

richard.morrisonrichard.morrison Posts: 3
When we use the API to make requests to /OpenClinica/rest/clinicaldata/xml/view/*/*/*/* we successfully obtain xml data.

We want to be rigorous and validate the XML, so we are looking at the declarations at the top and they declare this: xsi:schemaLocation="http://www.cdisc.org/ns/odm/v1.3 OpenClinica-ODM1-3-0-OC2-0.xsd"

...which means that OpenClinica-ODM1-3-0-OC2-0.xsd should be used to validate the XML in the given namespace.

OpenClinica support have sent us links to several different schema files with that name, most recently this one: https://github.com/OpenClinica/OpenClinica/blob/3.13/core/src/main/resources/properties/OpenClinica-ODM1-3-0-OC2-0-foundation.xsd

So we checked out the code from github to obtain the .xsd. We still get validation errors when validating OpenClinica's XML against this schema. Specifically, lxml is telling us that the API response XML contains a "<SectionDetails/>" node when the schema expects a "<SectionDetailsDefinition />" node (see line 199)

Has anyone successfully validated the XML coming out of the API? What schema is the correct one to use?

Things we have tried:
  • contacting support
  • searching the forums
  • various versions of the schema
  • stripping out nodes and attributes in the namespace http://www.openclinica.org/ns/odm_ext_v130/v3.1. The XML then validates - which implies the rest of the XML data is valid and that the problem is OpenClinica related, not CDISC related
Be grateful for any help and pointers.

Answers

Sign In or Register to comment.