Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Delicious Library - Catalog CDs, DVDs, books...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Delicious Library - Catalog CDs, DVDs, books...
Authored by: Thom on Nov 17, '04 04:39:05AM
I would suggest using XSLT. By creating a stylesheet which takes the attributes you want from the items you care about, it's fairly easy to mock up. e.g., let's say you only wanted the author and title from just books, you might do something like the following:

(For a very similar example - where I borrowed this from - see this page.)

Put the following into a file called 'DL_as_webpage.xsl'


<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
	<html>
	<body>

	<h2>My Book Collection</h2>
	<table border="1">
		<tr bgcolor="#9acd32">
			<th>Title</th>
			<th>Author</th>
		</tr>
		<xsl:for-each select="//book">
		<tr>
			<td><xsl:value-of select="@title"/></td>
			<td><xsl:value-of select="@author"/></td>
		</tr>
		</xsl:for-each>
	</table>
	</body>
	</html>
</xsl:template>
</xsl:stylesheet>
To do the actual transform I used libxslt-1.1.9, which you can get from: http://xmlsoft.org/XSLT/downloads.html, or as they mention on that site, here is a site with OS X binaries: http://www.zveno.com/open_source/libxml2xslt.html

The command looks like this:


xsltproc -o page.html DL_as_webpage.xsl ~/Library/Application\ Support/Delicious\ Library/Library\ Media\ Data.xml
Hope this helps! -- Thom

[ Reply to This | # ]
Delicious Library - Catalog CDs, DVDs, books...
Authored by: SouthofHeaven on Nov 17, '04 09:43:19AM

Actually that helps me out a lot since I was tryign to figure out how to parse xml exported from Filemaker for my own collection to be published in a browser. Thanks for the link.

---
The big yellow one's the Sun!!!



[ Reply to This | # ]
Delicious Library - Catalog CDs, DVDs, books...
Authored by: mark hunte on Nov 17, '04 02:21:06PM

Hey Thom, thanks for that, that did help. Downloaded using Fink and it worked as you said, so time for some more playing.

Thanks again

---
mh



[ Reply to This | # ]