Click to See Complete Forum and Search --> : Need a prefix when using attributeFormDefault?


seamus123
03-19-2003, 08:14 AM
I load up an xml schema then I generate a sample xml document from this schema, I then include all mandatory tags and fill in mandatory elements and attributes.

When I validate the document against the schema it gives me the following error.
"The file is not valid: Your schema uses attributeFormDefault="qualified" - you must specify a prefix for your schema namespace 'http://tempuri.org/CRHPSchema.xsd'"

ROOT OF XSD DOCUMENT
<?xml version="1.0"?>
<xs:schema targetNamespace="http://tempuri.org/CRHPSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/CRHPSchema.xsd" xmlns:mstns="http://tempuri.org/CRHPSchema.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" id="HistoricPlaces">

ROOT OF XML DOCUMENT
<?xml version="1.0" encoding="UTF-8"?>
<HistoricPlaces xmlns="http://tempuri.org/CRHPSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tempuri.org/CRHPSchema.xsd
C:\DOCUME~1\seamusm\Registrar\xml\CRHPSchema.xsd">

Has anyone come across this validating problem before?
Please help if you know of anything.
THX, S.

khalidali63
03-19-2003, 09:26 AM
how does your xml document look?

Cheers

Khalid

seamus123
03-19-2003, 09:37 AM
Here is a sample xml document generated from the schema.
I know the parser does not distinguish between
<Jurisdiction><Name/></Jurisdiction> and
<Names><Name Language="English"/></Names>. But I believe the problem is with namespaces in the schema.

<?xml version="1.0" encoding="UTF-8"?>
<HistoricPlaces xmlns="http://tempuri.org/CRHPSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tempuri.org/CRHPSchema.xsd
C:\DOCUME~1\seamusm\Registrar\xml\CRHPSchema.xsd">
<HistoricPlace>
<Jurisdiction>
<RecordID/>
<Name/>
</Jurisdiction>
<OfficialName Language="English"/>
<Names>
<Name Language="English"/>
</Names>
<Addresses>
<Address Type="Mailing">
<StreetAddress Language="English"/>
</Address>
</Addresses>
<Location>
<RecognitionBoundary Language="English"/>
</Location>
<Classification/>
<Recognition>
<Authority/>
<Type/>
<Date/>
</Recognition>
<Contacts>
<Contact Type=""/>
</Contacts>
<Management>
<FPTR>
<FirstName/>
<LastName/>
<EmailAddress/>
</FPTR>
</Management>
</HistoricPlace>
</HistoricPlaces>