Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

XML Parsing inside JIRA Plugins

SJ September 29, 2015

Hi Folks,

I am writing a plugin for JIRA where i have to parse XML response inside my code. I was trying many things but nothing worked for me.

What is the best way to parse XML response inside Java file. What dependency i have to put in my pom.xml ?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2015

Hi Senthil!

SaxParser is part of JDK so you can use it and no need to add extra dependencies. Just searched JIRA sources for XML parsing and see it's widely utilized there. If you have sources you can do the same by searching for "SAXParser".

Even without JIRA sources googling will reveal you a lot of documentation and tutorials smile.

SJ September 30, 2015

Thanks for your input. Let me try and get back to you. I have an another question here, I was using the below imports, import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; What should be the dependency in pom.xml ?

Titus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2015

As Volodymyr mentioned, a sax parser is part of the jdk. So there is no need to add anything for that to the pom.xml. Just: import javax.xml.parsers.SAXParser; and instantiate a new parser using: SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();

TAGS
AUG Leaders

Atlassian Community Events