discuss-gnustep
[Top][All Lists]
Advanced

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

Reading CData from NSXMLNode


From: JohnDuff
Subject: Reading CData from NSXMLNode
Date: Mon, 3 Sep 2012 06:34:22 -0700 (PDT)

Hi,

I use GNUStep on Windows XP and I work with XML.
I built a NSXMLDocument from NSData, and I read each NSXMLNode (with a tree
parser).
I overrode elementsByName which is not yet implemented : no problem.

I can read names and attributes (keys and values) but no CData blocks !!
I tried a lot of options, I checked encoding, etc. : on Mac, [node
stringValue] give me the CData string, but on Windows (same code), I always
have an empty string.

EXAMPLE:

<root><node><![CDATA[How to read this text ?]]></node></root>

NSXMLDocument * document = [[[NSXMLDocument alloc] initWithData:data
options:(NSXMLNodePreserveCDATA | NSXMLNodePreserveWhitespace)
error:outError] autorelease];
NSXMLElement * rootElement = [document rootElement];
NSXMLNode *childNode = [rootElement childAtIndex:0];
NSString *cData = [childNode stringValue];



Thx for your help.
John.
-- 
View this message in context: 
http://old.nabble.com/Reading-CData-from-NSXMLNode-tp34383080p34383080.html
Sent from the GNUstep - General mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]