views:

163

answers:

1

In objective c how does an xmlchar data type work? I can't seem to find any API documentation. Specifically my declaration looks like:

    const xmlChar **attributes

Am I classifying this correctly by saying it's an objective c data type or is it specific to cocoa or just C?

+3  A: 

I don't think that Objective-C has any sort of xmlChar data type. In Cocoa, you will generally use an NSXMLParser, which just uses NSString. Are you perhaps thinking of libxml2? In that case, it's simply defined as an unsigned char representing a UTF-8 octet (to help the compiler give warnings if you try to cast it to a char). You can generally treat an xmlChar * like a regular char *, as long as you keep in mind that it's UTF-8 encoded rather than in ASCII (so, truncating it may give invalid characters, comparing values to sort them won't work unless you implement locale-aware comparisons, etc).

Brian Campbell