J'ai un fichier XML qui ressemble à ceciUtilisation NSXMLParsers « trouvé CDATA » méthode
<comments>
<text>
<![CDATA[
<!--cached-Tue, 02 Nov 2010 17:50:50 +0000-->
this is on the first line
<br />
This is on the second line
]]>
</text>
<text>
<![CDATA[
<!--cached-Tue, 02 Nov 2010 17:50:50 +0000-->
this is on the first line
<br />
This is on the second line
]]>
</text>
</comments>
Comment puis-je extraire les données sur cette (abstraction faite un commentaire)
J'ai actuellement.
- (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock
{
if(!myCDATA)
{
myCDATA = [[NSMutableData alloc] init];
}
[myCDATA appendData:CDATABlock];
}
Cependant, il ne semble jamais trouver la balise "]]>". Quand je casse, il n'appelle qu'une seule fois à foundCDATA.
Non seulement seulement une fois. Et j'ai aussi une méthode d'élément final. – endy
Combien de fois votre didEnd est-il appelé avec "texte"? – nicktmro