Pick out the invalid element naming rule for an XML element from the following…
2017
Pick out the invalid element naming rule for an XML element from the following rules :
- A.
Names can start with a number or punctuation character.
- B.
Names can contain letters, numbers, hyphens, underscores and periods.
- C.
Names cannot contain spaces
- D.
Names must not start with the letters XML in any case combination.
Attempted by 167 students.
Show answer & explanation
Correct answer: A
Invalid rule: Names can start with a number or punctuation character.
Valid XML naming rules:
An XML element name must start with a letter or underscore.
After the first character, it may contain letters, digits, hyphens, underscores, and periods.
It cannot contain spaces.
It must not start with the reserved letters
xmlin any case combination.
Why option A is invalid: A name cannot start with a digit or most punctuation characters.
Final answer: Option A is the invalid XML element naming rule.
A video solution is available for this question — log in and enroll to watch it.