예제 #1
0
파일: attribute.py 프로젝트: knorby/pyxsd
 def __str__(self):
     """
     Prints its name in a form that allows for quick identification
     of an attribute, without needing a bulky name that does not
     match the name used.
     """
     return "%s|%s|%s" % (self.getContainingTypeName(),
                          self.__class__.__name__,
                          ElementRepresentative.getName(self))
예제 #2
0
    def getName(self):
        """
        Mostly normal getName(), except it includes a means to make
        a type name if the type is the child of an element or
        some other tag. That name should look like this:

        `elementName`|`type tag type`

        No parameters
        """
        name = ElementRepresentative.getName(self)
        
        if not name == None:    return name

        # We are implicitly defined in an element
        element  = self.parent
        
        name = '%s|%s' % (element.name, self.tagType) 
        
        element.typeName = name
        
        return name
예제 #3
0
    def getName(self):
        """
        Mostly normal getName(), except it includes a means to make
        a type name if the type is the child of an element or
        some other tag. That name should look like this:

        `elementName`|`type tag type`

        No parameters
        """
        name = ElementRepresentative.getName(self)

        if not name == None: return name

        # We are implicitly defined in an element
        element = self.parent

        name = '%s|%s' % (element.name, self.tagType)

        element.typeName = name

        return name