Only one gml:name can be encoded per feature
--------------------------------------------

                 Key: GEOT-2455
                 URL: http://jira.codehaus.org/browse/GEOT-2455
             Project: GeoTools
          Issue Type: Bug
          Components: ext xml-xsd
            Reporter: Rini Angreani
             Fix For: 2.6-M2
         Attachments: GEOT-2455.patch

In GML3, you are allowed to have  multiple gml:name per feature.

<complexType name="AbstractGMLType" abstract="true">
                <sequence>
                        <group ref="gml:StandardObjectProperties"/>
                </sequence>
                <attribute ref="gml:id" use="required"/>
        </complexType>
        <group name="StandardObjectProperties">
                <sequence>
                        <element ref="gml:metaDataProperty" minOccurs="0" 
maxOccurs="unbounded"/>
                        <element ref="gml:description" minOccurs="0"/>
                        <element ref="gml:descriptionReference" minOccurs="0"/>
                        <element ref="gml:identifier" minOccurs="0"/>
                        <element ref="gml:name" minOccurs="0" 
maxOccurs="unbounded"/>
                </sequence>
        </group>
http://schemas.opengis.net/gml/3.2.1/gmlBase.xsd

However, only the first gml:name would be encoded. This is because 
GML3EncodingUtils is built on top of GML2EncodingUtils, that specially handles 
some properties. 

These special properties are: GML.name, GML.description, GML.location, held in 
a hashset called abstractFeatureTypeProperties in GML2EncodingUtils. 
In AbstractFeatureType_getProperty(Object, QName, Configuration) method, if the 
property name matches any of these properties, they would be retrieved using 
feature.getProperty() method, which would only return the first matching 
property. This is OK in GML2 because GML2 schema has a restriction of one 
gml:name per instance. 

I am not sure of the purpose of specially handling these attributes? Can I just 
remove the abstractFeatureTypeProperties variable, and let the mentioned 
attributes be handled as per normal? 

 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to