[fdo-trac] #753: FDO XML: improper serializing of schemas with names starting with numbers

FDO trac_fdo at osgeo.org
Wed Mar 16 08:19:09 EDT 2011


#753: FDO XML: improper serializing of schemas with names starting with numbers
-----------------------------+----------------------------------------------
   Reporter:  brentrobinson  |       Owner:  brentrobinson                 
       Type:  defect         |      Status:  new                           
   Priority:  minor          |   Milestone:                                
  Component:  FDO API        |     Version:  3.6.0                         
   Severity:  3              |    Keywords:  XML serialize namespace prefix
External_id:                 |  
-----------------------------+----------------------------------------------
 Steps:

  * Create a feature schema whose name has a numeric 1st character (e.g.
 "1Schema")
  * Add a feature class to the schema
  * serialize the schema, using FdoFeatureSchema::WriteXml()
  * deserialize the XML back into a feature schema collection.

 An error similar to the following is issued:


 {{{

 Error reading schema '-x31-Schema' from XML, global element
 xs:schema/xs:element[@name=FeatureClass1] type is from a different
 schema: ''.

 }}}

 XML element names cannot start with digits so the Schema name "1Schema" is
 encoded into "-x31-Schema" when serialized. However, element names cannot
 start with "-" either. By default, the XML serialization generates a
 namespace for the feature schema, using the schema name as the prefix.
 However, the namespace declaration is not written because the prefix is
 not a valid XML name. This corrupts the resulting XML document since the
 type for the XML element for the feature class is specified with an
 undeclared namespace.

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/753>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list