Juan,
I'm not familiar enough with geoserver to say what the semantics of the Update vs. the Insert and Delete operations are, but at the pure XML level, the parsing error you're getting is the following:
You must declare each namespace you use in an xml document before you use it. For example,
<myns:MyElement>
<myns:MySubElement>MyContent</myns:MySubElement>
</myns:MyElement>
is not valid XML, because the "myns" namespace prefix isn't declared. To fix this, you could change this as follows:
<myns:MyElement xmlns:myns="http://my-namespace.com">
<myns:MySubElement>MyContent</myns:MySubElement>
</myns:MyElement>
Notice you only need to declare the "myns" namespace once...it gets "inherited" by any child elements below it. However,
<myns:MyElement>
<myns:MySubElement xmlns:myns="http://my-namespace.com">MyContent</myns:MySubElement>
</myns:MyElement>
Would not be ok, because MyElement wouldn't be able to "see" the namespace declaration on it's child.
Looking at your XML, the problem is that you don't declare the "topp" namespace prefix anywhere. I'm not sure how geoserver handles the namespace prefix to namespace declarations (does it enforce correct namespaces on insert/update?) but it could be that simply declaring your namespace prefix by adding an attribute like xmlns:<your-namespace-prefix>="<your namespace URI>" to the first "topp" prefixed element.
This is pretty consistent with the error you're getting...
--saul
-----Original Message-----
From: Juan Marín Otero [mailto:jmo@anonymised.com]
Sent: Wednesday, September 15, 2004 6:34 AM
To: geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Update geometry
I am configuring a database (Postgis on windows) to store GPS coordinates. I want to update the geometry for the points in real time (well at least as close to as possible). I am trying to figure out the XML necessary to perform such an operation through WFS. I have come up with two possible
approaches:
1. Use Update statement with geometry column. Does this work?. If so, I don't know how to write such an expression, if anyone can help me out here it would be great.
2. Use Delete and Insert statements within a Transaction. I have tried the
following:
<wfs:Transaction service="WFS" handle="Transaction 01" version="1.0.0"
xmlns:cdf="http://www.opengis.net/cite/data"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:wfs="http://www.opengis.net/wfs">
<wfs:Delete typeName="topp:posiciones">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>topp:objectid</ogc:PropertyName>
<ogc:Literal>1</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Delete>
<wfs:Insert handle="Statement 1">
<topp:posiciones>
<topp:the_geom>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#23030">
<gml:coordinates decimal="." cs="," ts=" ">430000,4650000 </gml:coordinates>
</gml:Point>
</topp:the_geom>
<topp:objectid>1</topp:objectid>
<topp:ict_id_dev>1</topp:ict_id_dev>
<topp:ict_fc_dat>15/09/2004</topp:ict_fc_dat>
<topp:ict_x_coor>430000</topp:ict_y_coor>
<topp:ict_y_coor>4650000</topp:ict_y_coor>
</topp:posiciones>
</wfs:Insert>
</wfs:Transaction>
If I do Delete and Insert in separate transactions they work but I want both commands to be in one transaction to ensure data integrity.
But I get the following error:
<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException locator="org.vfny.geoserver.requests.readers.DispatcherXmlReader">
XML get capabilities request parsing error:
org.xml.sax.SAXParseException: The prefix "topp" for element
"topp:posiciones" is not bound. </ServiceException>
</ServiceExceptionReport>
What am I doing wrong?.
Thank you very much in advance.
Juan Marín Otero
TRAGSATEC S.A.
Departamento de Cartografía
Tlf. 91 322 64 98
Este correo es sólo informativo y por lo tanto no supone obligación contractual para TRAGSATEC ni para las sociedades a ella vinculadas. La información incluida en el presente correo electrónico es CONFIDENCIAL, siendo para el uso exclusivo del destinatario arriba mencionado. Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicación por error, le informamos que está totalmente prohibido cualquier almacenamiento, divulgación, distribución o reproducción de esta comunicación y de los archivos que pueda contener. Le rogamos que nos lo notifique, devuelva el original al emisor del correo y destruya el mensaje.
El correo electrónico vía Internet no permite asegurar la confidencialidad de los mensajes que se transmiten, ni su integridad o correcta recepción.
TRAGSATEC no asume responsabilidad por estas circunstancias. Si el
destinatario de este mensaje no consintiera la utilización del correo electrónico vía Internet y la grabación de los mensajes, rogamos lo ponga en nuestro conocimiento de forma inmediata.
-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam Camcorder. More prizes in the weekly Lunch Hour Challenge. Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel