Contents

parser(_:foundCDATA:)

Sent by a parser object to its delegate when it encounters a CDATA block.

Declaration

optional func parser(_ parser: XMLParser, foundCDATA CDATABlock: Data)

Parameters

  • parser:

    An NSXMLParser object parsing XML.

  • CDATABlock:

    A data object containing a block of CDATA.

Discussion

Through this method the parser object passes the contents of the block to its delegate in an NSData object. The CDATA block is character data that is ignored by the parser. The encoding of the character data is UTF-8. To convert the data object to a string object, use the NSString method init(data:encoding:).

See Also

Handling XML