1

i was searched for this and am getting brain fire. i am gettig

<description><![CDATA[<img src='http://behance.vo.llnwd.net/profiles22/700504/projects/2335700.jpg' style='float:left; margin-right:15px;' /><br /> NIL]]></description>

i dont know parse the Particular Link (http://behance.vo.llnwd.net/profiles22/700504/projects.jpg).

even Though i have tried to use

   - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock
   {
         if([sElementName isEqualToString:@"description"])
            {
                   NSMutableString *someString= [[NSMutableString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding];

                    NSLog(@"%@",str);
             }
  }

it is get printed like

<img src='http://behance.vo.llnwd.net/profiles22/700504/projects/2335700.jpg' style='float:left; margin-right:15px;' /><br /> NIL

help me to get the particular link. Any links or answer may help.., Thanks in Advance.,

1 Answer 1

2

The CDATA function is exactly for this purpose - if you have some XML that you want to embed into another XML as text (as opposed to as nested XML that modifies the structure itself). So, after obtaining this particular string, the <img> tag, you can use another XML parser to obtain the value of the src attribute.

6
  • @h203 thanks for the answer.could u please tell me how to obtain the value of the src attribute..,.
    – Manikandan
    Aug 28, 2012 at 11:33
  • @dhanush just as you would do with any other XML parsing.
    – user529758
    Aug 28, 2012 at 11:35
  • @h203 :is there any tutorial is available for this?? Or any links explaining About this Parsing ???
    – Manikandan
    Aug 28, 2012 at 11:40
  • The contained data is no well formed XML. Aug 28, 2012 at 12:26
  • @NikolaiRuhe no. But it's similar - there are XML-based HTML parser libraries, etc. so no need to downvote.
    – user529758
    Aug 28, 2012 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.