Re: [xsl] Passing through character entities intact

Subject: Re: [xsl] Passing through character entities intact
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 11 Oct 2001 16:05:19 +0100
> why can the serializer check for document specific references?

because there is nothing in the data model that could tell the XSLT
processor what entities are defined in a DTD. And remember enities are
not just characters, If you had an entiy that was defined to be a whole
fragment of XML, with element and attribute nodes, would you expect the
serialiser to recognise that branch of the result tree and output it as

> Why then doesn't XSLT processors or the output XML serializer take a look at
> output document type and any included general entity declarations could
> matched to the output stream to replace with a reference.

Taking a real example, the DTD most used around here has a thousand or
so enity definitions that look like the one at the end of this message.

Do you really expect the serialiser to spot that occuring in the result
tree and write it out as &e04BL-a; ?

& has to be output as &amp; (or some equivalent thing) as an unquoted &
is illegal, so the situation there is different.

Given that you are writing an XML (or HTML) file and so any application
that is reading that output will not care whether there is an entity
reference or its expansion, why do you think it important that XSLT
support that?


<!ENTITY e04BL-a	'<input><arg>BL</arg> must contain the lower bounds and <arg>BU</arg> the upper bounds, for all the constraints in the following order.  The first <maths>n</maths> elements of each array must contain the bounds on the variables, the next <maths>n_{L}</maths> elements the bounds for the general linear constraints (if any) and the next <maths>n_{<arg>N</arg>}</maths> elements the bounds for the general nonlinear constraints (if any).  To specify a non-existent lower bound (&ie; <maths>l_{j} = -\infty</maths>), set <maths><arg>BL</arg>(j) \leq -bigbnd</maths>, and to specify a non-existent upper bound (&ie; <maths>u_{j} = +\infty</maths>), set <maths><arg>BU</arg>(j) \geq bigbnd</maths>; the default value of <maths>bigbnd</maths> is <maths>10^{20}</maths>, but this may be changed by the optional parameter <bold>Infinite Bound Size</bold> (see <xref type="sec" id="optparamsdescription"/>).  To specify the <maths>j</maths>th constraint as an <italic>equality</italic>, set <maths><arg>BL</arg>(j) = <arg>BU</arg>(j) = \beta</maths>, say, where <maths>|\beta | &lt; bigbnd</maths>.</input><cons><list type="cons"><item><maths><arg>BL</arg>(j) \leq <arg>BU</arg>(j)</maths>, for <maths>j = 1,2,\ldots,<arg>N</arg>+<arg>NCLIN</arg>+<arg>NCNLN</arg></maths>,</item><item><maths>|\beta | &lt; bigbnd</maths> when <maths><arg>BL</arg>(j) = <arg>BU</arg>(j) = \beta</maths>.</item></list></cons>'	>

This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:

Current Thread