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

Re: variable and html code

Subject: Re: variable and html code
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 27 Jun 2003 14:16:01 +0100
variable in html

>  one of the input_text or addlinks  variable, gets striped of
> the html tags.

Note XSLT doesn't process tags at all.
If your input_text parameter will never have any elements so I don't se
ehow it can have elements "stripped"
You didn't show your full code, but you showed it being initialised in a
template matching text() and text nodes only have text.
Again <xsl:with-param name="input_text">
                   <xsl:copy-of select="."/>
             </xsl:with-param>
would be better as
<xsl:with-param name="input_text"select="."/>
(not that it would make any difference to the result in this case)

oh there it is.. on the second ass, you do have markup the a element you
have just added.

  <xsl:with-param name="input_text">
                   <xsl:copy-of select="$addlinks"/>
              </xsl:with-param>

which would again be better using select, but either way it makes no
difference as in the end it gets passed to

         <xsl:copy-of select="substring-before($input_text, $word)"/>

substring-before expects strings as its arguments. If you give it a node
set then it takes its string value (which is just the character data
without any elements).

What you want to do is restructure your replacement as follows.
do the first word by applying these templates, storing the entire result
of teh replacement into a variable, then use your processors node-set()
extension function to convert this variable back to a node set, then
apply the templates again, this time looking for your second word
etc until you run out of words.

This would be 1000 times easier using the regexp replacement functions
available in XSLT2 so if using saxon 7 is a possibilty youmay want to
try that.

David





________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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


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