predefined entity set for spanish

P

poisondart

Is there a predefined entity set for Spanish accents? I know that I
could just easily make one, except that I intend to do this for other
languages in the future, which may have more accents than Spanish.

The closest to what I was expecting was this link:
http://www.altheim.com/specs/charents.html

....but the link to the ent file is broken.

What is the usual/preferred method that you employ to render special
characters? I'm trying NOT to reinvent the wheel.

Thanks!
 
D

David Carlisle

poisondart said:
Is there a predefined entity set for Spanish accents? I know that I
could just easily make one, except that I intend to do this for other
languages in the future, which may have more accents than Spanish.

The closest to what I was expecting was this link:
http://www.altheim.com/specs/charents.html

...but the link to the ent file is broken.

What is the usual/preferred method that you employ to render special
characters? I'm trying NOT to reinvent the wheel.

Thanks!

You don't need to use entities for (any) characters in XML, you can just
type the characters directly so long as the encoding used in the file is
declared (or you use the default utf8 or utf16 encodings) However if
you want entity sets for latin1 then there is a set available from
http://www.w3.org/2003/entities that you could use.

David
 
J

Jukka K. Korpela

poisondart said:
Is there a predefined entity set for Spanish accents?

No. Unlike HTML, XML has predefined entities for very few characters
only ("markup-significant" characters like "<").
I know that I
could just easily make one, except that I intend to do this for other
languages in the future, which may have more accents than Spanish.

The entities for Latin-1 characters as defined in HTML cover the
accented characters of Spanish and a lot more. Their names have been
taken from the SGML standard, and there's little reason to invent your
own names for them instead - even though many of the names are just
half-mnemonic, or even misleading. The SGML standard also lists many
other entities for characters, and there's a pattern in the naming of
accented characters.
What is the usual/preferred method that you employ to render special
characters? I'm trying NOT to reinvent the wheel.

XML is based on Unicode (formally, ISO 10646) as regards to characters,
and in that sense there are just characters, not special characters.
So this is probably basically an authoring tool problem. Surely you
would like to write and see all characters as such, not as entity
references?

If you think you cannot use all characters as such due to some
restrictions that apply to data transfer or processing - in this case,
that would seem to me that some external obstacle forces you to use
ASCII characters only in an XML file or datastream - then you can
hopefully find a way to do a suitable conversion _upon sending_
your XML somewhere. That is, you would work with UTF-8 and a Unicode-
capable editor but convert the data to a more primitive form for
sending over some connection or to some program. In that case, I would
suggest using character references ( where N is the Unicode number
of the character) rather than entities. No need to invent or find names
then, and no fear of incorrect processing on an XML processor that does
not read your entity declarations.
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top