Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8840467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:28:17+00:00 2026-06-14T10:28:17+00:00

The problem I’m trying to solve is related to interaction between OpenLayers and TinyOWS,

  • 0

The problem I’m trying to solve is related to interaction between OpenLayers and TinyOWS, namely inserting a new feature, but I won’t post any Javascript code or TinyOWS configs here because they are not relevant to the xml validation issue. I’ve tried to isolate problem as much as possible. Here is python2 code using lxml library for XML validation against schema:

from lxml import etree
from StringIO import StringIO

parser = etree.XMLParser(no_network=False)
etree.set_default_parser(parser)

schema_doc = etree.parse(StringIO('''\
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:tows="http://www.tinyows.org/" targetNamespace="http://www.tinyows.org/" elementFormDefault="qualified" version="1.1">
<xs:import namespace="http://www.opengis.net/wfs" schemaLocation="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"/>
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
<xs:element name="cities" type="tows:citiesType" substitutionGroup="gml:_Feature"/>
<xs:complexType name="citiesType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="type_id" type="int" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="properties" type="string" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="geom" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
'''))

xml = etree.parse(StringIO('''\
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs">
<wfs:Insert>
<feature:cities xmlns:feature="http://www.tinyows.org">
<feature:geom>
<gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326">
<gml:pos>37.935083007812 55.4423828125</gml:pos>
</gml:Point>
</feature:geom>
</feature:cities>
</wfs:Insert>
</wfs:Transaction>'''))

schema = etree.XMLSchema(schema_doc)
schema.assertValid(xml)

Here I get the error:

lxml.etree.DocumentInvalid: Element '{http://www.tinyows.org}cities': This element is  not expected. Expected is one of ( {http://www.opengis.net/gml}_Feature, http://www.opengis.net/gml}FeatureCollection, {http://www.opengis.net/gml}MultiPointCoverage, {http://www.opengis.net/gml}MultiCurveCoverage, {http://www.opengis.net/gml}MultiSurfaceCoverage, {http://www.opengis.net/gml}MultiSolidCoverage, {http://www.opengis.net/gml}GridCoverage, {http://www.opengis.net/gml}RectifiedGridCoverage, {http://www.opengis.net/gml}Observation, {http://www.opengis.net/gml}DirectedObservation )., line 3

That seems cryptic to me, because cities feature is defined to substitute for gml:_Feature in schema. Perhaps the answer should lie within http://schemas.opengis.net/wfs/1.1.0/wfs.xsd, but I can’t grasp the logic of validation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:28:18+00:00Added an answer on June 14, 2026 at 10:28 am

    I found that the string <feature:cities xmlns:feature="http://www.tinyows.org"> was the root of all evil, namely, missing trailing slash in http://www.tinyows.org namespace. Changed it to <feature:cities xmlns:feature="http://www.tinyows.org/"> solved the problem. Every symbol matters!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: Trying to create a Mix that is applied to the AVPlayerItem, but it
Problem: I have a table that prints out vertical but I would like it
Problem: I am trying to build a recursive tree using a function and data
Problem : Need onclick event to pause/unpause a Youtube video, but impossible to add
Problem: Visitors open the url website.com/?i=133r534|213213|12312312 but this url isn't valid anymore and they
Problem: to open a new window with the select -option <form onsubmit=return handleSubmit() target=_blank
Problem: I have a large Visual C++ project that I'm trying to migrate to
Problem: I can set the exposureMode property of AVCaptureDevice, but it does not stay
Problem is I can see already the value of my json through firebug but
Problem in short: I'm trying to make a simple show/hide toggle work on just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.