In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you a sample analysis of XML coding, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
XML documents can contain foreign characters such as Norwegian or French
In order for your parser to understand these characters, you must have a uniform character coding standard in XML documents.
Windows 95x98 notepad
Windows 95x98 notepad cannot save files in Unicode encoding format.
You can use notepad to edit and save XML documents that contain foreign characters (for example, Norwegian or French or Chinese)
Kobayashi Kobayashi will go to hot pot tonight.
But if you use a browser to open this XML document that has been edited with notepad, you will get an error open it with IE 5.0.
Use coding in Windows 95x98 notepad
Windows 95X98 notepad editing XML files must be set for encoding properties.
To avoid errors, you can add an encoding attribute to the XML document declaration to indicate the encoding type of the XML document, but do not use Unicode encoding.
The following encoding types do not cause errors, and the Chinese characters display normally:
The following encoding types do not cause errors, and the Chinese characters display normally:
The following encoding types do not cause errors, and the display of Chinese characters is abnormal (garbled):
The following encoding types do not cause errors, and the display of Chinese characters is abnormal (garbled):
The following encoding types do not cause errors, and the Chinese characters display normally:
The following encoding types can cause errors:
Use Windows 2000 notepad
Windows 2000 notepad can save files in Unicode encoded format.
Notepad for Windows 2000 supports the Unicode character set. If you use Win2000's notepad to save the XML document in Unicode encoding format (note that there is no encoding information in the XML declaration):
Kobayashi Kobayashi, let's go to hot pot tonight.
The following file, note_encode_none_u.xml, will not make errors in IE5.0+, but if you use Netscape Netscape 6.2, you may make errors. When readers compare note_encode_none.xml and note_encode_none_u.xml, there is no difference if they look at their respective source files separately, but why can one be displayed and the other can not be displayed? The answer is the Unicode character set.
Windows 2000 notepad code
Windows 2000 notepad can also save files in "UTF-16" encoding format.
If you declare the encoding attributes in the XML document and save the file in Unicode encoding format, an error may occur.
The following code will cause an error:
The following code will cause an error:
The following code will cause an error:
The following file, note_encode_utf16_u.xml, will display normally in IE5.0+ and an error will occur in Netscape Netscape 6.2 browser.
Error message
When browsing XML documents with IE5.0 or later, you may encounter two different coding errors:
An illegal character (An invalid character was found in text content) was found in the text content.
Errors may occur if your XML document does not match the encoding format of your XML document. Typically, the XML document contains some "non-English" characters, uses a single-byte encoded editor, and does not set the encoding format of the XML document in the declaration of the XML document.
Conversion from the current encoding format to another encoding format (Switch from current encoding to specified encoding not supported) is not supported.
If the XML document is saved in Unicode/UTF-16 encoding format, but the declaration of the XML document sets the encoding format to be some single-byte encoding (such as Windows-1252, ISO-8859-1 or UTF-8), or the XML document is saved in a single-byte encoding format, but the XML document declaration sets the encoding format to some Unicode/UTF-16 encoding, both cases will cause errors.
The above is all the content of this article "sample Analysis of XML coding". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.