<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Le 23-nov.-08 à 04:09, Fabio Leal a écrit :</div><div><blockquote type="cite">I'm trying to manipulate a XMI file with Jdom, and I have experienced some difficulties doing it. <br>For example: <br>All the subnodes of the root Element have the "same name", but have different attributes.<br> How can I choose a specific "Element", by specifying it's attributes?</blockquote><div><br></div><div>XPath only can do that, it's equivalent to serial search. Something such as:</div><div><pre><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="white-space: normal; ">xmiNS = Namespace.getNamespace("xmi","<a href="http://schema.omg.org/spec/XMI/2.1">http://schema.omg.org/spec/XMI/2.1</a>");</span></font></pre><pre><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="white-space: normal; ">XPath x = new XPath("./*[@xmi:type='cmof:Comment'])</span></font></pre></div><div>x.addNamsepace(xmiNS)</div><br><blockquote type="cite">Another point is that the attributes started with "xmi:" aren't recognized by Jdom.</blockquote><div><br></div><div>of course they are, they are attributes with namespace.</div><div><pre><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; white-space: normal; ">element.getAttribute("id",xmiNS);</span></pre></div><div><br></div><blockquote type="cite"> I've already tested a bunch of things to make it recognizable, but all of them were unsuccessful. =/<br>I think that my problems are quite easy to solve, but I haven't found anything that could help me in the web. <br clear="all">If Jdom isn't a great tool with XMI, could you suggest me other?<br></blockquote></div><br><div>paul</div></body></html>