Drew
 
I think it's probably technically allowed in the spec, but this was a limitation imposed by the GT feature type. Essentially the convention was to use the local name as the name field for the attribute types. Then since the local name is the only identifier on the AttributeType, duplicates create issues. Therefore I disabled the ability to over-ride attributes for feature types (saved alot of complexity which I did not consider worth the user cost).
 
Where GT featuretypes are not concerned, the parser should happily work away. Unfortunately this doesn't help you. There are some proposals and work going on for a new FT model which uses a qname structure. This would provide the necessary interface to fix this problem.
 
David
 
On 11/8/05, Simpson <[EMAIL PROTECTED]> wrote:
Even if the attribute is qualified in the getFeature as myns:name?
  
Since gml:name and myns:name are in different namespaces couldn't they coexist?
 
Or is it the unqualified declaration in describeFeatureType that isn't allowed?
 
Thanks,
Drew.
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ]On Behalf Of David Zwiers
Sent: Monday, November 07, 2005 3:16 PM
To: Simpson
Cc: [email protected]
Subject: Re: [Geotools-gt2-users] WFSDataStore doesn't like attribute name

>From the feature.xsd file you referenced:

<element name="name" type="string"/>


<complexType name="AbstractFeatureType" abstract="true">
<annotation>
<documentation>
An abstract feature provides a set of common properties. A concrete
feature type must derive from this type and specify additional
properties in an application schema. A feature may optionally
possess an identifying attribute ('fid').
</documentation>
</annotation>
<sequence>
<element ref="gml:description" minOccurs="0"/>
<element ref="gml:name" minOccurs="0"/>
<element ref="gml:boundedBy" minOccurs="0"/>
<!-- additional properties must be specified in an application schema -->
</sequence>
<attribute name="fid" type="ID" use="optional"/>
</complexType>

GML already defines that particular element to be part of a feature ...


David



On 11/7/05, Simpson <[EMAIL PROTECTED]> wrote:

Hello again,

If I serve up WFS data to GeoTools with an attribute named 'name', I get the
exception below.

Is 'name' a reserved word?  Am I doing something stupid again?

If I change it to anything else, ie 'namex', it works great.

Thanks for any info,
Drew.


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

Nov 7, 2005 2:16:01 PM org.geotools.data.wfs.WFSDataStore getFeatureReader
WARNING: java.io.IOException: org.xml.sax.SAXException: Could not find
element handler for http://www.ttt.org/myns : name as a child of
eden_islesType.
java.io.IOException: org.xml.sax.SAXException : Could not find element
handler for http://www.ttt.org/myns : name as a child of eden_islesType.
        at org.geotools.xml.gml.FCBuffer.hasNext(FCBuffer.java:304)
        at
org.geotools.data.wfs.WFSFeatureReader.loadElement(WFSFeatureReader.java :164
)
        at
org.geotools.data.wfs.WFSFeatureReader.hasNext(WFSFeatureReader.java:153)
        at
org.geotools.data.wfs.WFSDataStore.getFeatureReader (WFSDataStore.java:804)
        at
org.geotools.data.wfs.WFSFeatureSource$WFSFeatureResults.reader (WFSFeatureSo
urce.java:168)



============================================================================
==
DESCRIBEFEATURETYPE

<?xml version='1.0' encoding="ISO-8859-1" ?>
<schema
   targetNamespace="http://www.ttt.org/myns"
   xmlns:myns=" http://www.ttt.org/myns"
   xmlns:ogc="http://www.opengis.net/ogc"
   xmlns:xsd=" http://www.w3.org/2001/XMLSchema"
   xmlns=" http://www.w3.org/2001/XMLSchema"
   xmlns:gml="http://www.opengis.net/gml "
   elementFormDefault="qualified" version=" 0.1" >

  <import namespace="http://www.opengis.net/gml"
          schemaLocation=" http://ogc.dmsolutions.ca/gml/2.1.2/feature.xsd"
/>

  <element name="eden_isles"
           type="myns:eden_islesType"
           substitutionGroup="gml:_Feature" />
  <complexType name="eden_islesType">
    <complexContent>
      <extension base="gml:AbstractFeatureType">
        <sequence>
          <element name="msGeometry" type="gml:GeometryPropertyType"
minOccurs="0" maxOccurs="1"/>
          <element name="gid" type="string"/>
          <element name="name" type="string"/>
          <element name="descr" type="string"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

</schema>


============================================================================
====
GETFEATURE

<?xml version='1.0' encoding="ISO-8859-1" ?>
<wfs:FeatureCollection
   xmlns:myns="http://www.ttt.org/myns"
   xmlns:wfs=" http://www.opengis.net/wfs"
   xmlns:gml=" http://www.opengis.net/gml"
   xmlns:ogc=" http://www.opengis.net/ogc"
   xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/wfs
http://ogc.dmsolutions.ca/wfs/1.0.0/WFS-basic.xsd
                       http://www.ttt.org/myns
https://xxxx/SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&a
mp;TYPENAME=eden_isles&amp;OUTPUTFORMAT=XMLSCHEMA">
      <gml:boundedBy>
        <gml:Box srsName="EPSG:32615">
                <gml:coordinates>808464.020638,3346885.074396
809022.080755,3347464.191029</gml:coordinates>
        </gml:Box>
      </gml:boundedBy>
    <gml:featureMember>
      <myns:eden_isles>
        <gml:boundedBy>
                <gml:Box srsName="EPSG:32615">
                        <gml:coordinates>808464.020638,3346885.074396
809022.080755,3347464.191029</gml:coordinates>
                </gml:Box>
        </gml:boundedBy>
        <myns:msGeometry>
        <gml:Polygon srsName="EPSG:32615">
          <gml:outerBoundaryIs>
            <gml:LinearRing>
              <gml:coordinates>808713.217294 ,3347464.191029
809022.080755 ,3347334.328511 808621.962181,3346885.074396
808506.138383,3346927.191969 808502.628571,3346993.878127
808464.020638,3347169.368016 808657.060301,3347443.132243
808713.217294,3347464.191029 </gml:coordinates>
            </gml:LinearRing>
          </gml:outerBoundaryIs>
        </gml:Polygon>
        </myns:msGeometry>
        <myns:gid>1</myns:gid>
        <myns:name>xxx</myns:name>
        <myns:descr>ddddddddd</myns:descr>
      </myns:eden_isles>
    </gml:featureMember>
</wfs:FeatureCollection>




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users




Reply via email to