Five occasions using XML [Collection Article]

xiaoxiao2021-03-06  66

I have encountered many people in many seminars and training courses. They still don't understand why I don't know how to use XML in their applications. Some reports from the Gartner Company suggest that commercial companies cannot do outsiders, and cannot be ignored to XML. If you still don't know what is the benefits of XML, you are not the only one.

I decided to organize the conversation with people and the media about the topic of XML topics, listing the five most favorite usage of XML in the app. Although these do not include all potential applications of XML, at least some of the most important areas.

1, data exchange

Data exchange between applications and companies is not secret, there is no doubt that should be listed as the first. So why is the status of XML in this field? The reason is that XML uses elements and attributes to describe data. During data transfer, XML always retains a data structure such as a parent / sub-relation. Several applications can share and resolve the same XML file without having to use a traditional string parsing or dismantling process.

Conversely, ordinary files do not describe each data paragraph (except in header files) or not to retain the data relationship structure. Data exchange using XML can make the application more flexible because you can access XML data with a position (same as normal files) or by element name (from database).

2, Web service

Web services are one of the most exciting revolutions, which allows people using different systems and different programming languages ​​to communicate and share data. Its basis lies in the web server to exchange data between the system. Exchange data typically uses an XML tag that can make the protocol to obtain specifications, such as on the Simple Object Protocol, SOAP platform.

SOAP can pass messages between objects constructed in different programming language. This means that a C # object can communicate with a Java object. This kind of communication can even occur between objects running on different operating systems. DCOM, CORBA or Java RMI can only pass messages between tightly coupled objects, and SOAP can pass messages between loosely coupled objects.

3, content management

XML only uses elements and properties to describe data without providing data display methods. In this way, XML provides an excellent way to mark content independent of the platform and language.

Using languages ​​like XSLT to easily convert an XML file into a variety of format files, such as HTML, WML, PDF, Flat File, EDI, and more. XML has the ability to run between different system platforms and convert to different format target files, making it an excellent choice in the content management application.

4, web integration

There are now more and more devices also support XML. Make the web developer can deliver data with XML between personal electronic assistants and browsers.

Why send XML text directly into such equipment? The purpose of this is to let users master the data display method and experience the happiness of practice. Conventional Customer / Services (C / S) mode To obtain data sorting or replacement display format, you must issue an application to the server; while XML can directly process data, do not have to apply for queries to the server - return the result of such a bidirectional "journey", At the same time, there is no need to formulate the database.

Even the XML files on the device can be modified and the result is returned to the server. Imagine a refrigerator with an Internet feature and support XML will bring how big impact on the market. You have never had to get up early to get your milk!

5, formulation

Many applications store formulated data in various files, such as .ini files. Although such file format has been used for many years and has been used very well, XML is still formulated to formulate data in a more excellent way. Using the class .NET, such as XMLDocument and XMLTextReader, mark the formatted data as an XML format, which can make it more readable, and can easily integrate into the application system. Applications using XML formulated files can easily handle the required data, do not need to be recompiled like other applications to modify and maintain the application system.

转载请注明原文地址:https://www.9cbs.com/read-111003.html

New Post(0)