• 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: Converting HTML entities to NSXMLNode tree
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting HTML entities to NSXMLNode tree


  • Subject: Re: Converting HTML entities to NSXMLNode tree
  • From: Timothy Larkin <email@hidden>
  • Date: Sat, 3 Sep 2005 15:50:00 -0400


On Sep 3, 2005, at 9:51 AM, Ben Kazez wrote:

So, given a text node containing entity-ized XML, how do I convert this into an NSXMLNode tree representation of the XML, beneath the node?


I don't think I fully understand your problem, but I'll give a go at a solution.


Given an NSString object (xml) containing a string of XML, you can create an XML tree using

NSXMLDocument *doc = [[NSXMLDocument alloc] initWithXMLString:xml
options:NSXMLNodePrettyPrint
error:nil];


Then you get the doc's root element, an instance of NSXMLElement, with [NSXMLDocument rootElement]. From there you walk the tree by iterating over [NSXMLNode children].

Tim Larkin
Abstract Tools
_______________________________________________
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


References: 
 >Converting HTML entities to NSXMLNode tree (From: Ben Kazez <email@hidden>)

  • Prev by Date: Re: Object exclusion
  • Next by Date: SecKeychainFindGenericPassword
  • Previous by thread: Converting HTML entities to NSXMLNode tree
  • Next by thread: Re: Converting HTML entities to NSXMLNode tree
  • Index(es):
    • Date
    • Thread