String charset = getCharacterEncoding();
if (charset != null) options.setCharset(charset);
IRI cl = getContentLocation();
if (cl != null && !cl.isAbsolute()) {
IRI r = new IRI(getUri());
cl = r.resolve(cl);
}
String base = (cl != null) ? cl.toASCIIString() : getUri();
Document<T> doc = parser.parse(getReader(), base, options);
EntityTag etag = getEntityTag();
if (etag != null) doc.setEntityTag(etag);