Skip to main content
Question

GML schema writer doesn't account for null values in dates

  • July 18, 2019
  • 3 replies
  • 26 views

tsirkuse
Contributor
Forum|alt.badge.img+3

I am extracting data from a dB and writing it to a gml file with the GML writer.

I am also writing the xsd schema.

In my data, some dates are empty, and this is normal. However, in the XSD file writen by FME the dates are not nullable. The type of error I am getting is:

_xml_error{5}.desc (string): invalid date value ''

I am wondering if I am doing something wrong or if there is a problem with the xsd writter?

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

stalknecht
Contributor
Forum|alt.badge.img+22
  • Contributor
  • July 19, 2019

Is it Null or just an empty space?

Look in the XSD and change minOccurs="1" to minOccurs="0" for the date field.


tsirkuse
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • July 19, 2019

Is it Null or just an empty space?

Look in the XSD and change minOccurs="1" to minOccurs="0" for the date field.

Thank you but there is no minOccurs in the xsd. I tried adding it but it didn't help.

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:gml2="http://www.safe.com/gml2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.safe.com/gml2" elementFormDefault="qualified">
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<element name="FeatureCollection" type="gml2:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<element name="dates_test" type="gml2:dates_testType" substitutionGroup="gml:_Feature"/>

<complexType name="FeatureCollectionType">
<complexContent>
<extension base="gml:AbstractFeatureCollectionType">
</extension>
</complexContent>
</complexType>

<complexType name="dates_testType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="ID" type="long"/>
<element name="START" type="date"/>
<element name="END" type="date" nillable="true" minOccurs="0"/>
<choice>
<element ref="gml:polygonProperty"/>
<element ref="gml:multiPolygonProperty"/>
</choice>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>

stalknecht
Contributor
Forum|alt.badge.img+22
  • Contributor
  • July 20, 2019

Thank you but there is no minOccurs in the xsd. I tried adding it but it didn't help.

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:gml2="http://www.safe.com/gml2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.safe.com/gml2" elementFormDefault="qualified">
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<element name="FeatureCollection" type="gml2:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<element name="dates_test" type="gml2:dates_testType" substitutionGroup="gml:_Feature"/>

<complexType name="FeatureCollectionType">
<complexContent>
<extension base="gml:AbstractFeatureCollectionType">
</extension>
</complexContent>
</complexType>

<complexType name="dates_testType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="ID" type="long"/>
<element name="START" type="date"/>
<element name="END" type="date" nillable="true" minOccurs="0"/>
<choice>
<element ref="gml:polygonProperty"/>
<element ref="gml:multiPolygonProperty"/>
</choice>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>

Can you try to post a FME template? The gml example in your post is readable how is it generated? Which writer do you use?