Character entities and XML Schema

Discussion in 'XML' started by kamp@inl.nl, Jul 21, 2005.

  1. Guest

    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
    , Jul 21, 2005
    #1
    1. Advertising

  2. Rinus Luijmes, Jul 22, 2005
    #2
    1. Advertising

  3. writes:

    > 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
    C. M. Sperberg-McQueen, Jul 27, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,498
    Markus
    Nov 23, 2005
  2. Simon Brooke
    Replies:
    0
    Views:
    430
    Simon Brooke
    Oct 12, 2003
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,173
    Stanimir Stamenkov
    Apr 25, 2005
  4. Replies:
    3
    Views:
    2,799
  5. Jim Higson
    Replies:
    3
    Views:
    215
    Eric Amick
    Jul 25, 2004
Loading...

Share This Page