static String extractStyle ( String style , String attribute ) { if ( style == null ) { return "" ; } StringTokenizer tokens = new StringTokenizer ( style , ";" ) ; while ( tokens . hasMoreTokens ( ) ) { String token = tokens . nextToken ( ) ; String key = token . substring ( 0 , token . indexOf ( ' ' ) ) ; if ( key . equals ( attribute ) ) { return token . substring ( token . indexOf ( ' ' ) + 1 ) ; } } return "" ; }
Extract the style value from a Inkscape encoded string