Re: No external markup declarations present - referenced entity 'è' must be declared.

"G. Ken Holman" <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
At 2011-03-23 10:00 +0000, [email protected] wrote:
>I have an XSD (included below), but the ‘è’ 
>character (html char: ‘&egrave;’) in the word 
>‘Crèche’ (line 6) is causing an problem;

Yes, it would, precisely because it isn't a 
built-in XML named general entity.  As you 
indicate, the HTML vocabulary is one of the 
vocabularies that uses this entity as the accented letter.

>the schema fails validation: No external markup 
>declarations present - referenced entity '&egrave;' must be declared.

Very true.  Since it isn't one of the built-in 
entities it isn't available in an XML document without entity declarations.

>Please help, how can I do this?
>
><?xml version="1.0" encoding="utf-8"?>
><xs:schema 
>xmlns:types="http://localhost/dropdownvalues.xsd" 
>  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
>targetNamespace="http://localhost/dropdownvalues.xsd" 
>elementFormDefault="qualified" attributeFormDefault="unqualified">
><xs:simpleType name="WorkplaceDetailsType">
>             <xs:restriction base="xs:string">
>                         <xs:enumeration 
> value="Office, school, shop, restaurant, hotel 
> -&gt; Office, Meeting room, Library"/>
>                         <xs:enumeration 
> value="Office, school, shop, restaurant, hotel 
> -&gt; Cr&egrave;che or Day nursery"/>
>                         <xs:enumeration 
> value="Office, school, shop, restaurant, hotel 
> -&gt; Primary or Secondary school"/>
>                         <xs:enumeration 
> value="Office, school, shop, restaurant, hotel -&gt; College or University"/>
>                         <xs:enumeration 
> value="Office, school, shop, restaurant, hotel 
> -&gt; Retail unit or Shopping Centre"/>
>                         <xs:enumeration 
> value="Office, school, shop, restaurant, hotel -&gt; Other"/>
>                         <xs:enumeration value="Other -&gt; Other"/>
>             </xs:restriction>
></xs:simpleType>
></xs:schema>

Three ways:

(1) - avoid the unknown named general entity in 
the first place; since you are already using 
UTF-8 just use the character in the string using UTF-8 encoding:

   <xs:enumeration value="Office, school, shop, 
restaurant, hotel -&gt; Crèche or Day nursery"/>

(2) - avoid the named general entity by using a numeric character reference:

   <xs:enumeration value="Office, school, shop, 
restaurant, hotel -&gt; Cr&#232;che or Day nursery"/>

(3) - declare the required named general entity:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xs:schema [
<!ENTITY egrave "&#232;">
]>
<xs:schema ...
   <xs:enumeration value="Office, school, shop, 
restaurant, hotel -&gt; Cr&egrave;che or Day nursery"/>

I hope this helps.

. . . . . . . . . . Ken

--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
G. Ken Holman                 mailto:[email protected]
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.