getLogger().debug(this.indent + "webapp URL: [" + webappUrl + "]");
getLogger().debug(this.indent + "anchor: [" + anchor + "]");
}
if (builder.isDocument(publication, webappUrl)) {
Document targetDocument = builder.buildDocument(publication, webappUrl);
if (getLogger().isDebugEnabled()) {
getLogger().debug(this.indent + "Resolved target document: ["
+ targetDocument + "]");
}
String currentAreaUrl = builder.buildCanonicalUrl(publication,
getCurrentDocument().getArea(),
targetDocument.getId(),
targetDocument.getLanguage());
targetDocument = builder.buildDocument(publication, currentAreaUrl);
if (targetDocument.exists()) {
rewriteLink(newAttrs, targetDocument, anchor, queryString);
} else {
setIgnoreAElement(true);
}
}