// Javadoc inherited.
protected int exprElementEnd(
MarinerRequestContext context,
PAPIAttributes papiAttributes)
throws PAPIException {
IncludeAttributes attributes = (IncludeAttributes) papiAttributes;
if (attributes.getHref() == null) {
throw new PAPIException(
exceptionLocalizer.format("include-href-missing"));
} else {
// @todo this is a bit duff since it relies on markup naming not to change; do this a different way
// Set up the markup that will be sent down the pipeline
StringBuffer markup = new StringBuffer();
InputSource inputSource;
markup.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
markup.append("<urid:fetch xmlns:urid=\"").
append(Namespace.URID.getURI()).append("\" href=\"").
append(attributes.getHref()).
append("\"");
if (attributes.getParse() != null) {
markup.append(" parse=\"").
append(attributes.getParse()).
append("\"");
}
if (attributes.getEncoding() != null) {
markup.append(" encoding=\"").
append(attributes.getEncoding()).
append("\"");
}
markup.append("/>");