NSXMLDocument Not Encoding \r\n or \n to 
NSXMLDocument Not Encoding \r\n or \n to 
- Subject: NSXMLDocument Not Encoding \r\n or \n to 
- From: James Wilson <email@hidden>
- Date: Fri, 25 Nov 2005 14:44:58 +1100
All,
I've noticed that when libxml2 is given a string containing "\r\n"
characters in it, it correctly encodes these as '
' in the XML
output it produces. However, when an NSXMLDocument exists and a node
is created as [NSXMLNode elementWithName:@"entry" stringValue:[self
entry]] where the stringValue string contains "\r\n" or "\n"
characters, it does NOT encode them as '
'. It simple treats them
as part of the string. This causes me all manner of trouble when this
XML is sent to another machine and it parses it. Obviously, the CRLF/
LFs go missing. Annoyingly, if I substitute all instances of "\r\n"
or "\n" in a string with '
' they get encoded as "&#xD;"
which causes even more problems.
So, my question is, how can I ensure that when a string containing
multiple lines (with either \n or \r\n line endings) is used to
create an NSXMLNode that when the XML output is retrieved using the
XMLData or XMLString methods on NSXMLDocument that it contains
properly encoded \r\n and \n characters?
Thanks,
------------------------[ www.lithiumcorp.com ]-----
James Wilson phone: 02 8920 8711
CCIE #6662 mobile: 0422 22 3742
LithiumCorp
Network Design, Implementation and Management Systems
-----------------------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the originator of the message and permanently delete it from your
computer.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden