Parsing XML string

Let's say I have a simple XML string such like this:

String xmlString = "<xml ...><root><child attribute='value' /></root>";

How can I parse this string using intellij.util.xml package classes? I would like (for example) get the child's attribute value. How can I do this?

2 comments
Comment actions Permalink

Hello Wojtek,

The classes in the com.intellij.util.xml package are not designed for parsing
simple XML strings. You can accomplish your task far easier using the JDOM
library which is bundled with IntelliJ IDEA.

Let's say I have a simple XML string such like this:

String xmlString = "<xml ...><root><child attribute='value'
/></root>";

How can I parse this string using intellij.util.xml package classes? I
would like (for example) get the child's attribute value. How can I do
this?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Ok, thanks for fast answer. :)

0

Please sign in to leave a comment.