Character entities and XML Schema

K

kamp

Hello,

Below is a snippet from a schema. The second enumeration should contain
an i umlaut (archaïsch) but when I use this schema with Altova's
Stylevision software the iumlaut is not displayed properly. So I
changed it into a character entity. I tried several entity declarations
(examples found on the web) but none of them worked i.e. Stylevision
refused to load the schema. So, I want to know the following: is it
possible to use character entities in schemas? If yes, what is the
proper way to declare them in a schema?

<xs:element name="Tijd" minOccurs="0" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="verouderend"/>
<xs:enumeration value="archasch"/>
<xs:enumeration value="neologisme"/>
<xs:enumeration value="overig"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

Thanks.

Peter van der Kamp
 
C

C. M. Sperberg-McQueen

Hello,

Below is a snippet from a schema. The second enumeration should contain
an i umlaut (archaïsch) but when I use this schema with Altova's
Stylevision software the iumlaut is not displayed properly. So I
changed it into a character entity. I tried several entity declarations
(examples found on the web) but none of them worked i.e. Stylevision
refused to load the schema.

Detailes of the entity declarations you used would be
helpful here.
So, I want to know the following: is it
possible to use character entities in schemas? If yes, what is the
proper way to declare them in a schema?

A schema document is an XML document like any other;
give it a doctype declaration and declare 'iuml' (or
whatever name you're using) there. If your schema tools
don't read the external DTD subset, you may be forced
to put the declaration for the entity into the internal
subset. If your tools interpret the existence of a
DOCTYPE declaration as an instruction to validate the
schema document and treat invalidity as a fatal error,
you might wish to look for other tools; if you can't
do that or just want to live with the tools you've
got, you can make the doctype declaration point to
the DTD for schema documents which is part of the
XML Schema spec.

Alternatively, your problem may be that your tools
don't accept the ï character only because of an
encoding problem: if your XML declaration explicitly
or implicitly tells the software to expect UTF-8,
and you hand it a document encoded in ISO 8859-1,
they have a right to complain.

Third alternative: use a numeric character reference,
not a general-entity reference. No declaration needed,
and no useful name, just a decimal or hex number,
useful for all of us who have memorized the UCS
character tables.

I hope this helps.

--C. M. Sperberg-McQueen
World Wide Web Consortium
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top