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

First occurrence of glossary term in whole document

Subject: First occurrence of glossary term in whole document
From: "Marroc" <marrocdanderfluff@xxxxxxxxxxx>
Date: Wed, 30 Jul 2008 15:27:39 +0100
 First occurrence of glossary term in whole document
Hi,

I've done well. I've now created the recursive template that replaces
glossary terms throughout the <p> tags with cross-references. That is
fine... but... I only want to process the first occurrence of each glossary
term in the document and at the moment, because the XSLT is declarative, I
can't keep track of whether a particular term has been used. My XSL goes
like this:

	root template launch named template with parameter containing whole
document

	named template (recurses document and glossary list)
		stop condition: when glossary list is empty/exhausted return
whole document
		otherwise process first item in glossary list and update
document (apply templates)
			remove first item from glossary list and pass back
list and updated document to (this) named template

	template to process p/text() for glossary term

	template identity transform for rest of document nodes and
attributes

Is that enough for you to go on or should I post xsl? I suspect that I
require a rewrite with this requirement deciding the fundamental structure
of the XSL but can't think how to get started.

Thanks again,
Richard

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-2007 All Rights Reserved.