if (qName.compareToIgnoreCase("SCRIPT") == 0)
{
inScript = true;
if (this.version == EPUBVersion.VERSION_2)
{
report.message(MessageId.SCP_004, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), qName));
}
ScriptElement scriptElement = new ScriptElement();
boolean isExternal = false;
for (int i = 0; i < attributes.getLength(); i++)
{
String attrName = attributes.getQName(i);
String attrValue = attributes.getValue(i);
if (attrName.equalsIgnoreCase("src"))
{
isExternal = true;
}
scriptElement.addAttribute(attrName, attrValue);
}
if (isExternal)
{
report.info(this.fileName, FeatureEnum.SCRIPT, "external");
}
else
{
report.info(this.fileName, FeatureEnum.SCRIPT, "tag");
}
scriptElements.add(scriptElement);
}
else
{
HashSet<String> scriptEvents = OPSHandler30.getScriptEvents();
HashSet<String> mouseEvents = OPSHandler30.getMouseEvents();
for (int i = 0; i < attributes.getLength(); i++)
{
String attrName = attributes.getLocalName(i).toLowerCase();
if (scriptEvents.contains(attrName))
{
this.inlineScriptCount++;
if (this.version == EPUBVersion.VERSION_2)
{
report.message(MessageId.SCP_004, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
}
report.message(MessageId.SCP_006,
new MessageLocation(this.fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
String attrValue = attributes.getValue(i);
CheckForInner(attrValue);
}
if (mouseEvents.contains(attrName))
{
if (this.version == EPUBVersion.VERSION_2)
{
report.message(MessageId.SCP_004, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
}
report.message(MessageId.SCP_009,
new MessageLocation(this.fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
}
}
}
}