OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] attribute name/namespace question

[ Lists Home | Date Index | Thread Index ]

thanks to all answers. very unfortunate that it is not allowed, but 
that's the way it is and we have to find a different solution.

chris


G. Ken Holman wrote:
> At 2005-03-26 15:12 +0100, Christof wrote:
> 
>> element and attribute names may include a colon character in their name
>> as far as I understand the XML specification.
> 
> 
> By XML 1.0[1] technically yes, but the second note in section 2.3 after 
> production [3] states: The Namespaces in XML Recommendation [XML Names] 
> assigns a meaning to names containing colon characters. Therefore, 
> authors should not use the colon in XML names except for namespace 
> purposes, but XML processors must accept the colon as a name character.
> 
> Note the use of "should" and "must" ... which is why I said "technically 
> yes".
> 
>> therefore something like the following should be possible:
>>
>>         <x xmlns:prefix="exampleuri"
>>                 prefix:attname="default-value"
>>                 prefix:prefix:attname="ref-to-new-value"/>
> 
> 
> By XML Namespaces 1.0[2] no.
> 
> According to the productions in XML Namespaces 1.0:
> 
> [6]  QName ::=  (Prefix ':')? LocalPart
> [7]  Prefix ::=  NCName
> [8]  LocalPart ::=  NCName
> 
> Where "NCName" is a "no colon name", that is, name characters not 
> including the colon.  And, since it is obvious you are using features of 
> XML Namespaces by the namespace declaration, the rules of XML Namespaces 
> certainly apply and you cannot fall back solely on the technicality of XML.
> 
> So, two colons are not allowed in a name in your situation.
> 
> I hope this helps.
> 
> ...................... Ken
> 
> [1] http://www.w3.org/TR/2004/REC-xml-20040204
> [2] http://www.w3.org/TR/1999/REC-xml-names-19990114
> 
> 
> -- 
> World-wide on-site corporate, govt. & user group XML/XSL training.
> G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
> Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
> Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
> Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/x/bc
> Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
> 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS