public static String getAbsoluteURI(String urlString, String base)
          throws TransformerException
  {
    if (base == null)
      return getAbsoluteURI(urlString);

    String absoluteBase = getAbsoluteURI(base);
    URI uri = null;
    try
    {
      URI baseURI = new URI(absoluteBase);
      uri = new URI(baseURI, urlString);
    }
    catch (MalformedURIException mue)
    {
      throw new TransformerException(mue);
    }

    return replaceChars(uri.toString());
  }
public static String getAbsoluteURI ( String urlString , String base ) throws TransformerException { if ( base == null ) return getAbsoluteURI ( urlString ) ; String absoluteBase = getAbsoluteURI ( base ) ; URI uri = null ; try { URI baseURI = new URI ( absoluteBase ) ; uri = new URI ( baseURI , urlString ) ; } catch ( MalformedURIException mue ) { throw new TransformerException ( mue ) ; } return replaceChars ( uri . toString ( ) ) ; }
Take a SystemID string and try to turn it into a good absolute URI.

@param urlString SystemID string
@param base The URI string used as the base for resolving the systemID

@return The resolved absolute URI
@throws TransformerException thrown if the string can't be turned into a URI.