The problem is probably that you're getting a wide character string back
from getValue(), but you're treating it as a string of single-byte
characters. You have one or two choices:
- transcode the string from wide characters to single-byte characters before
printing it
- if your system supports it, use the appropriate printf flag to specify
that the string is made up of wide characters (with MSVC on Windows, use
"%S" instead of "%s")

-----Original Message-----
From: Markku Pirila [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 8:02 AM
To: [EMAIL PROTECTED]
Subject: RE: getting attribute values




#> -----Original Message-----
#> From: Tinny Ng [mailto:[EMAIL PROTECTED]]
#> Sent: Wednesday, June 12, 2002 5:05 PM
#> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
#> Subject: Re: getting attribute values
#>
#>
#> PParse is using SAX parser.   So I assume you are using SAX.  So I would
#> recommend SAXPrint which is a relatively simple sample and shows
#> you how to
#> get attribute values while parsing an XML file.
#>
#> Tinny


Despite of recommendation of senior programmers I have continued playing
with PParse. I think I'm quite close to solution but still facing questions.


Why the following code prints just the first letter of the string?

        fAttrValue = attributes.getValue(i);

        if (fAttrValue != NULL )
        {
                printf("%s",fAttrValue);
        }

How can I get the whole string?

What about if the length of attributes value changes?

Markku


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to