[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Reusing XML content as I publish

Subject: RE: Reusing XML content as I publish
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 28 Jan 2005 12:32:16 -0500
glossary tooltip
Nicola,

We use keys for this kind of thing. One can do it using brute force XPath, but this is often not pretty (either as code, or in performance).

In this case, glossary items could be retrieved by name using

<xsl:key match="glossaryitem" use="@name" name="glossaryitems-by-name"/>

So I would write: 'You can then <glossarytt name="Allocate"
width="200">Allocate</glossarytt> resources'

Given this source,


<xsl:template match="glossarytt">
<xsl:apply-templates select="key('glossaryitems-by-name',@name)" mode="tooltip"/>
</xsl:template>


... the key() function in the select expression retrieves the glossaryitem node that belongs to the matched glossarytt. You could then have a template matching the glossaryitem in mode "tooltip" to generate your tool tip.

Cheers,
Wendell

At 11:37 AM 1/28/2005, you wrote:
What I want to do is pick up the text from one of the terms and reuse it
elsewhere in the document by referencing just the glossary item "name",
and getting the term and definition as part of a 'tooltip.'

So if the glossary entry is:
<glossaryitem name="Allocate">

<term>Allocate Stuff</term>

<definition>

<para>Stuff about allocations</para>

</definition>


And in the document (in another section completely)I write, 'You can then Allocate resources' I want to be able to add a tag that will then pick up the glossaryitem details without me having to retype it.

So I would write: 'You can then <glossarytt name="Allocate"
width="200">Allocate</glossarytt> resources'

When I publish to HTML, the glossarytt tag would request the specific
<glossaryitem> and pick up the <definition>, and format them into a
tooltip:

<a href="#" class="tooltip_Allocate">Allocate<span>Stuff about
allocations</span></a>

The user would then see the text 'You can then Allocate resources' with
Allocate underlined. When they clicked on it they would get a
description of the term.

I can do the tooltips. I can do the glossary. What I can't get it to do
it locate a specific glossary item and then put the definition into the
right place.

Hope that helps...

Nicola


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.