CHITRAKSH wrote:
ok sir
please guide me about "to provide HTML or XML for reading and want to implement some featured facilitating reading…"
This is not a simple thing, so I can only give you some ideas. If you take it seriously, it can be quite a big work; and I'm not sure it makes sense for your to deal with all that.
I'll try to start with trivial things to more advanced.
First of all, you can provide document in HTML and just style it using CSS to make the book document suitable for reading. The problem is that this approach would be a bit too much of
ad hoc for a high-scale library. HTML allows many styles; and nothing enforce the authors of the document layouts to unify them. Different books would require different layouts, and it would require a lot of manual work. I hope you understand that the text written by authors or presently available on the Web are
en mass very poorly laid out. Very few authors use proper dash, quotation makes, layout dialogs and captions, and, most sadly, such items as index, TOC, notes and references. The most sorrowful problem is such feature as footnotes. HTML itself does not enforce anything, for example, nothing checks that the anchors referencing the TOC or reference items matches the anchors at the items themselves, that navigating to a reference allows to quickly return to the main text at right point.
Some of such features can be implemented using XML with XSLT:
https://en.wikipedia.org/wiki/XSLT[
^].
This approach would allow to shape the document as XML which can be formally validated against some XML schema:
https://en.wikipedia.org/wiki/XML_Schema_%28W3C%29[
^].
In this case, the user still reads HTML, but this HTML is automatically generated from XML. It would allow serious degree of unification of text and automatic check up of the validity of their structure. At the same, the, generation HTML from XML with XSLT can be problematic, because the power of a purely declarative languages is limited and because XSLT is relatively hard to debug. You cannot, for example, implement such features as creating of separate HTML elements dynamically (separate div for TOC and/or references of footnotes, for example), change presentation options dynamically, and so on.
Next level could be achieved on the base of JavaScript, or server-side technology (PHP is only one of them), or some combination of both. In this case, you would use
imperative languages, which are easy for debugging and can implement a lot more features, such as those mentioned above.
At this time, I would recommend using one available standard based on XML. This is the free and open e-book standard called EPUB:
https://en.wikipedia.org/wiki/EPUB[
^].
First of all, during last years, more and more books laid out in this standard are emerging; and the readers and authoring tools are emerging and are being improved. So, the first benefits is: you can always use some available readers and preview the book off-line. This is also the opportunity to test your Web reader functionality on the books; you can also easily create some text books using available authoring tools. The feature set of the standard itself is the most comprehensive.
And finally, you can try to find some available implementation which you can use on your site. I never saw any, but you can try. Anyway, I found a number of such implementations:
http://bfy.tw/Vcu[
^].
—SA