forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Huber <>
Subject Re: [RT] InputModuleTransformer for linking (Re: [RT] LinkTranslator Usage)
Date Sun, 15 Dec 2002 09:08:49 GMT

 > With link translation, we need exactly the same thing!  Given a semantic
 > link, we need to look up a 'real' link.  In particular, to implement a
 > linkmap, we need exactly XMLFileModule's functionality.  A link like
 > <link href="site:/primer">, the address 'site:/primer' can be resolved by
 > looking up a 'site' input module (mapped to an XMLFileModule), which
 > would then use '/primer' as an XPath expression to look up the node.
okay, you have a "<link href="site:/primer"> in you xml-document.
The LinkTranslator/LinkRewriterTransformer can rewrite/map site:/primer 
to some new href.

okay, the details of rewrite/map are either implemented by
LinkTranslator or LinkRewriterTransformer.

As LinkTranslator is implemented now Cocoon2.1 as far as i understand
can only rewrite the link. Thus the above "<link href="site:/primer>"
may rewritten to "<link href="primer.html">.

 > So anyway, I'm thinking, how about implementing this as a generic
 > InputModuleTransformer, which is configured with a) an InputModule, b) an
 > XPath expression of nodes to transform.  So to transform hrefs in links,
 > we'd have:
 > <map:transformers>
 >   <map:transformer name="inputmodule" 
 >     <input-module>linkmap</input-module>
 >     ...
 >     <transformed-nodes>//link/@href</transformed-nodes>
 >   </map:transformer>
 > </map:transformers>
 > Where 'linkmap' is defined in cocoon.xconf as:
 > <component-instance name="linkmap" 
 >     <file src="context://linkmap.xml"/>
 > </component-instance>
 > Since XMLFileModule can use any Source, so can our linking system.  Want
 > to link to whatever's the top Slashdot article?  Add a 'slashdot'
 > InputModule (in the samples sitemap), and add <link
 > href="slashdot:/*:RDF/item[1]/title}">Slashdot Headline</link> to your
 > XML.
 > What do people think?  Is this the base for a majorly cool linking
 > system, or am I missing something?
I must admit that i have followed a bit the module-discussion,
but don't know how-to use it in the sitemap.

The LinkRewriterTransformer seems to be a bit more flexible.
What is the rewritten <link href="slashdot:/*:RDF/item[1]/title">?
Does linkmap.xml contains the mapping?

The cool feature of a linking system:
Slashdot changes its internal linking, only updating the linkmap.xml
will adopt my site to the new slashdot structure w/o changing the xml 
of my site.
As far as i see LinkTranslator/LinkTransformer support this.

bye bernhard

View raw message