• 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: ebook reader suggestions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ebook reader suggestions


  • Subject: Re: ebook reader suggestions
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 30 Jun 2005 17:21:53 -0700


On Jun 29, 2005, at 7:51 PM, Gary Yuen wrote:

If I have XHTML documents that let's say contained a whole chapter or even book, how would I go about displaying only chapters or sections? DOM? Can I get use DOM to selectively display only parts of XHTML? Any good docs to get started with this?


You can use the DOM APIs to extract a portion of a document--a range, say--and insert it into another document. So, for example, you could use one (not displayed) WebView to load and parse your document into a DOM, and then extract a portion of it and insert it into another (displayed) WebView to show an individual section of the document.


An alternative approach would be to convert the document to an attributed string, using the text system's ability to import HTML. This is not completely faithful, since attributed strings cannot represent all of the features of HTML, but it may be sufficient for your purposes, and extracting substrings from attributed strings is more straightforward and less problematic than similar operations on a DOM.

Douglas Davidson

_______________________________________________
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: ebook reader suggestions
      • From: Gary Yuen <email@hidden>
References: 
 >ebook reader suggestions (From: Gary Yuen <email@hidden>)

  • Prev by Date: Re: Getting the Item from NSOutlineView's Notifications
  • Next by Date: [ANN] QuickLite 1.5.5 is now available
  • Previous by thread: ebook reader suggestions
  • Next by thread: Re: ebook reader suggestions
  • Index(es):
    • Date
    • Thread