← Prev in month ← Prev in thread

Allowable characters for NCName, assuming the ASCII character set?

From
Roger L. Costello <>
To
'XML Developers List' <>
Date
2005-07-26T19:12:10Z
ID
<>
Thread
Allowable characters for NCName, assuming the ASCII character set?
Hi Folks,
 
Suppose that I create XML documents, restricting myself to just using the
ASCII character set.
 
And suppose that I declare an element to have the datatype NCName:
 
    <element name="foo" type="NCName"/>
 
What are the allowable characters for <foo>?
 
I believe that the answer is: [a-zA-Z_][a-zA-Z0-9.-_]*

Here's how I arrived at my answer:

The production rule for NCName in the XML specification:

NCName ::=  (Letter | '_') (NCNameChar)* 

NCNameChar ::=  Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender 

Given that I am just using the ASCII character set,

    Letter is a-zA-X
    Digit is 0 - 9
    CombiningChar and Extender are characters outside the ASCII character
set (I think)

Do you agree that, given the restriction of using only ASCII characters, the
set of characters that can be used in <foo> is: [a-zA-Z_][a-zA-Z0-9.-_]*

/Roger
← Prev in month ← Prev in thread