if (plot instanceof Histogram) {
_base = base;
_source = source;
_text = text;
HistogramMLParser parser = new HistogramMLParser((Histogram) plot);
if ((source != null) && !source.trim().equals("")) {
URL xmlFile = new URL(base, source);
InputStream stream = xmlFile.openStream();
parser.parse(base, stream);
stream.close();
}
if ((text != null) && !text.equals("")) {
// NOTE: Regrettably, the XML parser we are using cannot
// deal with having a single processing instruction at the
// outer level. Thus, we have to strip it.
String trimmed = text.trim();
if (trimmed.startsWith("<?") && trimmed.endsWith("?>")) {
trimmed = trimmed.substring(2, trimmed.length() - 2).trim();
if (trimmed.startsWith("plotml")) {
trimmed = trimmed.substring(6).trim();
parser.parse(base, trimmed);
}
// If it's not a plotml processing instruction, ignore.
} else {
// Data is not enclosed in a processing instruction.
// Must have been given in a CDATA section.
parser.parse(base, text);
}
}
} else {
super.configure(base, source, text);
}