Exemple #1
0
 def encode(self, node, content):
     if content.type.any():
         Typer.auto(node, content.value)
         return
     if content.real.any():
         Typer.auto(node, content.value)
         return
     ns = None
     name = content.real.name
     if self.xstq:
         ns = content.real.namespace()
     Typer.manual(node, name, ns)
Exemple #2
0
 def encode(self, node, content):
     if content.type.any():
         Typer.auto(node, content.value)
         return
     if content.real.any():
         Typer.auto(node, content.value)
         return
     ns = None
     name = content.real.name
     if self.xstq:
         ns = content.real.namespace()
     Typer.manual(node, name, ns)
Exemple #3
0
 def encode(self, node, content):
     if content.type.any():
         Typer.auto(node, content.value)
         return
     resolved = self.resolver.top().resolved
     if resolved is None:
         resolved = content.type.resolve()
     if resolved.any():
         Typer.auto(node, content.value)
         return
     ns = None
     name = resolved.name
     if self.options.xstq:
         ns = resolved.namespace()
     Typer.manual(node, name, ns)
Exemple #4
0
 def encode(self, node, content):
     # Add (soap) encoding information only if the resolved
     # type is derived by extension.  Further, the xsi:type values
     # is qualified by namespace only if the content (tag) and
     # referenced type are in different namespaces.
     if content.type.any():
         return
     if not content.real.extension():
         return
     if content.type.resolve() == content.real:
         return
     ns = None
     name = content.real.name
     if self.xstq:
         ns = content.real.namespace('ns1')
     Typer.manual(node, name, ns)
Exemple #5
0
 def encode(self, node, content):
     # Add (soap) encoding information only if the resolved
     # type is derived by extension.  Further, the xsi:type values
     # is qualified by namespace only if the content (tag) and
     # referenced type are in different namespaces.
     if content.type.any():
         return
     if not content.real.extension():
         return
     if content.type.resolve() == content.real:
         return
     ns = None
     name = content.real.name
     if self.xstq:
         ns = content.real.namespace('ns1')
     Typer.manual(node, name, ns)
Exemple #6
0
    def encode(self, node, content):
        """
        Add (SOAP) encoding information if needed.

        The encoding information is added only if the resolved type is derived
        by extension. Furthermore, the xsi:type value is qualified by namespace
        only if the content (tag) and referenced type are in different
        namespaces.

        """
        if content.type.any():
            return
        if not content.real.extension():
            return
        if content.type.resolve() == content.real:
            return
        ns = None
        name = content.real.name
        if self.xstq:
            ns = content.real.namespace("ns1")
        Typer.manual(node, name, ns)
Exemple #7
0
    def encode(self, node, content):
        """
        Add (SOAP) encoding information if needed.

        The encoding information is added only if the resolved type is derived
        by extension. Furthermore, the xsi:type value is qualified by namespace
        only if the content (tag) and referenced type are in different
        namespaces.

        """
        if content.type.any():
            return
        if not content.real.extension():
            return
        if content.type.resolve() == content.real:
            return
        ns = None
        name = content.real.name
        if self.xstq:
            ns = content.real.namespace("ns1")
        Typer.manual(node, name, ns)