Created
April 3, 2012 14:24
-
-
Save plq/2292401 to your computer and use it in GitHub Desktop.
Any tag test case.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from lxml import etree | |
from rpclib.model.primitive import AnyXml | |
from rpclib.model.complex import ComplexModel | |
from rpclib.const import xml_ns as ns | |
from rpclib.util.xml import get_schema_documents | |
class SomeType(ComplexModel): | |
__namespace__ = "zo" | |
anything = AnyXml(schema_tag='{%s}any' % ns.xsd, namespace='##other', | |
process_contents='lax') | |
docs = get_schema_documents([SomeType]) | |
print etree.tostring(docs['tns'], pretty_print=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xs:schema xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:tns="zo" xmlns:plink="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:senc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s12env="http://www.w3.org/2003/05/soap-envelope/" xmlns:s12enc="http://www.w3.org/2003/05/soap-encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="zo" elementFormDefault="qualified"> | |
<xs:complexType name="SomeType"> | |
<xs:sequence> | |
<xs:any namespace="##other" processContents="lax" minOccurs="0" nillable="true"/> | |
</xs:sequence> | |
</xs:complexType> | |
<xs:element name="SomeType" type="tns:SomeType"/> | |
</xs:schema> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/plq/rpclib/blob/ee7752464688badf90cbb36416b4c5fa6c81e809/src/rpclib/test/interface/test_xml_schema.py