dan_hammari
Community Participant

How can I validate the XML for my LTI connection?

Jump to solution

I have been building an XML configuration document that will allow subscribers to automatically configure the LTI connection between Canvas and my content service. I am having difficulty getting my XML file to work in Canvas, however. I paste my XML into the form that creates a third-party app in Canvas and click submit. Canvas immediately displays the message "blank" as a popup error  (see attached). It would be nice if the message was helpful or could indicate why Canvas rejects my XML configuration. However, this may be beyond the scope of the LTI setup form. Is there a separate tool that I can use to validate and troubleshoot my XML configuration? I have used various XML lint services and verified that my configuration file conforms to XML standards and correctly references the required XML definitions. I have no idea why Canvas chokes on the file though. I have attached my LTI XML document in case you are curious. Below are the sites I have referenced while building my file. I would appreciate it if someone could point me to a place where I can fully validate my LTI XML configuration document and troubleshoot its issues to make it work with Canvas.

https://canvas.instructure.com/doc/api/file.tools_xml.html

https://www.imsglobal.org/specs/lti/xml

https://www.edu-apps.org/build_xml.html

http://www.xmlvalidation.com/index.php

Labels (1)
1 Solution
garth
Community Champion

 @dan_hammari ​ when I started working with LTI I used one of the sites you have listed to generate my first LTI XML file:

I can verify that it worked.

From there I built on to that XML file and didn't have any issues.

Have you considered stepping back and taking a step-by-step approach to building the file:

  • generate a simple XML file with your tool of choice and verify that it works
  • then add your custom pieces one at a time, testing at each step, until it fails

This might make it easier to find where the problem is.

View solution in original post

0 Kudos
5 Replies
themidiman
Community Champion

If you built your code by hand, and need to validate it against the schema, you may find some open source validation tool handy.

Web Tools Platform (WTP) Project is one I've used in the past.

Here's a really outdated tutorial for the tool, so I hope it applies in your case: Validation Tutorial

Thanks for showing me the Web Tools Platform project. I was able to add that library to my Eclipse IDE and run the validate option against my files to see where issues were cropping up.

garth
Community Champion

 @dan_hammari ​ when I started working with LTI I used one of the sites you have listed to generate my first LTI XML file:

I can verify that it worked.

From there I built on to that XML file and didn't have any issues.

Have you considered stepping back and taking a step-by-step approach to building the file:

  • generate a simple XML file with your tool of choice and verify that it works
  • then add your custom pieces one at a time, testing at each step, until it fails

This might make it easier to find where the problem is.

0 Kudos
dan_hammari
Community Participant

I found your advice to compare my XML against the output from XML Config Builder (https://www.edu-apps.org/build_xml.html) to be most helpful. I had to switch my browser from Firefox to Safari in order to copy the XML output from the web page (Firefox wouldn't let me copy the output). Canvas immediately accepted the XML that this form produced. I was able to compare the XML from this form against my custom XML and find my mistakes. It would be nice if the XML Config Builder page could create XML specific to the thin common cartridge also. I will have to press forward with my custom XML. As for the odd error message that Canvas continually gives when the XML is not valid, perhaps the Instructure developers could change the message to "Your XML is not valid" instead of "blank."

I like your idea to enhance the failure message.

Please pass that on to your Canvas CSM, let me know what they say.