Re: [xsl] Entities

Subject: Re: [xsl] Entities
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 11 Nov 2008 11:17:22 GMT
> XML INPUT Entities: &#x201C; (left double 

These are not entity references, but numeric character references.

> 1. Taking xml input (See XML INPUT Entities), 
> perform a.xsl (sexon/altova any one of them) and 
> getting html output by encoding="UTF-8" (See HTML OUTPUT Entities).
> HTML OUTPUT Entities: tr| (left double 

That's not an entity either, it's a character in some encoding (I don't
know whaich encoding it started with as mail gateways re-encode anyway,
so what i see isn't necessarily what you posted)

> 2. Process this html output in a html editor and 
> do the required changes (This editor require UTF-8)

OK

> 3. Take above modified html and perform b.xsl

If you have html then (by default) you can not input it to xslt.
If you are using an html parser for xslt input, then that's allowed but
any entity/character handling will be a feature of that parser and we
can't help without knowing which parser it is, tagsoup libxml, ....

>  and  retrieve xml again by encoding="iso-8859-1" (See XML OUTPUT).
> XML OUTPUT Enties: &#8220; (left double 
> quote),  &#8221; (right double quote), &#8211; (n dash),  and &#8212; (m dash)

Those are numeric character references, as you started with but
expressed in decimal rather than hex.

> I want the entities should be same as input xml 
> ie. &#x201C; for left double quote.

why do you care? It's the same thing &#x201C; is : &#8220; just as
<a href="foo"> is the same as <a='foo'> you shouldn't care whether " or '
is used and you shouldn't care if hex or decimal numbers are used.
((2*16+0)*16+1)*16+13 = ((8*10+2)*10+2)*10+0 = 8220

XSLT gives no control over this by default although saxon does give
you some control in an extension attribute which may be specified on
xsl:output, or on the command line  use
saxon:character-representation="hex" 
on xsl:output.



David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread