Including entities file in an xml document

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chak

    Including entities file in an xml document

    I'm writting xml documents in french language. So i need to use special
    characters like é and à. For this purpose i use HTML standard entities
    like é.
    But when i open my xml documents with my xml viewer an XML Parsing
    Error(undefined entity) occur. It seems to me quite normal as entity
    like é are not part of xml standard.

    I found on google a file called iso-lat1.ent (part of DocBook project)
    which defined all entities i need.

    But i don't know how to include this file in my xml documents.
    Especially is there a command to import all entities from the file
    rather than importing them one by one.

    Thanks for help.
  • Richard Tobin

    #2
    Re: Including entities file in an xml document

    In article <40a3c0d4$0$183 20$626a14ce@new s.free.fr>,
    chak <cberion@naema. org> wrote:
    [color=blue]
    >I found on google a file called iso-lat1.ent (part of DocBook project)
    >which defined all entities i need.[/color]
    [color=blue]
    >But i don't know how to include this file in my xml documents.
    >Especially is there a command to import all entities from the file
    >rather than importing them one by one.[/color]

    You could place a copy of the entity file in the same directory as your
    document, then add it to your DTD like this:

    <!ENTITY % lat1 SYSTEM "iso-lat1.ent">
    %lat1;

    If you don't have a DTD, you can just use the internal subset:

    <!DOCTYPE whatever [
    <!ENTITY % lat1 SYSTEM "iso-lat1.ent">
    %lat1;
    ]>

    Better, you can use a PUBLIC declaration, and then systems which support
    XML catalogs and have a local copy will not have to fetch it, but you'll
    have to find the public identifier yourself.

    -- Richard

    Comment

    Working...