Hi,
in app-schema I need to return a complex feature via WFS that uses XSD-files
with different namespaces. I need to show elements from the "inner" XSD in
the WFS-result.
2 XSD files with different namespaces:
* "ProtectedSitesFull_MU.xsd", namespace: "ps" (= <targetElement> for WFS)
* "GeographicalNamesMU.xsd", namespace: "gn" (= "inner" XSD, used by "ps")
The <targetElement> "ps:ProtectedSite" is defined in "ps". It includes type
"GeographicalName", which is defined in "gn". I need to explicitly show
"GeographicalName" and some sub-elements (all defined in "gn") in the
WFS-result. Here is how I tried to do this in the mapping-file:
<targetAttribute>
ps:siteName/gn:GeographicalName
</targetAttribute>
GeoServer does not report an error, but delivers a malformed XML-document:
instead of namespace "gn:" it's "null:". Here is part of the result returned
by GeoServer:
<wfs:FeatureCollection numberOfFeatures="2"
timeStamp="2010-09-10T11:31:02.821+02:00" ...>
<gml:featureMembers>
<ps:ProtectedSite gml:id="sites1.2_1_2012">
<ps:siteName>
<null:GeographicalName/>
</ps:siteName>
</ps:ProtectedSite>
</gml:featureMembers>
</wfs:FeatureCollection>
My questions are:
1. How do I map nested types of different namespaces in <targetAttribute>?
2. Tag <FeatureType> in mapping-file: do I need a separate <FeatureType> for
every URI? Or should I put them all into one <FeatureType>? (example see
below)
I'm using GeoServer 2.0.2 with the appropriate app-schema.
Here are snippets of some of the XSDs and the mapping file (I have attached
everything as ZIP-files in case anybody feels like looking at the whole
thing... You will see many parts commented out in the mapping - that was to
reduce the output)
======================================================================================
ProtectedSitesFull_MU.xsd
-------------------------
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ps="http://www.opengeospatial.net/ps"
. . .
xmlns:gn="http://www.opengeospatial-gmlas.net/gn"
elementFormDefault="qualified"
targetNamespace="http://www.opengeospatial.net/ps">
. . .
<import namespace="http://www.opengeospatial-gmlas.net/gn"
schemaLocation="http://www.opengeospatial-gmlas.net/gn/GeographicalNamesMU.xsd"/>
<element name="ProtectedSite" substitutionGroup="gml:_Feature"
type="ps:ProtectedSiteFullType"/>
<complexType name="ProtectedSiteFullType">
<complexContent>
<extension base="ps:ProtectedSiteType">
...
</extension>
</complexContent>
<complexType>
<complexType name="ProtectedEntityTypeType">
<sequence>
...
<element maxOccurs="unbounded" minOccurs="0" name="siteName"
nillable="true">
<complexType>
<sequence>
<element ref="gn:GeographicalName"/>
</sequence>
...
</complexType>
</element>
...
</schema>
GeographicalNamesMU.xsd
-------------------------
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:gn="http://www.opengeospatial-gmlas.net/gn"
...
elementFormDefault="qualified"
targetNamespace="http://www.opengeospatial-gmlas.net/gn">
...
<element name="GeographicalName" substitutionGroup="gml321:AbstractObject"
type="gn:GeographicalNameType"/>
...
</schema>
protected_sites_1.xml (Mapping-file)
---------------------
...
<namespaces>
...
<Namespace>
<prefix>gn</prefix>
<uri>http://www.opengeospatial-gmlas.net/gn</uri>
</Namespace>
</namespaces>
...
<catalog>../../../../schemas/ProtectedSitesMU/catalog.xml</catalog>
...
<targetTypes>
<FeatureType>
<schemaUri>http://www.opengeospatial.net/ps/ProtectedSitesFull_MU.xsd</schemaUri>
</FeatureType>
<FeatureType>
<schemaUri>http://www.opengeospatial-gmlas.net/gn/GeographicalNamesMU.xsd</schemaUri>
</FeatureType>
</targetTypes>
...
<targetElement>ps:ProtectedSite</targetElement>
...
<attributeMappings>
<AttributeMapping>
<targetAttribute>
ps:siteName
</targetAttribute>
<sourceExpression>
<OCQL>''</OCQL>
</sourceExpression>
</AttributeMapping>
<!-- here is where the problem occurs: -->
<AttributeMapping>
<targetAttribute>
ps:siteName/gn:GeographicalName
</targetAttribute>
<sourceExpression>
<OCQL>''</OCQL>
</sourceExpression>
</AttributeMapping>
...
catalog.xml (OASIS-catalog)
-----------
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI uriStartString="http://www.opengeospatial.net/ps"
rewritePrefix="INSPIRE/" />
...
<rewriteURI uriStartString="http://www.opengeospatial-gmlas.net/gn"
rewritePrefix="INSPIRE/" />
</catalog>
Attachments:
-------------
complete workspace: http://old.nabble.com/file/p29675596/ps_folder.zip
ps_folder.zip
XSD-files: http://old.nabble.com/file/p29675596/schemas.zip schemas.zip
--
View this message in context:
http://old.nabble.com/app-schema%3A-2-namespaces-in-one-%3CtargetAttribute%3E%3A-how-to--tp29675596p29675596.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful,
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance.
http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users