Generating XML files with Java

Status
Not open for further replies.

ssjheero_yuy99

In Runtime
Messages
184
I'm looking for a way to generate XML files from scratch using Java. I have been looking around at DOM, SAX, and JAXP but am getting completely confused.

If anyone knows the a way to do this, or can point me to a good tutorial it would be very much appricated.

Thanks for reading,
 
I'm looking for a way to generate XML files from scratch using Java. I have been looking around at DOM, SAX, and JAXP but am getting completely confused.

If anyone knows the a way to do this, or can point me to a good tutorial it would be very much appricated.

Thanks for reading,
What's the problem/where are you stuck? XML files aren't special...:rolleyes: If you know the formatting/layout of your file, write a couple methods and get it done? (Sorry, not seeing what you need help with.)
 
actually, I'm kinda back to square one, I am having trouble even figuring out the parser without just copying and pasting code from online. and since this is sorta a commercial project (I'm a temporary hand working on it, so I don't know the full details on its status, but I will be asking questions at a meeting tomorrow), I can't just copy and paste the code in.

Basically I'm a c++ programmer who was thrown into the Java world. I've never taken any Java classes, (still in college with little experience), and am having troubles.

Maybe the problem is that I'm not exactly sure what the problem is.... (yea, I know I'll get some smart remarks for this one)

I know I could just write it all out using standard output to files, but my superior says that I should try and use SAX, and I know I've found a couple third-party classes that would probably do it, but they don't want to use third-party stuff either, just Java supported classes. (not wanting to have to worry about joe-smoes class errors I guess)

Ok, this rambling has helped a little. But yes, we are currently trying to hammer out the DTD, so once we know this, it might just be a simple matter of writing things out by hand and finding a validation tool to check against the DTD, (which will most likely be converted to XML Schema, so please don't start harping on how it should be an XML Schema instead).

ah... month 7 of a 3 year project... will probably all be for not anyway... but got to keep the boss happy.

ok, all this rant and not even really answering the question.... so,
"What's the problem/where are you stuck?"

I think its just not knowing Java very well and not used to having to setup soo many factories and buffers and wrappers-over-wrappers-over-wrappers, and soo many wrappers.....
 
Hah, yeah, I hadn't heard of SAX before this, but after looking at their "Quickstart", I can see your troubles, especially considering you got thrown at Java! I quickly looked over the API, and it looks like the SAX package is purely for reading the XML files (I may be wrong -- I'm fairly new in the Java world as well)...so to me, it would seem by far the most efficient, to create your own XML handler, if that is in any way an option.

But like you said, I guess that means waiting for the DTD to do any specifics. :freak:
 
Status
Not open for further replies.
Back
Top Bottom