Well, yeah, the classes in the javax.xml.parsers package for a start. But you'll need more than the API documentation for you to be able to use them. Right now you're flailing around and firing random questions at the forum because you don't know the basics. I would suggest you read some tutorials. Like for example this one:
Ha believe me, I have been reading tutorials... more than you would believe
Ill try this one though, thanks
I mean I basically know what needs to happen here, and I dont think I even need this class I posted this thread about, because Im already using simplexml to deserialize my xml. It is the java that happens afterwards that is giving me trouble.
I need to follow something like:
XML -> simple XML -> java objects -> tree model
and here is my method to read the xml:
So the data has been converted right? Now I just need to go through that data and pick out certain pieces. It might help if someone could tell me what the data looks like after it is put through the method above.
You want to know what that code does? Then you're going to have to ask the person who wrote it. It uses a lot of classes which aren't in the standard API. And whatever it does, it doesn't look suitable to me. Just from the names of the classes. I don't see why a "Device" class would be useful for building a tree structure.
I think I have said this before, but I think you should desist from your idea that you can grab some random code off the internet and somehow make it do what you want. So far all that has got you is a bunch of random code which you don't understand.
Well, I apologize too. From the questions you were asking, it very much looked like you didn't have a clue about XML. But perhaps the problem is... well, I don't know. Here's a question that you asked:
It might help if someone could tell me what the data looks like after it is put through the method above.
Well, it's a Device object. It isn't XML any more because you parsed it into a Java object. So asking "what the data looks like" is... how can I put it... it's a peculiar question. What you have is a Device object.
And here's another question you asked:
Now I just need to go through that data and pick out certain pieces.
Well, it's a Device object. It's got for example a getName() method. So if you want to pick out the name, you call its getName() method. This isn't an XML question at all. It's just Java. So I'm confused. On the one hand you've written some code which does XML-to-object binding, which is quite sophisticated, but on the other hand you appear not to know what that code produces. Perhaps that's what led me to believe that you were just copying and pasting other people's code.
Anyway, again I didn't mean to be rude. My answers were based solely on what I saw in your posts, and I was confused.
But obviously you're confused too, that's why you're asking here. And now I've lost track of what your question was.
Matt Kohanek wrote:If you are still so inclined, would you mind telling me what to call xyz in the following: <tag attribute=y>xyz</tag>
I know what to call the tag and attribute, but I dont know what the correct word is to refer to xyz
Here's a straightforward question I can answer: that's a text node.
Ha, I very much am clueless about xml honestly. And it took me about...all of April to come up with the code I have there. So I am expecting something similar for the problems I am having now, but the thing is I need to have this tree working by mid June, which is why I am looking at tons of different example code and asking so many questions.
Thanks for the response to my previous question, you and I both wish my questions were all that simple lol