Andrea's memory is correct. And Rudy, my email archive tells me that I 
sent you the following explanation on on 15 June 2012. What I think you 
really want is a top level type that contains a property type.

============

I also note that your example XML contains Sample1 as a direct child of 
Object1. This is not permitted by the GML encoding rules. Sample1 must 
be enclosed in a property type like:

<Object1>
   <name></name>
   <desc></desc>
   <sample>
     <Sample1>
       <name></name>
       <desc></desc>
     </Sample1>
   </sample>
</Object1>

GML contains objects and properties, and no element can be both. Objects 
can have properties, but cannot directly contain other objects (without 
an intervening property). These rules ensure that properties are names 
and type information is encoded explicitly in GML instance documents.

 From p20-22 of OGC 07-036 (the GML 3.2.1 specification) see discussion 
in 7.1 and in particular:

******

7.1.3 XML Schema definition of GML language
The GML schema consists of W3C XML Schema components that define types 
and declare
- XML elements to encode GML objects with identity,
- XML elements to encode GML properties of those objects, and
- XML attributes qualifying those properties.
A GML object is an XML element of a type derived directly or indirectly 
from gml:AbstractGMLType. From this
derivation, a GML object shall have a gml:id attribute.
A GML property shall not be derived from gml:AbstractGMLType, shall not 
have a gml:id attribute, or any
other attribute of XML type ID.
An element is a GML property if and only if it is a child element of a 
GML object.
A GML object shall not appear as the immediate child of a GML object.
Consequently, no element may be both a GML object and a GML property.

******

============


On 06/11/12 22:44, Andrea Aime wrote:
> On Tue, Nov 6, 2012 at 3:35 PM, RudyWI<[email protected]>  wrote:
>> Hi,
>>
>> Thanks for your help.
>> I have performed a Geometry mapping successfully.
>> But the result does not have a valid structure.
>>
>> I want the following result :
>> <myNs:MyPoint srsName="...">
>>      <gml:pos>...</gml:pos>
>> </myNs:MyPoint>
>>
>> So, I have defined the following schema :
>> <element name="MyPoint" type="gml:GeometryPropertyType" />
>>
>> But I have the following result :
>> <myNs:MyPoint srsName="...">
>>      <gml:Point srsName="...">
>>          <gml:pos>...</gml:pos>
>>      </gml:Point>
>> </myNs:MyPoint>
>>
>> So, how can I do to have the expected result ?
>
> I don't think you can, what you're looking for is not valid GML (Ben
> can explain this better,
> but there are structural rules in GML that have to be followed, one of
> them is that
> geometries literal have to be contained in a property element if
> memory serves me right).
>
> Cheers
> Andrea
>
>

-- 
Ben Caradoc-Davies <[email protected]>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to