开发者

NSXMLParser foundCharacters returning "\n " characters

开发者 https://www.devze.com 2023-03-22 10:33 出处:网络
I have an xml parser and the foundCharacters call back method is returning strings like this: \"\\n\" \"\\n\"

I have an xml parser and the foundCharacters call back method is returning strings like this:

"\n     "
"\n  "

Here the part of the XML that I am parsing and I don't see this string anywhere in it:

<GetChannelMessages xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
  <element p2:type="ToonInDevModel.GetChannelMessagesTest_Result" xmlns:p2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <messageid p2:type="Edm.Int32">15030</messageid>
    <userid p2:type="Edm.Int32">1</userid>
    <Handle xml:space="preserve">Henry     </Handle>
    <Distance p2:type="Edm.Double">16.845658889067568</Distance>
    <MessageDateTime p2:type="Edm.DateTime">2011-07-18T03:14:43.17</MessageDateTime>
    <Message>Posting this message again</Message>
  </element>
  <element p2:type="ToonInDevModel.GetChannelMessagesTest_Result" xmlns:p2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <messageid p2:type="Edm.Int32">15021</messageid>
    <userid p2:type="Edm.Int32">1</userid>
    <Handle xml:space="preserve">Henry     </Handle>
    <Distance p2:type="Edm.Double">16.845658889067568</Distance>
    <MessageDateTime p2:type="Edm.DateTime">2011-07-18T01:45:17.097</MessageDateTime>
    <Message>Posting this message again</Message>
  </element>
  <element p2:type="ToonInDevModel.GetChannelMessagesTest_Result" xmlns:p2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <messageid p2:type="Edm.Int32">15018</messageid>
    <userid p2:type="Edm.Int32">1</userid>
    <H开发者_运维百科andle xml:space="preserve">Henry     </Handle>
    <Distance p2:type="Edm.Double">16.845658889067568</Distance>
    <MessageDateTime p2:type="Edm.DateTime">2011-07-18T01:33:18.1</MessageDateTime>
    <Message>Posting this message again</Message>
  </element>

Is there something wrong with this XML?


This is normal.

"\n" is a linebreak character. The XML parser will tell you about all characters it finds, even the spaces and lines between the elements themselves.

0

精彩评论

暂无评论...
验证码 换一张
取 消