Try to avoid using Chinese XML tags

Source: Internet
Author: User
Tags format xml parser
xml| Chinese

The use of XML tags in Chinese or English is a constant topic and a point of contention when working with a standard workgroup. From the perspective of implementation, we tend to use English (as I have always insisted). Although the XML standard requires that the parser implementation must support Unicode, it does not fully support or even completely unsupported the implementation of Chinese XML tags everywhere. If the target user of your XML document is global, then the label using ASCII characters is the safest way.

The reasons for the strong demand for the use of Chinese are generally as follows:

Chinese is easy to read (for people, this is from the national conditions:), with Chinese characteristics;
When communicating with other countries or organizations, it can increase the bargaining chip (in Chinese language, which means that the property of independent property rights is more);
To enhance the competitiveness of domestic manufacturers (this is based on the assumption that domestic manufacturers should be stronger than Chinese processing, although the assumption is difficult to establish);
......
I do not think these reasons are sufficient. When considering legibility, the use of labels in Chinese or English is not very significant. As long as the XML content (label content, attribute content, annotations, and so on) is localized (as it should be), the readability of the XML document can be basically guaranteed. It is perfectly acceptable to have a small discount for readability in exchange for implementation guarantees. The use of Chinese labels does not imply ownership, as there are many examples of foreign serve China of the country's existing achievements in the market. Finally, I have doubts about the competitive advantage of domestic manufacturers in Chinese processing (we don't even have a mature XML parser to hand out; a news organization uses XML internally as a format for manuscripts because the format uses Chinese tags and is encountering many difficulties in implementation).

From a technical point of view, effective xml:50 specific Ways to improve the XML book item 2 Mark up with ASCII if Your and item Write in possible De had a good discussion of the problem. I deeply agree with the author of the following two views:

The ASCII is still the best choice for markup (which, element names, attribute names, and so on), especially markup that nee DS to is shared among many different developers with many cultures and languages. The simple fact are that in English and ASCII are the lowest common denominator for technical communication to the world.
However, the situation is very different for content; That's, for PCDATA and attribute values. Here, the text must is highly localized.
Of course, everything is not absolute. If your application is limited to a small range, or applies to a full Chinese environment, and you have a highly supported parser on hand (and the customer environment can meet those requirements), it is also possible to use the Chinese label. Some friends do like to read fully-Chinese XML documents, if they can do it, and why not:



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.