[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] usage of entities (for dummies)


Subject: Re: [xsl] usage of entities (for dummies)
From: "Georg Hohmann" <georg.hohmann@xxxxxxxxx>
Date: Thu, 3 Aug 2006 12:29:49 +0200

Many thanks for your quick help and the explanations!
With your support and the usage of the numeric reference i got it
working now. And i think i will take a deep look at the unicode
website in near future ... ;-)

Thinking of it, i wonder about the following:
Maybe it would be a good idea to have the numeric reference in the
target data too. Is there  a possibility to leave the "& # x e 7 ;"
unchanged and let it appear as "& # x e 7 ;" in the target data too?

Greets,
Georg



2006/8/3, David Carlisle <davidc@xxxxxxxxx>:

> How do i know which entities are declared by default and which not? XML has 5 predecared entities (just for characters used in xml syntax) amp lt gt quot apos so if it's one of those, it's declared, otherwise it isn't.

> How can i declare an entity of my own?
you write a DTD and use an <!ENTITY declaration. But you don't want to
do this.

Entities are expanded by the parser _before_ XSLT starts, so XSLT sees
the same input whether you use the entity reference, or just use the
character directly, or if you use a numeric character reference (which
doesn't need to be declared).

So if your keyboard or editor allows you just to type a c-cedila
character then you can just do that (if your editor uses iso-8859-1
you'd need to say your xsl file was in that encoding by putting
<?xml version="1.0" encoding="iso-8859-1"?>
at the top, or you can use the numeric reference & # x e 7 ;

David


Current Thread
Keywords