views:

78

answers:

2

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, but can I use them in tag names and attribute names as well?

+5  A: 

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.

ankon
@ankon: Good point! +1
o.k.w
+1  A: 

Yes, a sample here: http://www.opentag.com/xfaq%5Fcharrep.htm#char%5Fnonasciitag

<?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">手動ウォーター・ポンプ</Описание>
 </Объект>
</Собирание>
o.k.w