if (mxmlData.getNumUnits() == 0)
return;
boolean foundRootTag = false;
IMXMLTextData asDoc = null;
// Walk the top-level units of the MXMLData.
for (IMXMLUnitData unit = mxmlData.getUnit(0); unit != null; unit = unit.getNextSiblingUnit())
{
if (unit instanceof IMXMLInstructionData)
{
if (unit.getStart() > 0)
{
ICompilerProblem problem = new MXMLXMLProcessingInstructionLocationProblem(unit);
builder.addProblem(problem);
}
}
else if (unit instanceof IMXMLTagData)
{
if (!foundRootTag)
{
foundRootTag = true;
processRootTag(builder, (IMXMLTagData)unit, asDoc);
}
else
{
ICompilerProblem problem = new MXMLMultipleRootTagsProblem(unit);
builder.addProblem(problem);
}
}
else if (unit instanceof IMXMLTextData)
{
IMXMLTextData textData = (IMXMLTextData)unit;
if (textData.getTextType().equals(TextType.ASDOC))
asDoc = textData;
if (!builder.getMXMLDialect().isWhitespace(textData.getCompilableText()))
{
if (documentNode == null)
{
ICompilerProblem problem = new MXMLContentBeforeRootTagProblem(unit);
builder.addProblem(problem);