473,387 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

transforming a book for online use -- looking for linking advice

I'm new to this board so I hope this reqest isn't out of line, but I'm
looking for some general advice about creating links in online books.
If the link target didn't involve PIs I don't think I'd be here, but
since it does, I'd be interested in getting some different perspectives
on this.

I have an XML book and I plan to create XHTML so I'm looking for the
best way to create links from the various components of the book to the
page break PIs.

The page break PIs look something like this: <?textpage page-no12?>

And I want to create a link to this spot from the other locations in
the book that cite the content on page 12. For example, I want to
create a link from the index entry that mentions page 12 to the page
break PI.

<index><index-entry>Turing,
Alan</index-entry><index-page-ref>12</index-page-ref></index-entry></index>

What's the best way to store the info in the data so I can build this
link when I run my transform?

I was thinking that I would have to add an ID value to my PI like so

<?textpage page-no_12 ID_0051243?>

and have a corresponding href on my index entry: <index-page-ref
href="0051243">12</index-page-ref>

Any advice greatly appreciated.


I

Oct 21 '06 #1
3 1569
provowallis wrote:
I'm new to this board so I hope this reqest isn't out of line, but I'm
looking for some general advice about creating links in online books.
If the link target didn't involve PIs I don't think I'd be here, but
since it does, I'd be interested in getting some different perspectives
on this.

I have an XML book and I plan to create XHTML so I'm looking for the
best way to create links from the various components of the book to the
page break PIs.

The page break PIs look something like this: <?textpage page-no12?>
The first question with milestone markup like this is,
does the page 12 refer to the text following the PI, or preceding it?
In other words, does each PI mark the start or end of a page?
And I want to create a link to this spot from the other locations in
the book that cite the content on page 12. For example, I want to
create a link from the index entry that mentions page 12 to the page
break PI.

<index><index-entry>Turing,
Alan</index-entry><index-page-ref>12</index-page-ref></index-entry></index>
That's not well-formed: there's a spurious </index-entryin there.
What's the best way to store the info in the data so I can build this
link when I run my transform?

I was thinking that I would have to add an ID value to my PI like so

<?textpage page-no_12 ID_0051243?>
The values in the content of a PI have no predefined semantics,
and are not parseable, so "ID" is without meaning.
and have a corresponding href on my index entry: <index-page-ref
href="0051243">12</index-page-ref>
Assuming for the moment that the pagebreak PIs mark the tops of the
pages, this template

<xsl:template match="processing-instruction('textpage')">
<a name="{.}"></a>
</xsl:template>

will create a target for your links. The template:

<xsl:template match="index-page-ref">
<a
href="#{//processing-instruction()[substring-after(.,'_')=current()/.]}">
<xsl:apply-templates/>
</a>
</xsl:template>

will create an anchor element pointing to the right target, eg if
you leave the PIs as they were (no ID, just page-no_nnn), you get

<a name="page-no_12"></a>

as the output of the PI template, and

<a href="#page-no_12">12</a>

as the output of the index-page-ref template.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Oct 26 '06 #2
provowallis wrote:
I'm new to this board so I hope this reqest isn't out of line, but I'm
looking for some general advice about creating links in online books.
If the link target didn't involve PIs I don't think I'd be here, but
since it does, I'd be interested in getting some different perspectives
on this.

I have an XML book and I plan to create XHTML
This is, incidentally, one reason I never use XSL for generating my PDF.
Using XSLT to LaTeX allows me to generate far better quality, and use
tools like makeindex and bibtex. For indexing an online version, which
doesn't have "pages" in the same sense, I link to the element which
triggered the index entry in the first place, rather than try to make it
look like a page-based document.

Have a look at http://research.silmaril.ie/latex to see an example of
this (complete with bugs: it's due for an update).

///Peter
Oct 26 '06 #3
Peter Flynn wrote:
This is, incidentally, one reason I never use XSL for generating my PDF.
XSLT turned out to be a far more general, popular, and successful tool
than anyone expected... and, unfortunately, we haven't gotten much
buy-in for XSL-FO renderers in browsers and so on. I'm still hoping that
XSL-FO will someday replace HTML (or be how XHTML is rendered), but I'm
not holding my breath.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Oct 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Alexander Rippert | last post by:
Hello, I am looking for a book about PHP. I can already programm some C#, Pascal and Delphie, so I don't need a book for the total beginner. I want be able to programm more complex...
4
by: Simon Cooke | last post by:
Hi there; A while back when I was in Albany, NY, I came across what looked like a really great C++ book for the experienced programmer. Unfortunately, I couldn't buy it and take it with me...
35
by: Markus Dreyer | last post by:
I suggested our Librarian for the University Library to buy Accelerated C++. Practical Programming by Example. by Andrew Koenig and Barbara E. Moo http://www.acceleratedcpp.com/ but she...
2
by: Carl | last post by:
Hi, I am currently developing an access database for books which contains ISBN,author,title info etc... I am trying to find an online book library or database that would allow me to search for...
4
by: Hayato Iriumi | last post by:
I'm a software engineer with 6 years of experience. I know what programming is about, but never had a chance to get into C++, and I'm picking it up now. I'm looking for a book for someone who...
2
by: Water Cooler v2 | last post by:
I am an XSL newbie and this is my first XSL example. It does not render any rows in the table. It only shows the table header row with the column lables; no data rows. Please guide me. XML FILE...
1
by: Billy Biro | last post by:
Hi. I'm looking for some recommendations for Visual Basic 2005 books. Specifically, I'm NOT looking for books that detail the elements of the language, nor explain OOP, but rather present...
3
by: mesut | last post by:
Hi colleagues, I need your advice... I have approx 1,5 years experience with ASP.NET/VB.NET 2005 and I have to switch over into C# 2005 language. I don't have experience with C# 2005...
1
by: tragomaskhalos | last post by:
All, I'm looking to get myself a book on C++/CLI, and would greatly appreciate advice from this group. I'm particularly interested in interop/mixing managed and unmanaged code, I already know...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.