You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Richard Cao <ri...@ca.ibm.com> on 2003/11/06 21:56:58 UTC

using the label from site.xml in links




Hello,

I'm currently trying to convert the Xalan site
(http://xml.apache.org/xalan-j/index.html) from stylebook to forrest, but
am running into some problems. (I'm a first time forrest user, so please
bear with me)

There currently is a resource linking mechanism, in which we have a
resource.xml file which contains something like:

<resources>
    ...
  <resource id="xslt4j"
            title="XalanJ Homepage"
            location="http://xml.apache.org/xalan-j"/>
</resources>

In the documents, if we have  <resource-ref idref="xml4j"/>, that will get
converted to <a href="http://xml.apache.org/xalan-j">Xalan J Homepage</a>

I'm trying to find a way to do this in forrest, but the best I've come up
with is using indirect linking.

In site.xml
<xml4j label="XalanJ Homepage" href="http://xml.apache.org/xalan-j"/>

and in the documents, using <link href="site:xml4j">XalanJ Homepage</link>.
I've read that ext: and external-refs do the same thing without the link
appearing in the menu, but haven't tried it out. But regardless, using the
above is close, but I'd rather have the link names in a centralized
location. Is there some way to use the label attribute from site.xml to
specify the link name? Or is there some other feature of forrest which I am
not aware of?


Thanks in advance for the help,

Richard Cao
XSLT Development, Toronto IBM Lab
(905) 413-2454 T/L 969-2454
richcao@ca.ibm.com


Re: using the label from site.xml in links

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Richard Cao wrote:
> Hello,
> 
> I'm currently trying to convert the Xalan site
> (http://xml.apache.org/xalan-j/index.html) from stylebook to forrest

:-)

> , but
> am running into some problems. 

:-(

> (I'm a first time forrest user, so please
> bear with me)

:-)

(I'm in smiley mode again)

> There currently is a resource linking mechanism, in which we have a
> resource.xml file which contains something like:
> 
> <resources>
>     ...
>   <resource id="xslt4j"
>             title="XalanJ Homepage"
>             location="http://xml.apache.org/xalan-j"/>
> </resources>
> 
> In the documents, if we have  <resource-ref idref="xml4j"/>, that will get
> converted to <a href="http://xml.apache.org/xalan-j">Xalan J Homepage</a>
> 
> I'm trying to find a way to do this in forrest, but the best I've come up
> with is using indirect linking.
> 
> In site.xml
> <xml4j label="XalanJ Homepage" href="http://xml.apache.org/xalan-j"/>
> 
> and in the documents, using <link href="site:xml4j">XalanJ Homepage</link>.
> I've read that ext: and external-refs do the same thing without the link
> appearing in the menu, but haven't tried it out. But regardless, using the
> above is close, but I'd rather have the link names in a centralized
> location. Is there some way to use the label attribute from site.xml to
> specify the link name? 

Not AFAIK, but it would indeed be nice to have Forrest insert the link 
label where the link has no content.

So you would do:

   <link href="site:xml4j"/>

or

   <link href="ext:xml4j"/>

and have it correctly expanded.

I'll see to have this included.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------