validating shib conf files using python

Liam Hoekenga liamr at umich.edu
Thu Jul 10 10:57:56 EDT 2014


This is only tangentially a shibboleth question.

I'm trying to generate shibboleth configuration (XML) files by combining
small files containing configuration segments using python 2.7.x and lxml.
 Rather than just smash them together, I'd actually like to validate the
resulting XML.  (I'd be happy to share the work when I'm done.)
I've got a element that does not conform to the schema (on purpose)..
<resolver:AttributeDefinition xsi:type="Simple" id="uid"
sourceAttributeID="uid">    ...  </resolver:AttributeDefinition>
And when I check my document with assertValid (lxml.etree.XMLschema), I get
an error like this...  (u"Element
'{urn:mace:shibboleth:2.0:resolver}AttributeDefinition', attribute '{
http://www.w3.org/2001/XMLSchema-instance}type': The QName value 'Simple'
of the xsi:type attribute does not resolve to a type definition., line 1",)
Is it possible obtain more information from the exception?I'd really like
to be able to print the "id" attribute from the broken element.
Liam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20140710/eff9dff0/attachment.html 


More information about the users mailing list