[Expat-discuss] About character handler and attribute value
=?iso-2022-jp?B?GyRCRWw4NhsoQg==?= =?iso-2022-jp?B?GyRCQDVDUhsoQg==?=
m-higa at jaist.ac.jp
Thu Aug 23 22:01:30 CEST 2007
Thank you.
I rewrite as follows.It worked.
void char_handle(void *userdata,const XML_char *s,int len)
{
for(int i=0;i<len;i++){
putchar(*s);
*s++;
}
I will set in this C program to C++ program.
I want to use array to put "putchar(*s)".
But becasues of const attribute,it cannot deal with this .
Please someone help me.
>>Hi, I have two questions.
>> 1. Can expat get attribute value ?
>> 2. I write C program as folows.
>> but why on the first line of first cahracter data it cut root open
>> tag(<biblio>).
>>
>> (program)
>> ....
>> void char_handle(void *userdata,const XML_char *s,int len)
>> {
>> printf("[CHARACTERDATA] %s\n",s)
>> }
>>
>
> Using printf here is the problem. const XML_char *s is not a null
> terminated string, it's a pointer into an underlying buffer. int len
> tells you how many characters there are. The text you want is
> from s to
> s+len. In the example you've given you could use a loop and
> putchar to
> output it.
>
> Jez
>
More information about the Expat-discuss
mailing list