GeeCON Prague 2014*
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


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "a question about DOM." Watch "a question about DOM." New topic
Author

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..
philip
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12791
    
    5
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.

Bill
Philip Zac
Ranch Hand

Joined: Apr 27, 2008
Posts: 66
Hello,

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

thank you.
Philip
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
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
Marshal

Joined: Mar 22, 2005
Posts: 42030
    
  64
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.


Ping & DNS - my free Android networking tools app
 
GeeCON Prague 2014
 
subject: a question about DOM.