In Visual C + +. NET implements XML parsing

Source: Internet
Author: User
Tags ini web services win32 xslt winsxs folder

For most developers, Web services have become something of the same kind, because they view the Internet as the best way to promote application applications. Some Web services, such as the Amazon.com Web service, are public and are easily required to be included in the application. Some other web services are private and require access to specific knowledge. Regardless of which Web service is involved, they all rely on XML to pass data. Therefore, XML parsing is the first thing developers think of when it comes to Web services.

Other uses of XML parsing

XML parsing is not limited to Web services, for example. NET application can use XML as a storage method for configuration information. The thing you need to do is to have one. Manifest file, it must have the same name as the application, and the CLR (Common language runtime) automatically looks up the file to find configuration information.

For example, listing 1 shows the addition to one. The XML of the manifest file. This checklist tells the CLR to use Windows XP theme information to draw a standard control that does not affect the controls that you draw. Note that the version number of the file may change, and you can view the current version number in the system's \windows\winsxs folder. The name of the folder for this parallel library might resemble x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a, The processorarchitecture value shown in Listing 1 appears first, followed by the name value, followed by the PublicKeyToken value, and finally the version value.

List 1..net.manifest file dependent XML

Program code:



Name= "ShowMessage"
version= "1.0.0.0"
processorarchitecture= "x86"
/>


Name= "Microsoft.windows.common-controls"
version= " 6.0.0.0 "
processorarchitecture=" X86
publickeytoken= "6595b64144ccf1df"
language= "*"
/>


You can also create other types of profiles that your application can analyze during the startup process. These files can contain any information that the application needs to execute. You can use these configuration files instead of registry settings. In general, you will find that using XML files is less error than using the registry, and they are also more flexible. For example, when migrating a user from one computer to another, you do not necessarily need to reconfigure the application because the settings information already appears in the application's directory. In some ways, this means that we are back in the past using the INI file, but the XML file contains much more information than the INI file and can reduce some form of corruption and configuration errors.

XML makes web pages easier to read when combined with other technologies, such as Extensible Stylesheet Language Transformations, XSLT. However, you can also apply such techniques to the interior. For example, many companies use this form of XML as a way to build the Help files used by users. This help information appears as data in an XML file and can be converted to visual output by the browser using an XSLT file. Applications can display this information using HTML-compliant controls. As for users, they don't care whether the data comes from a standard help file or another source of information.

Ultimately, XML can become a major data storage technology. Some vendors have already discussed their XML products. You can also find some XML storage products, such as Microsoft Office. Simply put, you may end up finding that you need to include analytics in your application to load and display data.

Related Article

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.