• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a question about DOM.

 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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

thank you.
Philip
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic