Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7713481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:53:11+00:00 2026-06-01T01:53:11+00:00

I am getting response from web service in xml format and data are inside

  • 0

I am getting response from web service in xml format and data are inside cData section in xml nodes. now when i am trying to extract node value then getting value with cdata text. how can i remove this and get text inside cdata. Please suggest me the best way of doing it. write now i am using regular expression to remove cdata from the result value. Thanks in advance.![!CDATA[Xyz]].

<ResumeParserData>
    <ResumeFileName><![CDATA[]]></ResumeFileName>
    <ParsingDate><![CDATA[3/29/2012 1:37:33 AM]]></ParsingDate>
    <TitleName><![CDATA[]]></TitleName>
    <FirstName><![CDATA[abc]]></FirstName>
    <Middlename><![CDATA[Kr]]></Middlename>
    <LastName><![CDATA[abc]]></LastName>
    <Email><![CDATA[xyz@gmail.com]]></Email>
    <Phone><![CDATA[+91 8527502445]]></Phone>
</ResumeParserData>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:53:13+00:00Added an answer on June 1, 2026 at 1:53 am

    right now i am using regular expression to remove cdata from the result value

    Well I’d stop using regular expressions to parse XML to start with.

    Use an XML API – LINQ to XML is lovely, for example. This should transparently let you get at the text, without you even having to know it was ever in a CDATA section unless you really want to. For example, with an XML file like this:

    <parent>
      <child>
        <![CDATA[Foo]]>
      </child>
    </parent>
    

    We can get to the text like this:

    using System;
    using System.Xml.Linq;
    
    class Test
    {
        static void Main()
        {
            var doc = XDocument.Load("test.xml");
            var child = doc.Root.Element("child");
            var text = child.Value;
            Console.WriteLine("Text: {0}", text);
        }
    }
    

    EDIT: With a slight change to the code above:

    using System;
    using System.Xml.Linq;
    
    class Test
    {
        static void Main()
        {
            var doc = XDocument.Load("test.xml");
            foreach (var child in doc.Root.Elements())
            {
                Console.WriteLine("{0}: {1}",
                                  child.Name, child.Value);
            }
        }
    }
    

    … when I run that on the XML in the question, I get:

    ResumeFileName:
    ParsingDate: 3/29/2012 1:37:33 AM
    TitleName:
    FirstName: abc
    Middlename: Kr
    LastName: abc
    Email: xyz@gmail.com
    Phone: +91 8527502445
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a response from a web service call in XML format. I
I am getting responses from two different web services in XML format. Both web
I'm getting an Ajax response from a web service, and I'm not sure what
Im getting my data from a web service and loads to a list view.
I am getting this error while trying to Parse the Xml response from the
I am getting JSON response from the server..Inside that JSON string i am having
I'm trying to POST a http request using ajax, but getting a response from
I'm trying to parse a web service response using SAXParser and get certain values,
I am using iPhone to get data from my web service. Because I wan't
I am trying to use a web service built on asp.net wcf from iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.