xsl-list
[Top] [All Lists]

[xsl] On the fly search and replace using XSLT 2.0

2010-03-15 09:04:49
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>