GUID simple Type

I received an external schema with the following type in it:

<xs:element minOccurs="1" maxOccurs="1" name="Id" type="wsdl:guid" />

There also was a reference to:

 <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
<xs:import namespace="" />

However the build failed with:
Error 6 Type ‘’ is not declared, or is not a simple type. D:ExternalSchemasschemaname.xsd ExternalSchemas

I came ac cross a few posts for handling guids in schema’s:

The simplest way to solve this is to add a schema with the guid type in it and then add the location in the import. So add a schema:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="" elementFormDefault="qualified" targetNamespace="" xmlns:xs="">
<xs:simpleType name="guid">
<xs:documentation xml:lang="en">
The representation of a GUID, generally the id of an element.
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />

Then add the location to the import in the first schema:

<xs:import namespace="" schemaLocation="SimpleImport.xsd"/>


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.