ITextRegion attrNameRegion = null;
while (node != null && isValidScriptingRegionType(node.getType())) {
node = node.getPrevious();
}
ITextRegionList regions = node.getRegions();
if (regions.size() > 4 && regions.get(1).getType() == DOMRegionContext.XML_TAG_NAME) {
ITextRegion potentialLanguageRegion = regions.get(1);
String potentialLanguageString = node.getText(potentialLanguageRegion);
if (potentialLanguageString.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT)) {
for (int i = 0; i < regions.size(); i++) {
ITextRegion region = regions.get(i);
String regionType = region.getType();
if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
attrNameRegion = region;
else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
String attrName = node.getText(attrNameRegion);