7

this is my problem:

I am using TBXML in my iPad app. The XML server responses start with the xml description line:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

and TBXML is not able to parse the nodes (i.e nextSibling methods are getting null). Converting the XML to a string to remove the line is not an option as I am using a NSData object directly with the tbxmlWithXMLData() method to create my TBXML objects.

What can I do to make TBXML understand my XML? Of if not, is there any way to remove that line from the NSData?

Thanks all.

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
Gabriel Mendez
  • 1,115
  • 1
  • 9
  • 28
  • I thought a ?xml line worked fine for me, but I can't remember for sure. Is there anything in the logs? Does any node work? Perhaps you can serialize back to xml to see if anything is there. – Peter DeWeese Jul 22 '11 at 16:55
  • @Peter DeWeese> I can get the root node, but not its attributes or child nodes. The logs are not showing any problem. – Gabriel Mendez Jul 22 '11 at 17:27
  • Are you sure that the xml declaration (``) is what's causing the problem? Are there any spaces before the ``? – Daniel Haley Jul 22 '11 at 18:01
  • - It looks like I was touching the NSMutableData with some wrong lines before load it into my TBXLM objects. All is working fine now. Thank you all. – Gabriel Mendez Jul 22 '11 at 19:02
  • 2
    @gabriel mendez, Please add that answer to your question and accept it. – Peter DeWeese Jul 22 '11 at 19:53

3 Answers3

0

can you write here your code? Also with the xml (a part of it, of course)... I used TBXML a lot of times, and I hadn't problems with the xml declaration!

JAA
  • 1,024
  • 3
  • 20
  • 34
0

Where is the XML coming from? Because if you created it yourself and it is local, you can use Dashcode to make the necessary adjustments for XMLs.

Prajoth
  • 900
  • 3
  • 12
  • 26
0
  • It looks like I was adding some blank spaces before load the XML in the TBXLM objects. I removed the spaces and all is working fine now. Thank you all.
Gabriel Mendez
  • 1,115
  • 1
  • 9
  • 28