• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can I identify the attributes for my DIV tag.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a situation that has me stumped.

I am modifying an existing java program that alters html code. The version of Java is 1.4.2. I don't have a choice over this. It is a packaged system that isn't likely to change soon. My task is to read some of the attributes for a DIV tag and based on those attributes append some code to the onload statement for the body of the html.

I know how I would do this if I were using javascript to access the attributes but this task requires that I use this existing java program.

To this point I have started by getting an enumeration of all of the elements in the html file. I look for DIV elements and when I find one, I try to enumerate through the names of the attributes for it. I am not able to do a search of all elements by name because the name will always be different. The class name is the only thing that will stay constant.

I keep getting a compiler error when I try to instantiate the attribute class at this point. I don't see a class definition that contains the name and the value of the attribute.

If someone could point me in the right direction, or even in a direction that I haven't traveled yet, I would greatly appreciate the help.

Thanks much,

Doug Harding
State of Utah
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I would say that since you're asking about how to change your Java code, it would have been better to post the question in one of the Java in General forums. No doubt one of the local moderators will move it there soon, but in the meantime I would strongly suggest you post the code where the compiler error is happening. And the compiler error itself, of course. It's pretty hard to say anything useful about your code when we can't see any of it. Likewise when we don't know anything about the error message.
reply
    Bookmark Topic Watch Topic
  • New Topic