Including entities file in an xml document

C

chak

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.
 
R

Richard Tobin

chak said:
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.

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
 

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,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top