Branch: Tag:

2000-02-12

2000-02-12 21:27:55 by Martin Stjernholm <mast@lysator.liu.se>

Don't decode entities when the result type is t_xml or has that quoting
scheme, since literals won't be distinguished from markup in the result
then.

Rev: server/etc/modules/RXML.pmod/PEnt.pike:1.6
Rev: server/etc/modules/RXML.pmod/PXml.pike:1.27
Rev: server/etc/modules/RXML.pmod/utils.pmod:1.3

5:   //!   //! Created 2000-01-21 by Martin Stjernholm   //! - //! $Id: utils.pmod,v 1.2 2000/02/11 01:04:01 mast Exp $ + //! $Id: utils.pmod,v 1.3 2000/02/12 21:27:55 mast Exp $         array return_zero (mixed... ignored) {return 0;}
25:   {    string entity = p->tag_name();    if (sizeof (entity)) { -  if (entity[0] == '#') { +  if (entity[0] != '#') +  return p->handle_var (entity); +  if (p->type->quoting_scheme != "xml") { +  // Don't decode any normal entities if we're outputting xml-like stuff.    if (!p->type->free_text) return ({});    string out;    if ((<"#x", "#X">)[entity[..1]]) {
35:    if (sscanf (entity, "%*c%d%*c", int c) == 2) out = (string) ({c});    return out && ({out});    } -  return p->handle_var (entity); +     }    return p->type->free_text ? 0 : ({});   }