xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Ye" <eri...@locus.apache.org>
Subject Re: xml:lang Attribute
Date Mon, 14 Aug 2000 22:18:28 GMT
It is really sticky to use attribute "xml:lang" , or any attribute with
reserved prfix "xml:", with Schema validation. The mean reason is prefix
"xml:" is always bound to  a specially reserved namespace URI
"http://www.w3.org/XML/1998/namespace", however there is no special Schema
with the same targetNameSpace as such. Maybe we should raise this issue to
W3C schema working group.

For now, I suggest you not use "xml:lang" with Schema validation, instead,
since the sole purpose of "xml:lang" is to facilitate the application to
identify the language in which the document is written, you can define you
own 'ad hoc' attribute to carry such information.

Schema also defined a simple type named "language" , which basically is the
counterpart of LanguageID in XML 1.0 Rec.   You can "type" your attribute as
"language" type in order to get it validated.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Hollenbeck, Scott" <shollenb@netsol.com>
To: <general@xml.apache.org>
Cc: "Hollenbeck, Scott" <shollenb@netsol.com>
Sent: Monday, August 14, 2000 11:25 AM
Subject: xml:lang Attribute


> Sorry if this is a FAQ or something; the archives appear to be
inaccessible
> at the moment.
>
> I seem to be unable to get Xerces Java to recognize a declaration for the
> xml:lang attribute.  Am I doing something wrong, or have I hit a known
> issue?  Here's the relevant sections of my schema:
>
> <schema xmlns="http://www.w3.org/1999/XMLSchema"
>         xmlns:xml="http://www.w3.org/TR/REC-xml"
>         xmlns:epp="http://www.NSIRegistry.net/FOO"
>         targetNamespace="http://www.NSIRegistry.net/FOO"
>         elementFormDefault="qualified">
>
>   <element name="response-text" type="epp:clientTextType" maxLength="80"/>
>   <complexType name="clientTextType" content="textOnly">
>     <attribute name="xml:lang" type="string" default="en-US"/>
>   </complexType>
>
> </schema>
>
> here's the element from the XML instance:
>
> <response-text xml:lang="en-US" >This is text</response-text>
>
> and here's the error I get:
>
> [Error] example.xml:15:54: Attribute "xml:lang" must be declared for
element
> type "response-text".
>
> What have I done wrong?
>
> Scott Hollenbeck
> Network Solutions, Inc. Registry
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
>
>


Mime
View raw message