LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

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

Rep: Reputation: 0
how to parse the xml string


hi,

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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><isAdminResponse xmlns="http://tectonas.com/"><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
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,251

Rep: Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026
which programming language?
 
Old 09-03-2008, 08:49 AM   #3
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,282

Rep: Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088Reputation: 1088
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.
Quote:
Q: "How do I write a subroutine|program to do this-or-that?"
A: "Don't!"
Quote:
Dictum Ne Agas: "Do Not Do A Thing Already Done."

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


Reply

Tags
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/Novell 2 10-24-2004 10:19 AM
fontconfig expat xml parse PROBLEMS!! OrganicOrange84 Linux - Software 0 08-18-2004 12:35 PM


All times are GMT -5. The time now is 05:04 AM.

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