• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSXMLParser and CDATA sections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLParser and CDATA sections


  • Subject: Re: NSXMLParser and CDATA sections
  • From: Kevin Ballard <email@hidden>
  • Date: Tue, 28 Sep 2004 19:45:18 -0400

I've never used NSXMLParser, but does

- (void)parser:(NSXMLParser *)parser foundProcessingInstructionWithTarget:(NSString *)target data:(NSString *)data

trigger on the initial <?xml?> element? If so, you could probably extract the encoding there.

On Sep 28, 2004, at 4:26 PM, Jim Correia wrote:

I am trying to parse an XML file with NSXMLParser.

The file in question has CDATA sections. When I encounter on the delegate is called:

- (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock
{
	NSLog(@"CDATA: %@", CDATABlock);
}

The problem is that the CDATABlock is provided as an NSData blob. But CDATA is just characters, in the XML document's encoding.

Is there a way (without resulting to ad hoc methods) of getting the document's encoding so I get out the string data?

-- Kevin Ballard email@hidden http://www.tildesoft.com http://kevin.sb.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSXMLParser and CDATA sections
      • From: Jim Correia <email@hidden>
References: 
 >NSXMLParser and CDATA sections (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: binding (converting call from Objective-C to Java
  • Next by Date: Re: binding (converting call from Objective-C to Java
  • Previous by thread: NSXMLParser and CDATA sections
  • Next by thread: Re: NSXMLParser and CDATA sections
  • Index(es):
    • Date
    • Thread