Re: NSXMLElement children doesn't return whitespace text nodes
Re: NSXMLElement children doesn't return whitespace text nodes
- Subject: Re: NSXMLElement children doesn't return whitespace text nodes
- From: Heath Borders <email@hidden>
- Date: Fri, 04 Mar 2011 09:40:16 -0600
That worked!
Embarrassingly, I looked at the documentation for NSXMLDocumentTidyXML
and found my answer, as well:
Changes malformed XML into valid XML during processing of the document.
It also eliminates “pretty-printing” formatting, such as leading tab
characters. However, it respects the xmlns:space="preserve" attribute.
(Input)
Available in Mac OS X v10.4 and later.
Declared in NSXMLNodeOptions.h.
-Heath Borders
email@hidden
Twitter: heathborders
http://heath-tech.blogspot.com
On Thu, Mar 3, 2011 at 10:33 PM, Gideon King <email@hidden> wrote:
> I recall that I had problems with that too, and IIRC, the NSXMLNodePreserveWhitespace didn't seem to work, but right now I have xml:space="preserve" in the XML and parse it with just the NSXMLDocumentTidyXML option, and that works. I believe I just went through all the combinations and permutations until I found that magic combination, and have just stuck with it.
>
> HTH
>
> Regards
>
> Gideon
> On 04/03/2011, at 3:02 AM, Heath Borders wrote:
>
>> I have the following xml:
>>
>> <root><foo>A foo.</foo> <bar>A bar.</bar></root>
>>
>> Is there a way to access the whitespace-only NSXMLTextKind NSXMLNode?
>>
>> I've also tried changing my document thusly:
>>
>> <root xml:space="preserve"><foo>A foo.</foo> <bar>A bar.</bar></root>
>>
>> I specify
>>
>> NSXMLNodePreserveWhitespace
>>
>> as my option to NSXMLDocument's
>>
>> initWithXMLString:options:error:
>>
>> selector.
>>
>> Thanks!
>>
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden