Is this legal?
<?xml version="1.0" encoding="UTF-8"?>
<Glāžšķūņa Rūķīši="7">
</Glāžšķūņa>
I know I can use all kinds of characters in the content and attribute values, bu开发者_运维问答t can I use them in tag names and attribute names as well?
Yes, this is legal. See also http://www.w3.org/TR/2008/REC-xml-20081126/#charsets
In particular this part:
The first character of a Name MUST be a NameStartChar, and any other characters MUST be NameChars; this mechanism is used to prevent names from beginning with European (ASCII) digits or with basic combining characters. Almost all characters are permitted in names, except those which either are or reasonably could be used as delimiters. The intention is to be inclusive rather than exclusive, so that writing systems not yet encoded in Unicode can be used in XML names. See J Suggestions for XML Names for suggestions on the creation of names.
Yes, a sample here: http://www.opentag.com/xfaq_charrep.htm#char_nonasciitag
<?xml version="1.0" encoding="utf-8" ?>
<Собирание версия="1.2-3">
<Объект id="12">
<НомерОбъекта>45-3454-123</НомерОбъекта>
<ВНаличии>123</ВНаличии>
<Описание xml:lang="ja">第二発電機</Описание>
</Объект>
<Объект id="64">
<НомерОбъекта>45-7894-456</НомерОбъекта>
<ВНаличии>123</ВНаличии>
<Описание xml:lang="ja">手動ウォーター・ポンプ</Описание>
</Объект>
</Собирание>
精彩评论