Parse CDATA section in C++ using SAX

Posted on 2004-10-22
Last Modified: 2012-08-14
I am trying to parse CDATA section in my xml file using c++ and SAX parser.
Somehow it skipping the CDATA tag completely and I am unable to parse it.
Could you send me the snippet of code or so?
Question by:pb_india
    LVL 86

    Assisted Solution

    Are you using SAX 1.0? SAX2 seems to be able to do that - see
    LVL 2

    Author Comment

    using SAX2
    But its still skiping the the element CDATA

    I wan tto know if I am setting the flags right
    LVL 12

    Accepted Solution

    there is virtual void       startCDATA ()=0 in LexicalHandler Class of  Xerces-C++ library.

    welcome to
    LVL 17

    Assisted Solution

    I'd expect the data to appear as characters data without the CDATA escape characters. Are you not getting the CDATA content? If not, you might want to check that you've got the escape sequence right. Try looking at the XML document in IE to check its well-formedness.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
    This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now