1# This program is free software; you can redistribute it and/or modify
2# it under the terms of the (LGPL) GNU Lesser General Public License as
3# published by the Free Software Foundation; either version 3 of the
4# License, or (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9# GNU Library Lesser General Public License for more details at
10# ( http://www.gnu.org/licenses/lgpl.html ).
11#
12# You should have received a copy of the GNU Lesser General Public License
13# along with this program; if not, write to the Free Software
14# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15# written by: Jeff Ortel ( jortel@redhat.com )
16
17"""
18Provides basic I{marshaller} classes.
19"""
20
21from suds import *
22from suds.mx import *
23from suds.mx.core import Core
24
25
26class Basic(Core):
27    """
28    A I{basic} (untyped) marshaller.
29    """
30
31    def process(self, value, tag=None):
32        """
33        Process (marshal) the tag with the specified value using the
34        optional type information.
35        @param value: The value (content) of the XML node.
36        @type value: (L{Object}|any)
37        @param tag: The (optional) tag name for the value.  The default is
38            value.__class__.__name__
39        @type tag: str
40        @return: An xml node.
41        @rtype: L{Element}
42        """
43        content = Content(tag=tag, value=value)
44        result = Core.process(self, content)
45        return result
46