aspose file tools*
The moose likes Java in General and the fly likes code to read the xml and also overide the value of certain attributes in xml at runtime itself Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "code to read the xml and also overide the value of certain attributes in xml at runtime itself" Watch "code to read the xml and also overide the value of certain attributes in xml at runtime itself" New topic
Author

code to read the xml and also overide the value of certain attributes in xml at runtime itself

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Hi Folks ,

I have got the following xml ...



Now I need java code that wil read the values of the attributes like lastname ,nickname,salary,age at the runtime and also I want to override the value of the lastname from mook to saral saxena then MY JAVA CLASS WOULD DO IT AT RUNTIME..!!! Please guide me for the code of java class..!!
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11419
    
  16

There should be plenty of xml parsers out there. Have you tried googling for any of them? The very first hit I got looks promising for what you need.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Hi Fred ,

yeah I have seen sax parser and dom parser ....I need if somebody can come up with the java code through which I can look upon and see the flow..!!this will make my understanding more clearer..!! thanks in advance..!!
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11419
    
  16

If you expect someone to provide you the code, you are in the wrong place. That isn't what we do here.

We will help YOU write the code yourself. I suggest you spend some time reading our HowToAskQuestionsOnJavaRanch FAQ. Specifically:

ShowSomeEffort
PatienceIsAVirtue
NotACodeMill
DoYourOwnHomework
PostRealCode
Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Hi ,
I have written the folowing code...

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Hi Folks,

Please advise on this ..I am stuck up on this...doing R&D..!!
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Ok - please explain what the code does; what is the output you got; exceptions thrown, etc.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11419
    
  16

Does the code compile? Do you know HOW to compile it? Does it run? Does it crash?

Clearly, you didn't read the FAQ as I suggested. If so, you'd know to TellTheDetails.

Folks around here tend to put as much effort into answering your question as you put into asking it. Since you are putting in almost nothing, you are getting out almost nothing. You should make it easy for us to help you, and you are not. So, most folks figure they can either spend a LOT of time trying to figure out what help you need and ultimately help one person, or spend a little time helping each of a lot of folks. Most people I know will choose the latter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: code to read the xml and also overide the value of certain attributes in xml at runtime itself