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

On the fly search and replace using XSLT 2.0

Subject: On the fly search and replace using XSLT 2.0
From: Jacobus Reyneke <jacobusreyneke@xxxxxxxxx>
Date: Mon, 15 Mar 2010 16:00:01 +0200
 On the fly search and replace using XSLT 2.0
Good day,

What is the best way to markup and replace a word on the fly using XSLT 2.0.

I am considering using a markup e.g. _applicationname_label_,
_applicationname_description_, _slogan_label_ in my documents, to
enforce consistency in naming and descriptions of products etc. This
is especially important since more than one author will be editing the
documentation. The idea is to be able to change a word depending on
the output type, audience, target market, etc.

Example:
The _applicationname_label_ described in this _outputmedium_label_
help students to focus on the content of their _studytask_label_.
_studytask_description_

Sample Output 1:
The *EditorX* described in this *manual* help students to focus on the
content of their *dissertations*. *A dissertation is ....*

Sample Output 2:
The *Crazy-Editor* described in this *tutorial* help students to focus
on the content of their *assignments*. *An assignment is....*

My idea is to keep a separate <definitions/> group in which the labels
and definitions of these terms will be kept:
<definitions>
  <applicationname>
   <label>
     Touch Editor
   </label>
   <description>
     A simple editor for mobile devices
   </description>
  </applicationname>
....
</definitions>

The reason I'm not using <productname/> inline as the markup language
is because other elements of type <productname/> already exist in some
documents and I don't want to confuse actual elements with simple
placeholders for names. Also, using xml cross references felt wrong
for just replacing a word or description on the fly. Maybe it is
right, but even so, I would appreciate advice.

So far the help I have received from this forum has been fantastic. I
am not lazy for asking such simple questions, but I have found that an
expert's insight avoids a great deal of heart-ship in the long term.
Thank you all for all the help and knowledge shared so far.

Kind regards,
Jacobus

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