getCapabilities not valid XML (MSXML)
Steven M. Ottens
steven.ottens at GEODAN.NL
Wed Nov 14 06:48:43 PST 2007
Daniel,
I tried to remove the [ <!ELEMENT > ] bit and it still doesn't work :(
Once I remove the entire <!DOCTYPE> tag it does work, but I guess just
because it doesn't know where to validate it against.
I'll try to see if I can find what bit of the XML isn't deemed valid by
MSXML, but no guarantees that I'll find it out.
Regards,
Steven
Daniel Morissette wrote:
> Steven,
>
> The EMPTY element declaration in the DOCTYPE was simply inspired from
> the example found in the spec itself (in Annex A.2 of WMS 1.1.1 and
> also present in most/all previous revisions).
>
> I'm no XML guru so I'm not sure what the best fix is, but once you
> find out I'd invite you to file a ticket documenting the original
> problem and the new format that makes MSXML and other parsers happy.
>
> Daniel
>
> Steven M. Ottens wrote:
>> Hi all,
>>
>> My mapbuilder/openlayers application wasn't working on IE7, it
>> complained that the WMS getCapabilities doc generated by Mapserver
>> wasn't valid XML. I've finally tracked it down to the doctype
>> declaration:
>> Mapserver produces
>> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
>> <!DOCTYPE WMT_MS_Capabilities SYSTEM
>> "http://schemas.opengeospatial.net/wms/1.1.1/capabilities_1_1_1.dtd"
>> [
>> <!ELEMENT VendorSpecificCapabilities EMPTY>
>> ]> <!-- end of DOCTYPE declaration -->
>>
>> The parser removes both the <?xml ..> tag and the <!DOCTYPE ..> tag
>> from the XML before parsing. So normally the to-be-parsed XML text
>> starts with:
>> <!-- end of DOCTYPE declaration -->
>> Which is a valid piece of XML
>> However MSXML apparently thinks that the closing > after EMPTY
>> belongs to the opening < before !DOCTYPE. So instead now the XML text
>> starts with:
>> ]>
>> Which obviously isn't valid XML and MSXML fails.
>>
>> So my questions:
>> -Anyone else noticed this problem?
>> -Why is there an (empty!) ELEMENT declaration within the DOCTYPE?
>> -How can I remove this ELEMENT?
>>
>> Regards,
>> Steven
>
>
More information about the MapServer-users
mailing list