473,758 Members | 8,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1596
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="processi ng-instruction('te xtpage')">
<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(.,'_')=cu rrent()/.]}">
<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
3913
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 programms (like a forum) as soon as possible. I also want to start with mySQL.
4
1773
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 because I was already carrying too much stuff to fly home with it. Unfortunately, I've been looking online and in every bookstore I come across ever since, and I still can't find a copy of it again. Do any of you know which book this was? Here's...
35
7921
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 replied saying it might be outdated, since it was published in 2000, and therefore not worth buying. I don't have the book, I just saw a lot of recommendations for it on the web. Do you think it's outdated? Is a new version planned? What is the best...
2
4800
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 a particular subject and export the results to csv for importing into my database. The list needs to be detailed and contain ISBN, author,year,publisher etc...
4
3572
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 already has programming background. I don't want to have to go through what is a class or Hello World type of thing. Can anyone suggest a good book for C++? I am interested in both managed and unmanaged C++ programming. TIA
2
1182
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 ======== <?xml version="1.0" encoding="ISO8859-1" ?> <?xml-stylesheet type="text/xsl" href="booklist.xsl"?> <BOOKLIST> <BOOK>
1
1551
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 real-world scenarios for application development, and show how classes/components can be developed together to form the overall application. As an example, I already have a copy of Wrox's "ASP.NET 2.0 Website
3
1879
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 language. (but 10 years experience in mainframe languagues). My question is: I need a good book can someone advice it? I'm only interested in ASP.NET not in windows pages.
1
987
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 standard C++ so what I don't want is a book covering C++ basics, nor do I really want reams of class library documentation. Ideally it should cover advanced topics not readily available online and also cover more recent things (eg marshal_as). I...
0
9506
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9317
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9924
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8759
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3844
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3423
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2719
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.