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 9205115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:52:35+00:00 2026-06-17T23:52:35+00:00

Im trying to load HTML with Xerces DOMDocument C++ Parser and search for specific

  • 0

Im trying to load HTML with Xerces DOMDocument C++ Parser and search for specific HTML Elements. I am having trouble finding good examples on how to accomplish this. All I seem to find is parsing XML. Can someone assist? Thanks.

  • 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-17T23:52:37+00:00Added an answer on June 17, 2026 at 11:52 pm

    Take a look at this: http://xerces.apache.org/xerces-c/program-dom-3.html

    There is an example with DOMDocument as well:

    //
    // Create a small document tree
    //

    {
        XMLCh tempStr[100];
    
        XMLString::transcode("Range", tempStr, 99);
        DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(tempStr, 0);
    
        XMLString::transcode("root", tempStr, 99);
        DOMDocument*   doc = impl->createDocument(0, tempStr, 0);
        DOMElement*   root = doc->getDocumentElement();
    
        XMLString::transcode("FirstElement", tempStr, 99);
        DOMElement*   e1 = doc->createElement(tempStr);
        root->appendChild(e1);
    
        XMLString::transcode("SecondElement", tempStr, 99);
        DOMElement*   e2 = doc->createElement(tempStr);
        root->appendChild(e2);
    
        XMLString::transcode("aTextNode", tempStr, 99);
        DOMText*       textNode = doc->createTextNode(tempStr);
        e1->appendChild(textNode);
    
        // optionally, call release() to release the resource associated with the range after done
        DOMRange* range = doc->createRange();
        range->release();
    
        // removedElement is an orphaned node, optionally call release() to release associated resource
        DOMElement* removedElement = root->removeChild(e2);
        removedElement->release();
    
        // no need to release this returned object which is owned by implementation
        XMLString::transcode("*", tempStr, 99);
        DOMNodeList*    nodeList = doc->getElementsByTagName(tempStr);
    
        // done with the document, must call release() to release the entire document resources
        doc->release();
    };
    

    … and so long.

    EDIT:

    But how do I load HTML into the DOMDocument and search against the html elements?
    Thats what Im trying to figure out.

    XercesDOMParser parser;

    parser.loadGrammar(“grammar.dtd”, Grammar::DTDGrammarType);

    parser.setValidationScheme(XercesDOMParser::Val_Always);

    Handler handler;

    parser.setErrorHandler( &handler );

    parser.parse(“xmlfile.xml”);

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

Sidebar

Related Questions

I'm having a problem whereby I am trying to load some html onto a
I ran into a bit of trouble while trying to load an external HTML
I am trying to dynamicaly load specific html files into a container DIV with
hi I'm trying to load up a html file via a Custom Alert box,
I'm trying to load a local web page executing: var html = document.open('google.html'); document.documentElement.innerHTML
I am trying to load the FULL source code of an HTML website into
I am trying to load mysql data from my database from a html select
I am trying to use load() to place some html into a div on
I'm trying to load an HTML page that has text fields into a webview,
I'm trying to dynamically load html into a popup using ajax with this: $('body').load(

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.