This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes a question about DOM. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "a question about DOM." Watch "a question about DOM." New topic

a question about DOM.

Philip Zac
Ranch Hand

Joined: Apr 27, 2008
Posts: 66
hello all,

I am having doubt. I do understand that DOM can help to create or manipulate HTML tags . So Is it possible for DOM to create JSTL tags or struts tag??? If yes, how and please explain with example (as I understand with example better.)

For example :

in HTML Body

in JS file

now for struts tag, is it possible:

how will it look like in js and in <div>

Thanks for your time reading and answering this..
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
You should be able to use a DOM representation of any markup that obeys strict XML rules. Typical HTML is so sloppy that XHTML is a respected but seldom used standard.

However, in my opinion, building documents with DOM is a real pain compared to other approaches. You can write code having a structure based on the DOM hierarchy and it will be faster and easier to understand.

Philip Zac
Ranch Hand

Joined: Apr 27, 2008
Posts: 66

Thanks for the reply. So it is not possible. Is that what you mean.

thank you.
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 378
Strictly speaking,
You could use DOM to churn out XHTML (which modern browsers should have no problem with). So the answer is you can.

However what Bill says is that this is task with a degree of difficulty and there might be other approaches that may be easier. From what I understood Bill is suggesting a customer built object hierarchy representing and XML document?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
It sounds to me as if you're trying to create JSTL/JSP tags using the JavaScript DOM. That won't work, because JSP tags are interpreted on the server, long before the JavaScript is executed on the client. The browser would have no idea what to do with JSTL/JSP/Struts tags.
I agree. Here's the link:
subject: a question about DOM.
It's not a secret anymore!