Read an xml
Hi,Iam developing a plugin, I have two queries1. i want read an xml and validate it against a dtd from plugin. How can i do it?2. How to read a file from plugin project, eg. i have a plugin project abc, in this i have a directory xyz, i want to read a file from xyz, when user runs this plugin,(i cannot use current project).Can anyone pls help.
请先登录再写评论。
1) If you want to run validation as "action", see com.intellij.xml.actions.validate.ValidateXmlActionHandler. If you want to contribute custom DTD to known namespaces in IDE (so DTD validation works in editor automatically) use com.intellij.javaee.StandardResourceProvider.
2) If you want to access file packaged in your plugin distribution you can use java.lang.Class#getResource