try {
ITypedRegion[] partitions = document.computePartitioning(0, document.getLength());
for (ITypedRegion partition : partitions) {
if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START)) {
try {
TMLRegion tmlInfo = TMLRegion.parse(partition, document);
TMLTagDefinitions tagDef = TMLTagDefinitions.getInstance(_versionCompliance);
if (tagDef != null) {
TMLTag tag = tagDef.getTagByName(tmlInfo.getTagName());
if (tag != null) {
List<String> tmpAttributes = new ArrayList<String>();
tmpAttributes.addAll(tmlInfo.getAttributeNames());
tmpAttributes.addAll(tmlInfo.getValuelessAttributes());
Iterator<String> attributes = tmpAttributes.iterator();
while (attributes.hasNext()) {
String attribute = attributes.next();
if (tag.getName().equals("include") || tag.getName().equals("portlet")) {
if (attribute.startsWith("o_")) {
// attributes starting with "o_" mean implicit options - do not validate
continue;
}
}
int charStart = partition.getOffset();
int charEnd = charStart + partition.getLength();
int attributeStart = tmlInfo.getContent().indexOf(attribute);
if (attributeStart != -1) {
charStart = charStart + attributeStart;
charEnd = charStart + attribute.length();
}
if (tag.getAttribute(attribute) == null) {