Attribute Id is in the wsu namespace. However, the schema for both wsse and wsu have attributeFormDefault="unqualified", so the schema does not require that the namespace qualifier be present in the xml text.
PyXB does not have a flag that forces the namespace qualifier to be emitted even when it is not necessary.
PyXB may not handle attributeFormDefault="qualified" correctly; I need to investigate that to be sure, but it's not relevant to these schema.
the instance is created properly, at least with the versions I'm using. ('...' is not valid for xsd:ID which is the type of the Id attribute, so the exact example you gave does not work.)
Does that help? If not, please provide a more complete example including what you see and why you think it's wrong.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, that last answer was bogus. There are several problems, but I believe only one affects your code. The issue is that the bindings for wsse attempt to look up the module associated with the wsu bindings in order to associate that namespace with the Id attribute. The wsse bindings should have imported the wsu module so this lookup would succeed, but they didn't.
I try to make XMLDSIG:
But attribute 'Id' must be in 'wsu' name space, that is "wsu:Id". Is there any way to do this?
Attribute Id is in the wsu namespace. However, the schema for both wsse and wsu have attributeFormDefault="unqualified", so the schema does not require that the namespace qualifier be present in the xml text.
PyXB does not have a flag that forces the namespace qualifier to be emitted even when it is not necessary.
PyXB may not handle attributeFormDefault="qualified" correctly; I need to investigate that to be sure, but it's not relevant to these schema.
If in the above you use:
the instance is created properly, at least with the versions I'm using. ('...' is not valid for xsd:ID which is the type of the Id attribute, so the exact example you gave does not work.)
Does that help? If not, please provide a more complete example including what you see and why you think it's wrong.
OK, that last answer was bogus. There are several problems, but I believe only one affects your code. The issue is that the bindings for wsse attempt to look up the module associated with the wsu bindings in order to associate that namespace with the Id attribute. The wsse bindings should have imported the wsu module so this lookup would succeed, but they didn't.
This is now https://sourceforge.net/apps/trac/pyxb/ticket/198. You can work around it by changing the order of imports:
Thank you very much!