cssutils installs itself as a DOMImplementation with certain features. It's not a full implementation. PyXB doesn't call xml.dom.getDOMImplementation() with any features or a specific implementation therefore gets cssutils and then breaks with an error like
File "/Users/dylanjay/Projects/download-cache/eggs/PyXB-1.2.3-py2.7.egg/pyxb/binding/basis.py", line 539, in toxml
dom = self.toDOM(bds)
File "/Users/dylanjay/Projects/download-cache/eggs/PyXB-1.2.3-py2.7.egg/pyxb/binding/basis.py", line 502, in toDOM
bds = domutils.BindingDOMSupport()
File "/Users/dylanjay/Projects/download-cache/eggs/PyXB-1.2.3-py2.7.egg/pyxb/utils/domutils.py", line 477, in init
self.reset()
File "/Users/dylanjay/Projects/download-cache/eggs/PyXB-1.2.3-py2.7.egg/pyxb/utils/domutils.py", line 439, in reset
self.document = self.implementation().createDocument(None, None, None)
File "/Users/dylanjay/Projects/download-cache/eggs/cssutils-1.0-py2.7.egg/cssutils/init.py", line 166, in createDocument
raise NotImplementedError
NotImplementedError
if instead the call was xml.dom.getDOMImplementation(features=['core','xml 2.0']) or similar, the problem is avoided.
I've never come across a DOM implementation that didn't support core or xml, but it appears to be a legitimate situation. As a work-around while I figure out exactly what levels are required (looks like core 2.0 and xml 2.0), you can use pyxb.dom.setDOMImplementation() to override the default.
The workaround is to use this in the code that imports cssutils:
The fix is in the next branch:
Thanks for the report and the clue to how to fix it.