[Expat-discuss]

Laurent Carcone laurent.carcone at w3.org
Fri Mar 14 14:21:10 EST 2003


Hello,

Would it be possible to include a simple patch in Expat to report an 
unresolved external general entity in attribute value at it's original 
position inside the attribute value rather than the default handler.

In Function 'appendAttributeValue'
 in case XML_TOK_ENTITY_REF:

I replace
          if ((pool == &tempPool) && defaultHandler)
	     reportDefault(parser, enc, ptr, next);
by
          if ((pool == &tempPool) && defaultHandler)
	    {
	      const char *ent;
	      for (ent = ptr; ent < next; ent++) {
		if (!poolAppendChar(pool, ent[0]))
		  return XML_ERROR_NO_MEMORY; 
	      }
	    }

We use Expat for our open-source browser/editor Amaya and in this case, we 
need to receive the whole entity value in the elementStartHandler and let the 
application decide how to manage external entities.


Thanks,


Laurent Carcone
---------------
W3C - ERCIM
INRIA Rhône-Alpes
655 avenue de l'Europe
ZIRST Montbonnot
38334 Saint Ismier Cedex

email: laurent.carcone at w3.org / Laurent.Carcone at inrialpes.fr
Phone: +33 4 76 61 52 67  Fax: +33 4 76 61 52 07






More information about the Expat-discuss mailing list