Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-03-2008, 05:55 AM   #1
LQ Newbie
Registered: Aug 2008
Posts: 6

Rep: Reputation: 0
how to parse the xml string


I am using SOAP to send the request to the web server which gives me back the response to my request.The response which I get back is also an xml file and is as follows.......

HTTP/1.1 200 OK
Date: Wed, 03 Sep 2008 05:55:54 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 345

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd=""><soap:Body><isAdminResponse xmlns=""><isAdminResult>true</isAdminResult></sAdminResponse></soap:Body></soap:Envelope>

Now what I want to do is I want to obtain the result from this entire xml string. I want "true" particularly for this example and want to store in the file.I am not getting how to obtain this from xml file.Please help me out.........

Thanks in advance...
Old 09-03-2008, 07:58 AM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
which programming language?
Old 09-03-2008, 08:49 AM   #3
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,515
Blog Entries: 4

Rep: Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964
Every programming-language (let's take Perl, for example...) is going to provide you with a very large infrastructure of existing code that can handle both HTML and, separately, XML.

Using Perl as a typical example, "everything in the world can be found in an archive called CPAN." (Every other language you can name has a similar archive of actively tested and maintained code.)

Perl also has a favorite acronym: TMTOWTDI = "There's More Than One Way To Do It."

If I were using Perl, then I know that a CPAN-library unit called CGI will provide anything I could possibly require in the way of interpreting that HTML-envelope ... everything from that HTTP/1.1 200 OK line through the first blank line. In other words, I don't have to "write" any code of my own to do that.

CGI also provides all of the low-level functionality that I may need to send the HTTP reply back.

The same is true of the XML: I don't have to write anything new. In fact, CPAN gives me many dozens of off-the-shelf tools both for building and for interpreting ("parsing") XML.

On top of that, there's layer-upon-layer of existing, tested software that I can "simply use." Stuff that I absolutely do not have to write. Stuff that is used by tens-of-thousands of active web sites "just like mine." Or, yours. Frameworks for complete web-sites or for any portion thereof.
Q: "How do I write a subroutine|program to do this-or-that?"
A: "Don't!"
Dictum Ne Agas: "Do Not Do A Thing Already Done."

Last edited by sundialsvcs; 09-03-2008 at 08:51 AM.


file, parsing, xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
parse a string in perl 2007fld Programming 13 08-07-2007 02:41 PM
Parse XML in bash script MikeyCarter Linux - Software 1 02-16-2007 01:19 PM
Parse a perl string djgerbavore Programming 3 10-31-2004 07:23 AM
kopete icq can't parse xml-documents ungua SUSE / openSUSE 2 10-24-2004 10:19 AM
fontconfig expat xml parse PROBLEMS!! OrganicOrange84 Linux - Software 0 08-18-2004 12:35 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration