[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Allowable characters for NCName, assuming the ASCIIcharact


ncname
Depends on what you mean by "allowable". If you mean, what characters 
will appear in your documents (where you presumably limit the characters 
to ASCII characters in some fashion), I believe you're correct. If you 
mean what characters an XML Schema-based validator will accept, it would 
be all of the Unicode characters that match the NCName production, 
regardless of whether they're ASCII or not.

-- Ron

Roger L. Costello wrote:

> 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.-_]*



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.