[Featureserver] fs namespace undefined for GML?

Christopher Schmidt crschmidt at metacarta.com
Sat Nov 1 12:12:56 EDT 2008


On Mon, Oct 27, 2008 at 10:18:46AM -0400, Tom MacWright wrote:
> Hey,
> First off - thanks a ton for your work on FeatureServer, it looks like a
> great lightweight option to 'fill in the gaps' of an open-source mapping
> stack.
> 
> I'm working on writing a parser for WFS in PHP (generalized, but initially
> targeted to the Drupal CMS), and I've come across an issue: SimpleXML, PHP's
> validating parser, rejects the GML output of FeatureServer, and for good
> reason: the WFS server included is hardcoded to point to example.com [1],
> and there doesn't seem to be a schema definition file anywhere in the
> FeatureServer download. 

Where the xmlns points to shouldn't play any role in the validation
process, as far as I'm aware. These are just unique identifiers -- so
long as they are maintained through the schema definitions, they should
be fine. However, the problem that you're likely having is that there
*is* no schema for FeatureServer output: it's based on hacking things
together, not based on following the wfs-basic schema.

My first recommendation would be: tell your PHP parser to not validate
your XML data. FeatureServer output is going to cause you more pain than
its worth if you do this.

My second recommendation is to learn enough about XML Schemas to write
one that works for general FeatureServer output, though I have no idea
if that's possible. (In the past, I've had to write specific schemas for
the database/columns being made available, which may well be true here.)



> I'm wondering - is there a description available
> anywhere, or has anyone written one? It seems odd that example.com is
> hardcoded into this, and I think it would be a simple-enough thing to patch
> (possibly adding another var to featureserver.cfg?), so if that's needed or
> wanted, I'd love to pitch in.

I'd recommend first changing the XML file manually to figure out what
changes you need to make to get your PHP code to accept the file. I
expect that if it's actually validating XSD, then you're going to be
needing to do a fair amount more work (though it is possible that simply
dropping the xsi:schemaLocation will cause PHP to stop moaning...)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Featureserver mailing list