exception);
}
node.setScriptElement(script);
scripts.add(script);
} else {
ExternalHtmlScriptElementImpl script = new ExternalHtmlScriptElementImpl(node);
if (scriptSourcePath != null) {
try {
scriptSourcePath = UriUtilities.encode(scriptSourcePath);
// Force an exception to be thrown if the URI is invalid so that we can report the
// problem.
new URI(scriptSourcePath);
Source scriptSource = context.getSourceFactory().resolveUri(
htmlSource,
scriptSourcePath);
script.setScriptSource(scriptSource);
if (!context.exists(scriptSource)) {
reportValueError(
HtmlWarningCode.URI_DOES_NOT_EXIST,
scriptAttribute,
scriptSourcePath);