-1

I want to parse an XMI file using jdom2, but I can't seem to get information from it. Here's an example:

element.getAttributes()  -> [[Attribute: xsi:type="coremodel:Place"],[Attribute: id="p_InitialNode1"], [Attribute: OutArcs="out_InitialNode1"]]
element.getAttributeValue("id") -> p_InitialNode1
element.getAttributeValue("xsi:type") -> null

I don't understand why I have null, when I expected coremodel:Place.

What am I doing wrong?

Tim Post
  • 33,371
  • 15
  • 110
  • 174
abdozmeir
  • 11
  • 2
  • I edited your question for clarity, and made the title a bit more descriptive so that those that can answer it are more likely to notice it. I also consolidated your tags a bit. Good luck! – Tim Post Apr 09 '15 at 08:53

1 Answers1

0

I found the solution it's just by declaring a new namespace for xsi

 Namespace namespace = Namespace.getNamespace("http://www.w3.org/2001/XMLSchema-instance");

and it works

abdozmeir
  • 11
  • 2