[Geoserver-devel] prefix null with app schema

Hello

I was trying to configure an app-schema to deliver WOML features.
I’m able to deliver WFS with womlcore and womlswo elements, but when I try to map some GML elements I get the following result:

<ows:ExceptionReport version=“2.0.0” xsi:schemaLocation=“http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd”>
<ows:Exception exceptionCode=“NoApplicableCode”>
ows:ExceptionTextjava.io.IOException: The prefix "null" for element "null:name" is not bound.
The prefix "null" for element "null:name" is not bound.
The prefix "null" for element "null:name" is not bound.
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

I’m using Geoserver 2.2 SNAPSHOT

This is the mapping file:

<?xml version="1.0" encoding="UTF-8"?>

<as:AppSchemaDataAccess xmlns:as=“http://www.geotools.org/app-schema
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=“http://www.geotools.org/app-schema AppSchemaDataAccess.xsd”>


gml
http://www.opengis.net/gml/3.2


womlswo
http://xml.fmi.fi/namespace/woml/swo/2011/11/15


womlcore
http://xml.fmi.fi/namespace/woml/core/2011/11/15




datastore


directory
file:./




…/…/…/schemas/catalog.xml


http://xml.fmi.fi/schema/woml/swo/2011/11/15/woml-swo.xsd


http://xml.fmi.fi/schema/woml/core/2011/11/15/woml-core.xsd

datastore womlswo_ColdFront womlswo:ColdFront womlswo:ColdFront getId() gml:name 'test' womlcore:shortInfo 'test2'

Alessando,

your mapping file is schema-invalid. targetTypes should contain only one FeatureType which can contain multiple schemaUri elements. (At this point a nonvalidating parser is used; I'm not sure if it ignores the second FeatureType.)

Kind regards,
Ben.

On 31/01/12 22:10, alessandro marrone wrote:

Hello

I was trying to configure an app-schema to deliver WOML features.
I’m able to deliver WFS with womlcore and womlswo elements, but when I try to map some GML elements I get the following result:

<ows:ExceptionReport version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd&quot;&gt;
     <ows:Exception exceptionCode="NoApplicableCode">
         <ows:ExceptionText>java.io.IOException: The prefix&quot;null&quot; for element&quot;null:name&quot; is not bound.
The prefix&quot;null&quot; for element&quot;null:name&quot; is not bound.
         </ows:ExceptionText>
     </ows:Exception>
</ows:ExceptionReport>

I’m using Geoserver 2.2 SNAPSHOT

This is the mapping file:

<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema&quot;
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
     xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
     <namespaces>
         <Namespace>
             <prefix>gml</prefix>
             <uri>http://www.opengis.net/gml/3.2&lt;/uri&gt;
         </Namespace>
         <Namespace>
             <prefix>womlswo</prefix>
             <uri>http://xml.fmi.fi/namespace/woml/swo/2011/11/15&lt;/uri&gt;
         </Namespace>
         <Namespace>
             <prefix>womlcore</prefix>
             <uri>http://xml.fmi.fi/namespace/woml/core/2011/11/15&lt;/uri&gt;
         </Namespace>
     </namespaces>
     <sourceDataStores>
         <DataStore>
             <id>datastore</id>
             <parameters>
                 <Parameter>
                     <name>directory</name>
                     <value>file:./</value>
                 </Parameter>
             </parameters>
         </DataStore>
     </sourceDataStores>
     <catalog>../../../schemas/catalog.xml</catalog>
     <targetTypes>
         <FeatureType>
             <schemaUri>http://xml.fmi.fi/schema/woml/swo/2011/11/15/woml-swo.xsd&lt;/schemaUri&gt;
         </FeatureType>
         <FeatureType>
             <schemaUri>http://xml.fmi.fi/schema/woml/core/2011/11/15/woml-core.xsd&lt;/schemaUri&gt;
         </FeatureType>
     </targetTypes>

     <typeMappings>
         <FeatureTypeMapping>
             <sourceDataStore>datastore</sourceDataStore>
             <sourceType>womlswo_ColdFront</sourceType>
             <targetElement>womlswo:ColdFront</targetElement>
             <attributeMappings>

                 <AttributeMapping>
                     <targetAttribute>
                         womlswo:ColdFront
                     </targetAttribute>
                     <idExpression>
                         <OCQL>getId()</OCQL>
                     </idExpression>
                 </AttributeMapping>

              <AttributeMapping>
                     <targetAttribute>
                       gml:name
                       </targetAttribute>
                     <sourceExpression>
                         <OCQL>'test'</OCQL>
                     </sourceExpression>
                 </AttributeMapping>

                 <AttributeMapping>
                     <targetAttribute>
                         womlcore:shortInfo
                     </targetAttribute>
                     <sourceExpression>
                         <OCQL>'test2'</OCQL>
                     </sourceExpression>
                 </AttributeMapping>

             </attributeMappings>
         </FeatureTypeMapping>
     </typeMappings>
</as:AppSchemaDataAccess>

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre