Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

w3c

 
manu chaox
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I would like try API for html(if exists). I think it exists in packages org.w3c.dom or dom4j. I have j2se 1.5. Are these included in j2se 1.5 or not(if not where I download them?)? Does anybody have a functional code to trying(anything). Please, I need help with start of DOM.
Thank you(beginner)
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The J2SE contains the classes for the XML DOM, not the HTML DOM. You can download those from the W3C. But what exactly are you trying to do?
 
manu chaox
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For instance,I would like read properties backgroud a html page(color,...).Next, I would like write text into TextArea in html page, click a button,load page of url,...
And what org.w3c.dom.html?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not clear about the context in which you want to do this. Are you talking about Java code modifying static HTML files you have on a file system, or JavaScript modifying a page in the brower, or JSP code generating an HTML page? The approach to take depends on which of these scenarios you want to address.

And what org.w3c.dom.html?

I'm not sure what you're asking here.
 
manu chaox
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
example html page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TestPage</title>
</head>
<body>
<input style="width:150px; height:20px;" type="text" name="color" />
<input type="submit" name="button" value="send" />
</body>
</html>

This page is displayed by browser(IE,Opera,...).
Now, I�d like fill in a text into element input (for example "red") and send the text by press button(by java code).
 
manu chaox
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought,org.w3c.dom.html solves this problem, but I don't how I use this.
Or do I mistake?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, you're talking about a page being displayed in the browser. The only way to fill in those values and submit the form programmatically is via JavaScript - there is no Java involved, and no XML. Just to be clear: JavaScript is executed on the client, while Java is executed on the server (unless you're talking about an applet, but I don't think you are).

Is this really a question in the XML Certification?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic