> Hi!
>
> I'm trying to parse the value of a Node by using this piece
> of code:
>
> char *value;
> value = attr.getNodeValue().transcode();
> switch (value) {
> case "John":
> printf("Your name is John\n");
> break;
> case "Tom":
> printf("Hello, Tom!\n");
> break;
> }
>
> But I get this error:
> <<error C2450: switch expression of type 'char *' is illegal
>         Integral expression required >>
>
> Anybody could suggest an alternative to get the 'value'?

Actually you do not need to transcode the attribute value to make a
comparison.
Use DOMString::equals method, smth like:

DOMString name = attr.getNodeValue();
if( name.equals( "John" )
{
    // Greet John
}
else if ( name.equals( "Tom" )
{
    // Say Hi to Tom
}
...



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

Reply via email to