discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Reading CData from NSXMLNode


From: Fred Kiefer
Subject: Re: Reading CData from NSXMLNode
Date: Tue, 04 Sep 2012 23:39:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0

Hi John,

I converted your code example in to a base test case and committed that. On my machine this works perfectly. Now, what may be the difference? The big difference is that I am using GNUstep from SVN and you are most likely using an older release. Since the last official release of base the code for the XML classes has been completely reworked (and now requires libxml2), mostly by the people at Testplant with a lot of clean up by yours truly. There hasn't been a GNUstep base release since that, but there is an unofficial package for GNustep core on Windows which may or may not include that code.
http://ftpmain.gnustep.org/pub/gnustep/binaries/windows/gnustep-core-0.31.0-setup.exe

Best luck with that,
Fred

On 03.09.2012 15:34, JohnDuff wrote:

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.





reply via email to

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