<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Davin&#039;s blog &#187; Apple</title>
	<atom:link href="http://blog.davingranroth.com/tag/apple/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.davingranroth.com</link>
	<description>Occassional posts on user experience design, faith, and family.</description>
	<lastBuildDate>Mon, 09 Aug 2010 21:10:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>XSL to get text from Apple Pages documents</title>
		<link>http://blog.davingranroth.com/2009/11/xslt-to-get-text-from-apple-pages-documents/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=xslt-to-get-text-from-apple-pages-documents</link>
		<comments>http://blog.davingranroth.com/2009/11/xslt-to-get-text-from-apple-pages-documents/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:36:33 +0000</pubDate>
		<dc:creator>Davin Granroth</dc:creator>
				<category><![CDATA[Web design and technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Pages]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSL]]></category>

		<guid isPermaLink="false">http://blog.davingranroth.com/?p=925</guid>
		<description><![CDATA[Pages is the name of Apple&#8217;s basic word processor program that comes with their iWork suite of applications. It&#8217;s not a bad program, but a number of months ago I needed to switch up to MS Word for the Mac. &#8230; <a href="http://blog.davingranroth.com/2009/11/xslt-to-get-text-from-apple-pages-documents/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Pages is the name of Apple&#8217;s basic word processor program that comes with their iWork suite of applications. It&#8217;s not a bad program, but a number of months ago I needed to switch up to MS Word for the Mac.</p>
<p>Well, this morning I was looking through some old files and found a text document I wanted to print that I had done using Pages. Unfortunately, I had removed iWork from my Mac, so I no longer had the software to open the Pages document.</p>
<p>After a cursory search on the Internet for a program that would let me open Pages docs without having the program itself, I came up empty-handed.</p>
<p>So, I inspected the Pages document and realized it was a package. (Right click on the document icon and Show Package Contents.) The package contained an index.xml.gz file, which I unzipped and found within the body of my document amidst a whole bunch of XML code.</p>
<p>I momentarily considered reconstructing the text in TextWrangler, but thought it might be fun to write an XSLT file to do the work.</p>
<p>Please note that this is a 1st draft meant to retrieve the text from my document. It will not handle anything fancy, just text. Plus, it will only try to make each chunk of text into a plain-text paragraph in HTML, suitable for copying and pasting out of a browser window. Use at your own risk. <img src='http://blog.davingranroth.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Ok, <a href="http://blog.davingranroth.com/wp-content/uploads/2009/11/textFromPages.xsl">here&#8217;s the textFromPages.xsl file</a>.</p>
<p>Others may take this initial XSL file and do what they will with it. I hope that if you take this and make it better, you&#8217;ll comment on this post to let me (and others) know.</p>
<p>To have it be useful to you, you&#8217;ll need to know how to apply an XSL transformation to a source XML file (specifically the index.xml from Pages).</p>
<p>Hint: Firefox will do the transformation for you if you include the proper xml-stylesheet directive right after the XML prologue in the source XML file. It looks like this: <code>&lt;?xml-stylesheet href="textFromPages.xsl" type="text/xsl" ?&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davingranroth.com/2009/11/xslt-to-get-text-from-apple-pages-documents/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
