XsltRunConfiguration (@NotNull XmlFile file) { assert XsltSupport.isXsltFile(file) : "Not an XSLT file: " + file.getName(); mySuggestedName = file.getName(); setName(mySuggestedName); final VirtualFile virtualFile = file.getVirtualFile(); assert virtualFile != null : "No VirtualFile for " + file.getName(); setXsltFile(virtualFile); final PsiFile[] associations = FileAssociationsManager.getInstance(file.getProject()).getAssociationsFor(file); if (associations.length > 0) { final VirtualFile assoc = associations[0].getVirtualFile(); assert assoc != null; setXmlInputFile(assoc); } final XmlDocument document = file.getDocument(); assert document != null : "XSLT file without document?"; final XmlTag rootTag = document.getRootTag(); assert rootTag != null : "XSLT file without root element?"; final XmlTag[] params = rootTag.findSubTags("param", XsltSupport.XSLT_NS); for (XmlTag param : params) { final String name = param.getAttributeValue("name"); if (name != null) { final Pair<String, String> pair = Pair.create(name, null); myParameters.add(pair); } } final XmlTag[] outputs = rootTag.findSubTags("output", XsltSupport.XSLT_NS); for (XmlTag output : outputs) { final String method = output.getAttributeValue("method"); if ("xml".equals(method)) { setFileType(XmlFileType.INSTANCE); } else if ("html".equals(method)) { setFileType(HtmlFileType.INSTANCE); } else if ("text".equals(method)) { setFileType(FileTypes.PLAIN_TEXT); } } return this; }