• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

xml - addAttribute(..) error

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating 1 xml file using JDOM. I have set path for jdom.jar. Now i am getting error like -
TestXml.java:19: cannot resolve symbol
symbol : method addAttribute (org.jdom.Attribute)
location: class org.jdom.Element
TestXml.java:21: cannot resolve symbol
symbol : method addAttribute (java.lang.String,java.lang.String)
location: class org.jdom.Element
--=-
my code is here --
 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not related to your question, but this

is not a nice way of making a method. What is the return type? Is it public or private? I guess it works, but ...
I don't know anything about jdom but one of your error messages is telling you that there is no method called addAttribute which takes 2 Strings as parameters.
 
raj varma
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello William,
thnx for ur reply. let me tell u that TestXml() is a contructor, so it doesn;t have any return data type. 1 thing i have to do is to add public modifier.
[ April 16, 2003: Message edited by: raj varma ]
 
William Barnes
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, you don't want to be doing all that inside of a constructor. It isn't good form. (I am sure that there are technical reasons for this opinion.)
 
Something about .... going for a swim. With this tiny ad ...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic