How do I correctly reference georss: point in my xsd?

Posted by Chris Hinch on Stack Overflow See other posts from Stack Overflow or by Chris Hinch
Published on 2012-10-08T02:29:45Z Indexed on 2012/10/08 3:37 UTC
Read the original article Hit count: 196

Filed under:
|
|
|

I am putting together an XSD schema to describe an existing GeoRSS feed, but I am stumbling trying to use the external georss.xsd to validate an element of type georss:point. I've reduced the problem to the smallest components thusly:

XML:

<?xml version="1.0" encoding="utf-8"?>
<this>
    <apoint>45.256 -71.92</apoint>
</this>

XSD:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:georss="http://www.georss.org/georss">
<xs:import namespace="http://www.georss.org/georss"
           schemaLocation="http://georss.org/xml/1.1/georss.xsd"/>
    <xs:element name="this">
        <xs:complexType>    
            <xs:sequence>    
                <xs:element name="apoint" type="georss:point"/>   
            </xs:sequence>
        </xs:complexType>   
    </xs:element>
</xs:schema> 

If I make apoint type "xs: string" instead of "georss: point", the XML validates happily against the XSD, but as soon as I reference an imported type (georss: point), my XML validator (Notepad++ | XML Tools) "cannot parse the schema". What am I doing wrong?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about import