private void transformTag(StringBuffer target,SourceCode cfml,Tag tag,URL url) throws MalformedURLException {
  char quote=0;
  boolean inside=false;
  StringBuffer value=new StringBuffer();
  while (!cfml.isAfterLast()) {
    if (inside) {
      if (quote != 0 && cfml.forwardIfCurrent(quote)) {
        inside=false;
        target.append(add(url,value.toString()));
        target.append(quote);
      }
 else       if (quote == 0 && (cfml.isCurrent(' ') || cfml.isCurrent("/>") || cfml.isCurrent('>')|| cfml.isCurrent('\t')|| cfml.isCurrent('\n'))) {
        inside=false;
        target.append(new URL(url,value.toString()));
        target.append(cfml.getCurrent());
        cfml.next();
      }
 else {
        value.append(cfml.getCurrent());
        cfml.next();
      }
    }
 else     if (cfml.forwardIfCurrent('>')) {
      target.append('>');
      break;
    }
 else {
      for (int i=0; i < tag.attributes.length; i++) {
        if (cfml.forwardIfCurrent(tag.attributes[i])) {
          target.append(tag.attributes[i]);
          cfml.removeSpace();
          if (cfml.isCurrent('=')) {
            inside=true;
            target.append('=');
            cfml.next();
            cfml.removeSpace();
            quote=cfml.getCurrent();
            value=new StringBuffer();
            if (quote != '"' && quote != '\'')             quote=0;
 else {
              target.append(quote);
              cfml.next();
            }
          }
        }
      }
      if (!inside) {
        target.append(cfml.getCurrent());
        cfml.next();
      }
    }
  }
}

private void transformTag ( StringBuffer target , SourceCode cfml , Tag tag , URL url ) throws MalformedURLException { char quote = 0 ; boolean inside = false ; StringBuffer value = new StringBuffer ( ) ; while ( ! cfml . isAfterLast ( ) ) { if ( inside ) { if ( quote != 0 && cfml . forwardIfCurrent ( quote ) ) { inside = false ; target . append ( add ( url , value . toString ( ) ) ) ; target . append ( quote ) ; } else if ( quote == 0 && ( cfml . isCurrent ( ' ' ) || cfml . isCurrent ( "/>" ) || cfml . isCurrent ( '>' ) || cfml . isCurrent ( '\t' ) || cfml . isCurrent ( '\n' ) ) ) { inside = false ; target . append ( new URL ( url , value . toString ( ) ) ) ; target . append ( cfml . getCurrent ( ) ) ; cfml . next ( ) ; } else { value . append ( cfml . getCurrent ( ) ) ; cfml . next ( ) ; } } else if ( cfml . forwardIfCurrent ( '>' ) ) { target . append ( '>' ) ; break ; } else { for ( int i = 0 ; i < tag . attributes . length ; i ++ ) { if ( cfml . forwardIfCurrent ( tag . attributes [ i ] ) ) { target . append ( tag . attributes [ i ] ) ; cfml . removeSpace ( ) ; if ( cfml . isCurrent ( '=' ) ) { inside = true ; target . append ( '=' ) ; cfml . next ( ) ; cfml . removeSpace ( ) ; quote = cfml . getCurrent ( ) ; value = new StringBuffer ( ) ; if ( quote != '"' && quote != '\'' ) quote = 0 ; else { target . append ( quote ) ; cfml . next ( ) ; } } } } if ( ! inside ) { target . append ( cfml . getCurrent ( ) ) ; cfml . next ( ) ; } } } }
transform a single tag
