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

Subject: RE: [xsl] On the fly search and replace using XSLT 2.0
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 15 Mar 2010 12:26:17 -0400
Hi,

At 10:13 AM 3/15/2010, you wrote:
> 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.

I would suggest using XML markup instead. Given a decent XML editor, the
chances are that fewer keystrokes will be required than for your proprietary
markup, and errors will be spotted sooner and identified more directly.

Note in particular that you don't need an entire element type for each type of label. One or two may do nicely.


<label which="applicationname"/>, <description which="applicationname"/>, <label which="slogan"/> etc.

As Mike says, this gives you lots more capability for creating and controlling (validating) the dynamic content with the document, as well as making for easier transformations.

Another possibility would be processing instructions, as in <?applicationname_label?>, but these are usually considered to be best managed behind the scenes rather than by and for users. Depending on how your users are creating content and on how your documents are being validated, this might be a workable option too.

Cheers,
Wendell



======================================================================
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