def getStyleValue(defaultValue, key, xmlElement):
 if ('style' in xmlElement.attributeDictionary):
  line = xmlElement.attributeDictionary['style']
  strokeIndex = line.find(key)
  if (strokeIndex > (-1)):
   words = line[strokeIndex:].replace(':', ' ').replace(';', ' ').split()
   if (len(words) > 1):
    return words[1]
 if (key in xmlElement.attributeDictionary):
  return xmlElement.attributeDictionary[key]
 if (xmlElement.parent == None):
  return defaultValue
 return getStyleValue(defaultValue, key, xmlElement.parent)

def getStyleValue ( defaultValue , key , xmlElement ) : if ( 'style' in xmlElement . attributeDictionary ) : line = xmlElement . attributeDictionary [ 'style' ] strokeIndex = line . find ( key ) if ( strokeIndex > ( - 1 ) ) : words = line [ strokeIndex : ] . replace ( ':' , ' ' ) . replace ( ';' , ' ' ) . split ( ) if ( len ( words ) > 1 ) : return words [ 1 ] if ( key in xmlElement . attributeDictionary ) : return xmlElement . attributeDictionary [ key ] if ( xmlElement . parent == None ) : return defaultValue return getStyleValue ( defaultValue , key , xmlElement . parent )
get the stroke value string .