|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Jdom with XMI FilesHy everybody...
I'm trying to manipulate a XMI file with Jdom, and I have experienced some difficulties doing it. For example: All the subnodes of the root Element have the "same name", but have different attributes. How can I choose a specific "Element", by specifying it's attributes? Another point is that the attributes started with "xmi:" aren't recognized by Jdom. I've already tested a bunch of things to make it recognizable, but all of them were unsuccessful. =/ I think that my problems are quite easy to solve, but I haven't found anything that could help me in the web. If Jdom isn't a great tool with XMI, could you suggest me other? *Xmi file that i want to read: http://www.omg.org/spec/UML/20061001/Superstructure.cmof Cheers, Fábio Leal _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@... |
|
|
RE: Jdom with XMI FilesIt's a good idea to show the code you were using, then
people can tell you where you went wrong.
It looks a bit as if you haven't grasped how namespaces
work, but without seeing your attempts, that's a guess.
Michael Kay
_______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@... |
|
|
|
|
|
Re: Jdom with XMI FilesLe 23-nov.-08 à 04:09, Fabio Leal a écrit : I'm trying to manipulate a XMI file with Jdom, and I have experienced some difficulties doing it. XPath only can do that, it's equivalent to serial search. Something such as: xmiNS = Namespace.getNamespace("xmi","http://schema.omg.org/spec/XMI/2.1");XPath x = new XPath("./*[@xmi:type='cmof:Comment'])x.addNamsepace(xmiNS) Another point is that the attributes started with "xmi:" aren't recognized by Jdom. of course they are, they are attributes with namespace. element.getAttribute("id",xmiNS);I've already tested a bunch of things to make it recognizable, but all of them were unsuccessful. =/ paul _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@... |
|
|
Re: Jdom with XMI FilesThanks for everybody, especially Paul Libbrecht and Will Martinez.
I'm going to mix XPath and JDom in my job. XPath is quite easy to learn and helped me a lot here. If somebody needs a help with XPath, mail-me and I can show the tutorial that I used. :D Cheers, Fábio Leal _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@... |
| Free embeddable forum powered by Nabble | Forum Help |