Re: WG: [xslt] decimal char problem - possible Solution



On Fri, Sep 14, 2001 at 04:52:00AM -0400, Daniel Veillard wrote:
>  I suggest people try the enclosed patch

  dammit, again,...
  here it is

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Index: entities.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/entities.c,v
retrieving revision 1.51
diff -c -r1.51 entities.c
*** entities.c	2001/09/09 08:38:09	1.51
--- entities.c	2001/09/14 08:35:31
***************
*** 708,714 ****
  		/*
  		 * We could do multiple things here. Just save as a char ref
  		 */
! 		snprintf(buf, sizeof(buf), "&#x%X;", val);
  		buf[sizeof(buf) - 1] = 0;
  		ptr = buf;
  		while (*ptr != 0) *out++ = *ptr++;
--- 708,717 ----
  		/*
  		 * We could do multiple things here. Just save as a char ref
  		 */
! 		if (html)
! 		    snprintf(buf, sizeof(buf), "&#%d;", val);
! 		else
! 		    snprintf(buf, sizeof(buf), "&#x%X;", val);
  		buf[sizeof(buf) - 1] = 0;
  		ptr = buf;
  		while (*ptr != 0) *out++ = *ptr++;
Index: encoding.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/encoding.c,v
retrieving revision 1.46
diff -c -r1.46 encoding.c
*** encoding.c	2001/07/27 22:47:14	1.46
--- encoding.c	2001/09/14 08:35:31
***************
*** 2264,2270 ****
  		 * and continue the transcoding phase, hoping the error
  		 * did not mangle the encoder state.
  		 */
! 		sprintf((char *) charref, "&#x%X;", cur);
  		xmlBufferShrink(in, len);
  		xmlBufferAddHead(in, charref, -1);
  
--- 2264,2270 ----
  		 * and continue the transcoding phase, hoping the error
  		 * did not mangle the encoder state.
  		 */
! 		sprintf((char *) charref, "&#%d;", cur);
  		xmlBufferShrink(in, len);
  		xmlBufferAddHead(in, charref, -1);
  


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]