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

  • SEARCH
  • Home
  • 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 8883187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:45:19+00:00 2026-06-14T20:45:19+00:00

i am using xerces 3 in my c++ program . i would like some

  • 0

i am using xerces 3 in my c++ program .
i would like some one to guide me , how to extract text between start and end tag in sax parsing .
for example , suppose we have :

<?xml version="1.0"?>
<catalog>
   <book id="123">
      <author>Introduction to algorithm </author>
    </book>
</catalog>

how to access this text : ‘Introduction to algorithm’

  • 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-14T20:45:20+00:00Added an answer on June 14, 2026 at 8:45 pm

    If I remember correctly, you write your own handler inheriting from HandlerBase. startElement() will be called at <author> and then endElement() will be called at </author>. All text in between will be passed to characters(), so you need to know when you are inside <author></author>, and make use of this to save the characters to a useful place inside your characters() function: http://xerces.apache.org/xerces-c/apiDocs-3/classHandlerBase.html

    When I did this (some time ago) I just cheated and had everything as attributes, which are passed in to startElement() and saves a lot of hassle.

    EDIT: I made my own example and had the same problem (which you didn’t describe well in the question, and would have been easier to work out if you’ld provided your code, by the way).
    Look at the documentation (note I wasn’t careful about checking which version, but still):

    virtual void characters (const XMLCh *const chars, const XMLSize_t length)
    

    Then check the actual header file.

    virtual void characters
    (
        const   XMLCh* const    chars
        , const unsigned int    length
    );
    

    Spot the difference? Make your own version’s signature match the header file, it will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Xerces in Java. I would like to parse an HTML document
I am using Xerces-c in my project, and would like to create a single
I am using Xerces 2.9.1 to perform some XML parsing. The XML contains namespace
i am using Xerces to do some xml writing. here's a couple of lines
I'm using the Xerces C++ DOM parser to read some XML files in a
I am using SAX2 from Xerces-C to read an XML document. However, I would
Using Xerces SAX parser I try to retrieve all elements and their attributes of
In my c++ code and in using xerces for sax parsing , i want
I'm using xerces(http://xerces.apache.org) lib to parse a XML file in C++, so I downloaded
I am trying to convert an Xml String to XML DOM object using Xerces

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.