readium/readium — pull request #92 by guetux (2012-05-03 14:31:48+00:00)
Title: Add xpath independent opf parser

Hi there!

Finally got some time to digg a little further into #85. One of the biggest problems seems to be the missing XPath support of androids WebKit-Build for any version before Honeycomb. Jath, the tool used to convert opf xml to json, largely depends on XPath. However, the android 2.2 and 2.3 versions still build the majority over all phones worldwide. I could think of three approaches:

1. Use a javascript based XPath implementation (slow)
2. Use another XPath independent XML to JSON converter like operation-treadstone
3. Use a handmade opf to json parser

I decided to implement version 3 because i'm not sure if treadstone is ready for production use. The custom parser is only used if the current browser does not support XPath. What do you think?