XML Naming Rules and Practices
XML elements must follow these naming rules:
- Names can contain letters, numbers, and other characters
- Names must not start with a number or punctuation character
- Names must not start with the letters xml (or XML, or Xml, etc)
- Names cannot contain spaces
Though no words are reserved for naming, and you can use any letters, numbers
for a name, but a good naming practice should be:
- Make names descriptive. For example: <firstname>, <lastname>.
- Keep a name short and simple, like: <product_name>. Do not use a name
like this: <the_name_of_the_product>.
- For separate words, You may use an underscore: <first_name>, <last_name>.
Avoid use dash "-", dot ".", and colon ":".
If you name something "first-name", or "first.name", or
first:name", some software may misunderstand it.
- If you need to use non-English letters like ¨¦¨°¨¢ in XML, your should check
with the software vendor to find out if it supports them.
|