Msxml2 usage notes

Source: Internet
Author: User

During this period of development, you need to parse and read the XML file. The workflow of msxml2 is summarized and memorized.

Of course, intelligent pointers ccomptr and ccombstr are generally used to encapsulate COM interface pointers and BSTR strings.

Nonsense: MSXML is a set of COM interfaces provided by Microsoft. Includes the following interfaces:

1: ixmldomdocument: Generally, the smart pointer ccomptr <>

It is an interface at the entire document level to obtain instances of the MSXML service. You can use the following method to obtain: Hr = cocreateinstance (clsid_domdocument30, null, clsctx_inproc_server, iid_ixmldomdocument, (void **) & pxmldoc );

2: ixmldomnode. Call load (File Name) or loadxml (obtained XML file) in ixmldomdocument ).

3: ixmldomnodelist. Call get_childnodes in ixmldomnode to obtain nodelist.

Get_length () is used to obtain the number of subnodes contained in the list.

Get_item () is used to obtain the corresponding node

4. ixmldomelement. You can directly convert the corresponding node interface pointer to the corresponding ixmldomelement pointer. Call get_text () to obtain the node content.

 

Supplement:

Ccomptr, display release call. Release ().

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.