I suddenly started getting this message too.<div><br></div><div>I'm not entirely sure what happened - I've had tinyOWS running without a hitch for a couple of months now and then all of a sudden I start to get </div>
<div>"xml is not valid"</div><div>And peeping into the logs gives me:</div><div><font class="Apple-style-span" face="'courier new', monospace">[Sat Feb 19 12:42:34 2011] [ERROR] Element '{<a href="http://my.namespaceurl.com/}area">http://my.namespaceurl.com/}area</a>': This element is not expected. Expected is one of ( {<a href="http://my.namespaceurl.com/}date_created">http://my.namespaceurl.com/}date_created</a>, {<a href="http://my.namespaceurl.com/}date_modified">http://my.namespaceurl.com/}date_modified</a>, {<a href="http://my.namespaceurl.com/}username">http://my.namespaceurl.com/}username</a>, {<a href="http://geoserver.loftmyndir.is/}origin">http://geoserver.loftmyndir.is/}origin</a> ).</font></div>
<div> </div><div>Funnily enough this does not happen to all layers - simple layers (as in with few attributes, in my case only numeric area and a text field for comments) seem unaffected.</div><div><br></div><div>I can't for the life of my figure out why this popped up all of sudden - the only thing I can relate this to is a system-wide upgrade I made on my box, which is running ubuntu 8.0.4. LTS box- and if I correlate my tinyows.logs with /var/log/apt/term.log I see that the "Expected is one of [...]" only start to appear around the time I upgraded libxml2 to libxml2 (2.6.31.dfsg-2ubuntu1.5) (I have no idea what version I was running before that).</div>
<div><br></div><div>I'm going to see whether I can downgrade libxml2 and see if it changes anything.</div><div><br></div><div>Or am I maybe barking up the completely wrong tree here?</div><div><br></div><div>Kind regards,</div>
<div>Gissur</div><div><br></div><div><br><br><div class="gmail_quote">On Mon, Jan 31, 2011 at 10:05 PM, Jean-François Gigand <span dir="ltr"><<a href="mailto:jean-francois@gigand.fr">jean-francois@gigand.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
For an 1.0.0 insert request, I get the exception "xml isn't valid"<br>
with the following error:<br>
[Mon Jan 31 21:11:05 2011] [ERROR] Element '{<a href="http://domain.net/}name" target="_blank">http://domain.net/}name</a>':<br>
This element is not expected. Expected is (<br>
{<a href="http://domain.net/}deleted" target="_blank">http://domain.net/}deleted</a> ).<br>
<br>
"name" and "deleted" are (among others) valid feature attributes.<br>
If I change the attribute elements order in my test request XML file,<br>
and follow exactly the PostgreSQL column order for that table, it<br>
works.<br>
<br>
I am surprised. The WFS spec doesn't require a proper feature<br>
attribute order in the list, does it?<br>
<br>
Having checked the w3schools doc about XML Schema, the <xs:sequence><br>
element requires the element order to be respected.<br>
I see that validation is done by libxml2, and of course is done well.<br>
<br>
The problem, within the use cases of TinyOWS, is that PostgreSQL does<br>
not provide any way to alter columns position.<br>
<br>
You would say that the app should anyway fetch the feature schema by<br>
issuing a DescribeFeatureType request, and deal with the features<br>
according to it...<br>
<br>
Actually, the OpenLayers serializer (exactly:<br>
OpenLayers.Format.GML.Base.prototype.writers.feature._typeName)<br>
creates the geometry first, then the attributes in object property<br>
(for .. in).<br>
If the geometry column in the PostgreSQL table is not the first (or<br>
second after identifier), I could never insert any feature, and a<br>
workaround with OpenLayers would be really messy.<br>
<br>
This would be an issue of OpenLayers of course. But I think it<br>
wouldn't break the logic to add to the TinyOWS configuration an<br>
optional "columns-order" attribute on the <layer> elements.<br>
That attribute would contain the comma-separated list of columns to<br>
export to the WFS client in the order they should be listed in the<br>
DescribeFeatureType sequence.<br>
<br>
It would also allow to restrict the columns to export.<br>
<br>
What do you think?<br>
<font color="#888888"><br>
--<br>
Jeff<br>
_______________________________________________<br>
TinyOWS-users mailing list<br>
<a href="mailto:TinyOWS-users@lists.maptools.org">TinyOWS-users@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/tinyows-users" target="_blank">http://lists.maptools.org/mailman/listinfo/tinyows-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Gissur Þórhallsson<br><br>Loftmyndir ehf.<br>Laugavegur 13<br>IS 101 Reykjavík - Iceland<br>sími (tel): (+354) 540 2500<br>tölvupóstur (email): <a href="mailto:gissur@loftmyndir.is">gissur@loftmyndir.is</a><br>
</div>