Site
Layout
Linking
Customization
Building
Form
Test
XBEL
Bookmarks
|
Linking Pages
In Website, the website pages are different XML
documents so it is no longer possible to use
link to make links between them. Instead, you
must use olink[1].
Olink is different from the other linking
mechanisms that you may be familiar with. Instead of
using a URI or an IDREF to form the link, it uses an
XML unparsed entity. If that sounds greek, don't worry
too much, it's easy to do.
-
Create an entity
declaration that identifies the target page. For
example, to link to this page, I would use the
following declaration:
<!ENTITY linking SYSTEM "olink.xml" NDATA XML>
The name that you use for the entity,
linking in this case, is irrelevant. The
important thing is that the entity point to the
right page. I've used a system identifier here,
but you could also use public identifiers if you
wanted more flexibility.
Keep in mind that the systen identifier
specified here must be either an absolute URI or
a relative URI that will resolve to the target
page (in other words, you may need to prefix it
with a partial path name, if you keep your XML
webpages in different directories).
-
Make sure the webpage
that you are linking from (you don't have
to do anything special to the page you're linking
to) has a “DOCTYPE” declaration with
an internal subset. If your olink entity
is the only thing in it, it should look like
something like this:
<!DOCTYPE webpage PUBLIC "-//SF DocBook//DTD Website V2.0//EN"
SYSTEM "http://www.sf.net/docbook/release/website/2.0/website.dtd [
<!ENTITY linking SYSTEM "olink.xml" NDATA XML>
]>
If you want to link to several different
pages, you will need an entity declaration for
each of them.
-
Use the
targetdocent attribute of olink
to identify the entity of the page you want to
link to:
<olink targetdocent="linking">link text</olink>
That will link to the correct page in the
resulting website. If you want to link to a
specific anchor in that web page, use the
localinfo attribute to specify the XML
ID.
|