{'xsd':['annotation', 'simpleContent', 'complexContent',\
        'group', 'all', 'choice', 'sequence', 'attribute', 'attributeGroup',\
        'anyAttribute', 'any']}

def setUp(self, tp):
        '''
        {'xsd':['annotation', 'simpleContent', 'complexContent',\
        'group', 'all', 'choice', 'sequence', 'attribute', 'attributeGroup',\
        'anyAttribute', 'any']}
        '''
        # 
        # TODO: Need a Recursive solution, this is incomplete will ignore many
        #  extensions, restrictions, etc.
        # 
        self._item = tp
        # JRB HACK SUPPORTING element/no content.
        assert tp.isElement() is True and \
            (tp.content is None or (tp.content.isComplex() is True and tp.content.isLocal() is True)),\
            'expecting element w/local complexType not: %s' %tp.content.getItemTrace()

        self.name = tp.getAttribute('name')
        self.ns = tp.getTargetNamespace()
        self.local = tp.isLocal()

        complex = tp.content
        # JRB HACK SUPPORTING element/no content.
        if complex is None:
            self.mgContent = ()
            return
        
        #attributeContent = complex.getAttributeContent()
        #self.mgContent = None
        if complex.content is None:
            self.mgContent = ()
            self.attrComponents = self._setAttributes(complex.getAttributeContent())
            return 

        is_simple = complex.content.isSimple()
        if is_simple and complex.content.content.isExtension():
            # TODO: Not really supported just passing thru
            self.mgContent = ()
            self.attrComponents = self._setAttributes(complex.getAttributeContent())
            return

        if is_simple and complex.content.content.isRestriction():
            # TODO: Not really supported just passing thru
            self.mgContent = ()
            self.attrComponents = self._setAttributes(complex.getAttributeContent())
            return

        if is_simple:
            raise ContainerError, 'not implemented local complexType/simpleContent: %s'\
               %tp.getItemTrace()

        is_complex = complex.content.isComplex()
        if is_complex and complex.content.content is None:
            # TODO: Recursion...
            self.mgContent = ()
            self.attrComponents = self._setAttributes(complex.getAttributeContent())
            return

        if (is_complex and complex.content.content.isExtension() and 
            complex.content.content.content is not None and
            complex.content.content.content.isModelGroup()):

            self.mgContent = complex.content.content.content.content
            self.attrComponents = self._setAttributes(
                    complex.content.content.getAttributeContent()
                )
            return

        if (is_complex and complex.content.content.isRestriction() and
            complex.content.content.content is not None and 
            complex.content.content.content.isModelGroup()):

            self.mgContent = complex.content.content.content.content
            self.attrComponents = self._setAttributes(
                    complex.content.content.getAttributeContent()
                )
            return

        if is_complex:
            self.mgContent = ()
            self.attrComponents = self._setAttributes(complex.getAttributeContent())
            return

        if complex.content.isModelGroup():
            self.mgContent = complex.content.content
            self.attrComponents = self._setAttributes(complex.getAttributeContent())
            return

        # TODO: Scary Fallthru
        self.mgContent = ()
        self.attrComponents = self._setAttributes(complex.getAttributeContent())