Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

replacing string

 
Neel Chow
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help desparately.
I have a XML file like this.

<?xml version = "1.0"?>
<Kdemo_WFC Version="1.0" >
<Request Action="Logon" Object="System" Username="Superuser" password="kdemo" />
<Request Action="LoadAllQueries">
<HyperFindQuery
VisibilityCode="Private" />
</Request>
<Request Action="Logoff" Object="System" />
</Kdemo_WFC>

I have tons of user in a database and I have to run this xml api for all the user. essentially I have to change the username everytime in the loop.
my question is
1. how can I replace the username with a given name using string manipulation.
2.is there any other way to do it(SAX/DOM)?

Thanks
 
Arto Pastinen
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Maby easiest way is to use some regular expression for it.

Artsi
 
Barry Higgins
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you not just use 2 strings to sandwich the username?

something like ...



Hope this helps,
Barry
[ February 17, 2005: Message edited by: Barry Higgins ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic