java dom question

R

Ryan Gaffuri

The sun walkthrough covers too many things other than straight DOM. I
am having trouble following it. I have a few questions

1. I need to download xerces.jar and put it in my class path to use
DOM right?
2. Can I read plain text into a DOM and have it create the xml for me?
If so how? Everything I see deals with having XML and a valid DTD or
Schema and having DOM verify it?

I read the W3Schools walkthrough, the sun walkthrough and the java
almanac.
 
A

Alex Kizub

Ryan said:
The sun walkthrough covers too many things other than straight DOM. I
am having trouble following it. I have a few questions

1. I need to download xerces.jar and put it in my class path to use
DOM right?

If it will need something else it will tell you.
2. Can I read plain text into a DOM and have it create the xml for me?
If so how? Everything I see deals with having XML and a valid DTD or
Schema and having DOM verify it?

This is true when your "plain text" is xml :)))
And you dont need DTD. Well formated xml (if you know what it is) ia all
what you need.
It's so easy and mentioned in thousands examples and tutorials.
DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder();
Document in = xdb.parse(new ByteArrayInputStream((byte[]) value));
That's all.
I read the W3Schools walkthrough, the sun walkthrough and the java
almanac.

Why not start with some SUN examples like
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPDOM3.html

Alex Kizub.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top