File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes replacing string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "replacing string" Watch "replacing string" New topic
Author

replacing string

Neel Chow
Ranch Hand

Joined: Jan 10, 2005
Posts: 55
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

Joined: Dec 13, 2002
Posts: 79
Hi!

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

Artsi
Barry Higgins
Ranch Hand

Joined: Jun 05, 2003
Posts: 89
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: replacing string