[Standards] XEP-0080: examples 1 and 2 don't pass validity check with XML Schema

Matthijs van der Vleuten zr40.nl at gmail.com
Tue Feb 22 23:31:46 UTC 2011


The XEP-0080 schema does define an accuracy element. Also, XML itself defines the xml:lang attribute. 

On 22 feb 2011, at 21:23, Sergey Fedoseev wrote:
> $ cat -n example1.xml
>     1	<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
>     2	  <country>Italy</country>
>     3	  <lat>45.44</lat>
>     4	  <locality>Venice</locality>
>     5	  <lon>12.33</lon>
>     6	  <accuracy>20</accuracy>
>     7	</geoloc>
> 
> $ xmlstarlet val -s geoloc.xsd -e example1.xml
> example1.xml:1: Element '{http://jabber.org/protocol/geoloc}geoloc',
> attribute '{http://www.w3.org/XML/1998/namespace}lang': The attribute
> '{http://www.w3.org/XML/1998/namespace}lang' is not allowed.

XML itself defines the xml:lang attribute. Are you sure your validator is correct?

> example1.xml:6: Element '{http://jabber.org/protocol/geoloc}accuracy':
> This element is not expected. Expected is one of
> ( {http://jabber.org/protocol/geoloc}postalcode,
> {http://jabber.org/protocol/geoloc}region,
> {http://jabber.org/protocol/geoloc}room,
> {http://jabber.org/protocol/geoloc}speed,
> {http://jabber.org/protocol/geoloc}street,
> {http://jabber.org/protocol/geoloc}text,
> {http://jabber.org/protocol/geoloc}timestamp,
> {http://jabber.org/protocol/geoloc}uri ).
> example1.xml - invalid

The XEP-0080 schema does define an accuracy element, although only since version 1.6. I suspect you're using the schema of version 1.5, since the speed element was added in that version.


More information about the Standards mailing list