Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2009, 10:47 AM
Authorized User
 
Join Date: Feb 2007
Posts: 51
Thanks: 3
Thanked 0 Times in 0 Posts
Default W3C XML Schema Validation Problem

Hello, if I am getting the validation error in xmlSpy:

'wfs:BaseRequestType' must refer to an existing simple or complex type

for the schema with below snippet (see 2 bolded most-relevent lines):

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:wfs
="http://www.opengis.net/wfs"xmlns:ogc="http://www.opengis.net/ogc"
>
<xs:element name="GetFeature" type="wfs:GetFeatureType"/>
<xs:complexType name="GetFeatureType">
<xs:complexContent>
<xs:extension base="wfs:BaseRequestType"><xs:sequence>
<xs:element ref="wfs:Query" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="resultType" type="wfs:ResultTypeType" use="optional" default="results"/>
<xs:attribute name="outputFormat" type="xs:string" use="optional" default="text/xml; subtype=3.1.1"/>
<xs:attribute name="maxFeatures" type="xs:positiveInteger" use="optional"/>
<xs:attribute name="traverseXlinkDepth" type="xs:string" use="optional"/>
<xs:attribute name="traverseXlinkExpiry" type="xs:positiveInteger" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
.
.
.

what is the likely problem? I would think that with the "wfs=" namespace reference (near top of snippet) present, then the tool should be able to resolve the type. I am getting similar errors, in fact, for all lines with either "wfs: “ and “ogc: “. Any help is appreciated. Thank you.
 
Old August 28th, 2009, 10:59 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Unless you have a 'targetNamespace' attribute you're not showing the then you need to include that attribute as well as the xmlns:wfs namespace declaration.

I am assuming that BaseRequestType is defined elsewhere in your schema?

If it is not then you need to import the schema definition for that namespace - don't get confused by a namespace declaration - just because it looks like a URL doesn't mean the parser automatically downloads the schema declaration from that location.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old August 28th, 2009, 11:01 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

<xsl:import schemaLocation="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" namespace="http://www.opengis.net/wfs"/>
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
tclotworthy (August 28th, 2009)
 
Old August 28th, 2009, 11:01 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Are there any xs:import or xs:include elements in that schema?
Also does that schema not have a targetNamespace attribute?
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
The Following User Says Thank You to Martin Honnen For This Useful Post:
tclotworthy (August 28th, 2009)
 
Old August 28th, 2009, 12:11 PM
Authorized User
 
Join Date: Feb 2007
Posts: 51
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Many thanks to you guys. I simply needed:

<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/ogc" schemaLocation="http://schemas.opengis.net/filter/1.1.0/filter.xsd"/>





Similar Threads
Thread Thread Starter Forum Replies Last Post
W3C Validation help!! Mantis HTML Code Clinic 8 April 3rd, 2006 02:04 PM
XML schema validation problems BrendonMelville XML 3 February 15th, 2006 06:02 PM
W3C Validation of FORM steamydave CSS Cascading Style Sheets 2 April 27th, 2005 10:39 AM
XML validation with Schema/DTD using JAXP Hendrik XML 0 December 28th, 2004 06:58 AM
XML Schema Validation without internet esp5a XML 1 September 5th, 2003 06:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.