A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/1102.htmlDocument ID: 1102
Branch: main
Language: default
Name: LinkRewriterTransformer (unchanged)
Document Type: Sitemap Component (unchanged)
Updated on: 9/9/08 11:11:19 PM
Updated by: David Legg
A new version has been created, state: draft
Parts
=====
Long description
----------------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 8361 bytes (previous version: 6648 bytes)
Content diff:
<html>
<body>
+++ <p>The LinkRewriterTransformer is an extremely useful transformer that can play
+++ a large role in how resources can link to other resources.</p>
+++
+++ <p>It takes some XML at its input, searches for certain specified attributes of
+++ nodes and changes their value according to some pattern before passing the
+++ resulting XML onward through the pipeline.</p>
+++
+++ <p>The transformer was originally developed as part of the Apache Forrest
+++ project. In earlier versions of Forrest (and in similar systems), there was
+++ only one URI space: that of the generated site. If page1.xml needed to link to
+++ page2.xml then page1.xml would use:</p>
+++
+++ <pre><a href="page2.html">See Page 2</a></pre>
+++
+++ <p>A problem with this is that the content producer should not know or care how
+++ the source page is rendered. A URI should only <em>identify</em> a resource,
+++ not specify it's type. If for example our page2.xml file was rendered as a PDF
+++ file, you can see that the link in page1.xml would break.</p>
+++
+++ <p>Forrest's solution was simple: instead of <a href="page2.html">, write
+++ <a href="site:page2"> where:</p>
+++
+++ <blockquote>
+++ <p><strong>site</strong> is a URI "scheme"; a namespace that restricts the
+++ syntax and semantics of the rest of the URI. The semantics of "site" are "this
+++ identifier locates something in the site's XML sources".</p>
+++ </blockquote>
+++
+++ <blockquote>
+++ <p><strong>page2 </strong>identifies the content in page2.xml by reference to a
+++ "node" of content declared in site.xml We call this indirect, or
+++ <em>semantic</em> linking because instead of linking to a physical
+++ representation (page2.html), we've linked to the "idea" of "the page2 file". It
+++ doesn't matter where it physically lives.</p>
+++ </blockquote>
+++
<h3><strong>Example</strong></h3>
<p>For instance, if we had an
(152 equal lines skipped)