There are three message formats currently encountered: xml, fixed-length message, and variable-length message.
This is just a brief introduction. In the future, you should learn more about how to analyze the three, and then continue to update. ——2016.9.23
XML is designed to transmit and store data.
HTML is designed to display data.
XML is nothing special. It's just plain text. Any software capable of processing plain text can process XML.
However, applications that can read XML can process XML tags in a targeted manner. The functional meaning of labels depends on the characteristics of the application.
Example:
XML 使用简单的具有自我描述性的语法:<br /><br /><?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>George</to> <from>John</from> <heading>Reminder</heading> <body>Don't forget the meeting!</body>
The tags in the above example are not defined in any XML standard (such as
This is because XML does not have predefined tags.
The tags used in HTML (and therefore the structure of HTML) are predefined. HTML documents only use tags defined in the HTML standard (such as
,
XML allows creators to define their own tags and their own document structure.
Advantages and disadvantages:
High readability and easy to maintain;
International standard format, not easy to be intercepted by firewalls;
The node is bloated, takes up a lot of memory, and transfers slowly.
The most widely used message at present.
Definition: Use a fixed length to represent a piece of information. Fixed length means fixed length, that’s how I understand it for the time being.
Advantages: Eliminate redundant nodes and transmit data faster.
Limitations: Worry that the length of the defined domain will be lengthened in the future, and the configuration or program will change accordingly, making maintenance difficult.
Example:
For example, define an 18-byte message: abcde12345fghigklm
abcde is a domain, 12345 is a domain, and fghigklm is a domain. These are defined by the writer. If business requirements require adding a date to the message, the message needs to be modified to: abcde12345fghigklm20160923, which is now a 26-byte message.
If the fixed-length message contains multiple fields, and the formats of the fields are changed later, this situation highlights the limitations of the fixed-length message.
Combines the maintainability of xml and the small space occupied by fixed-length messages.
<span style="color: #008080;">1</span> <span style="color: #000000;">例子:03abc051234502ef </span><span style="color: #008080;">2</span> 说明:03 此域的长度标识(没有规范命名,暂且成为长度标识),向后取3位,即:abc<br />3 05 此域的长度标识,向后取5位,即: 12345<br />4 02 向后取2位,即: ef