// No validation
SAXBuilder builder = new SAXBuilder(false);
Document doc = builder.build(file);
// Get the variable manager for substitution
IStringVariableManager varMgr = VariablesPlugin.getDefault()
.getStringVariableManager();
// Get root element
Element root = doc.getRootElement();
List entries = root.getChildren("includepathentry");
Iterator iter = entries.iterator();
while (iter.hasNext())
{
Element element = (Element) iter.next();
String path = element.getAttributeValue("path");
if (replaceVariables)
{
try
{
// TODO: variable substitution is buggy/unsuitable
// for our purposes, as it only works in context of
// a selected resource (see ResourceResolver.java:40);
// however, we don't guarantee that there is any resource
// selected, leading to exceptions (or the selected resource
// may be something accidental, leading to erratic behavior)
String expandedPath = varMgr
.performStringSubstitution(path);
path = expandedPath;
}
catch (CoreException e)
{