code: private void extractAttributes(final String attributes)
  	{
  		String s = attributes.trim();
  		if (s.length() > 0 && s.charAt(s.length() - 1) == '/')
  			emptyTag = true;
  
  		while (s.length() != 0) {
  			final int equal = s.indexOf('=');
  			if (equal == -1 || equal == s.length() - 1)
  				break;
  			// cut off attribute name
  			final String att = s.substring(0, equal).trim();
  			s = s.substring(equal + 1).trim();
  			if (s.length() == 0)
  				break;
  			final boolean quote = s.charAt(0) == '\'' || s.charAt(0) == '\"';
  			if (att.length() > 0 && quote) {
  				String value = s.substring(1);
  				final int end = value.indexOf(s.charAt(0));
  				if (end >= 0)
  					value = value.substring(0, end);
  				attributeName.add(att);
  				attributeValue.add(References.replace(value, false));
  			}
  			final int i = s.indexOf(quote ? s.charAt(0) : ' ', 1);
  			s = i == -1 ? "" : s.substring(i + 1);
  		}
  	}
docs: adds all available attributes to current element