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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:02:17+00:00 2026-05-18T07:02:17+00:00

I have the following XML: <?xml version=1.0 encoding=utf-8 ?> <lastconnectedServers> <Server ip=172.24.18.240 domain=MyDomain> <SharedFolder

  • 0

I have the following XML:

<?xml version="1.0" encoding="utf-8" ?>
<lastconnectedServers>
   <Server ip="172.24.18.240" domain="MyDomain">
        <SharedFolder name="MyShared" type="FTP"/>
        <SharedFolder name="Share1" type ="CIFS"/>
        <SharedFolder name="Share2" type ="both"/>
   </Server>
</lastconnectedServer>

I need to read Attribute and Node values. I am able to get the number of child nodes but unsure how to get the value:

CComPtr<IXMLDOMDocument> pIxmlDOC = NULL;
    CComPtr<IXMLDOMParseError> pIxmlDOM = NULL;
    CComPtr<IXMLDOMElement> pIxmlServerElement;
    CComPtr<IXMLDOMNode> pIxmlServerNode,pIxmlLastConnectedServerNode;
    CComPtr<IXMLDOMNodeList> pIXmlNodeChildList = NULL;


    IXMLDOMNode* pInsertedNode;

    BSTR bstrXML = NULL;
    VARIANT vXMLSource;
    VARIANT_BOOL bIsSuccess;
    HRESULT hr = CoInitialize(NULL);

    LONG lChildCount = 0;

    CHK_HR(CreateAndInitDOM(&pIxmlDOC));    
    VariantFromString(L"stocks.xml",vXMLSource);

    pIxmlDOC->load(vXMLSource,&bIsSuccess);

    pIxmlDOC->get_childNodes(&pIXmlNodeChildList);

        pIXmlNodeChildList->get_length(&lChildCount);

        for(int i = 0; i < lChildCount; i++)
        {
            CComPtr<IXMLDOMNamedNodeMap> pIXMLNodeMap;
            CComPtr<IXMLDOMNode> pIXMLChildNode;

            pIXmlNodeChildList->get_item(i,&pIXMLChildNode);
            pIXMLChildNode->get_attributes(&pIXMLNodeMap);

        }
  • 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-05-18T07:02:18+00:00Added an answer on May 18, 2026 at 7:02 am

    A quick search through MSDN would have saved you a lot of time:

    HRESULT getNamedItem(
        BSTR name,
        IXMLDOMNode **namedItem);
    

    See: http://msdn.microsoft.com/en-us/library/ms767592(v=VS.85).aspx

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

Sidebar

Related Questions

Say I have the following web.config: <?xml version=1.0 encoding=utf-8?> <configuration> <system.web> <authentication mode=Windows></authentication> </system.web>
I have the following XML: <?xml version=1.0 encoding=UTF-8?> <gnm:Workbook xmlns:gnm=http://www.gnumeric.org/v10.dtd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://www.gnumeric.org/v9.xsd> <office:document-meta xmlns:office=urn:oasis:names:tc:opendocument:xmlns:office:1.0
I have the following layout: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent> <GridView android:id=@+id/grid
I have following XML schema: <?xml version=1.0 encoding=UTF-8 standalone=no?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=content type=contentType/>
I have the following XML structure: <?xml version=1.0 ?> <course xml:lang=nl> <body> <item id=787900813228567
I have the following xml I'd like to deserialize into a class <?xml version=1.0
I have the following XML document: <projects> <project> <name>Shockwave</name> <language>Ruby</language> <owner>Brian May</owner> <state>New</state> <startDate>31/10/2008
Let's say I have following Spring config (version of Spring is 3.0.3): <?xml version=1.0
I have the following xml that's sent to me from a web service. I'm
Is it possible to merge elements using XSLT. If I have the following XML

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.