xsl-list
[Top] [All Lists]

RE: code review

2004-02-20 13:56:58
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Theresa Devine
Sent: 20 February 2004 19:48
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] code review

I was wondering if ya'll might review my xslt and see if 
there is a more efficient way of doing this transformation. 
The part I have questions about is the search and replace.... 

You can also use the generic xslt template at EXSLT for str:replace
found at
http://www.exslt.org/str/functions/replace/index.html or perhaps its
preceding ancestor at Jeni Tennison's page on
http://www.jenitennison.com/xslt/utilities/markup.html

w/o knowing if you have control over your xml data structure ( or seeing
it ) I cant really suggest much...

With your 3rd call-template you might have better joy using a matching
template on text() that does the global replace of ampersands and
special characters using translate() function...though u might also just
use some external process like HTML Tidy to achieve this type of
cleanup.

Your desire to replace text data ( ex. #accred# ) might be better served
by simply using an element as replacement; this is interesting approach
and something that the following article shows though in the context of
character representation

http://www.xml.com/pub/a/2003/01/02/xmlchar.html

Basically u want to have a token in your markup, why not use xml as the
token instead of locking it up in some text format...though maybe u want
to also have some other non xml find and process such tokens...not sure.


gl, Jim Fuller


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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