[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading CData from NSXMLNode
From: |
JohnDuff |
Subject: |
Re: Reading CData from NSXMLNode |
Date: |
Wed, 5 Sep 2012 02:59:01 -0700 (PDT) |
Hi Fred,
This works with v0.31 !
Thanks a lot !
Fred Kiefer wrote:
>
> 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.
>>
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
>
>
--
View this message in context:
http://old.nabble.com/Reading-CData-from-NSXMLNode-tp34383080p34391535.html
Sent from the GNUstep - General mailing list archive at Nabble.com.