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.
2 comments
Comment actions Permalink

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

0
Comment actions Permalink
Thanks for you reply,In my plugin i have few settings , in the form of an xml file, my requirement is read the xml, validate it against dtd and add it in my custom settings page,
0

Please sign in to leave a comment.