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

Re: String replacement in included content

Subject: Re: String replacement in included content
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 11 Oct 2005 21:09:24 +0100
manbert
                        <xsl:variable name="contents" 
select="document(string($componentFilename))//body/form/*" />
                        <xsl:apply-templates 
select="exslt:node-set($contents)" />


you don't need a node-set extension here, (some node set extension
implemenattions would probably generate an error as they expect a result
tree fragment as argument but $contents is a node set.

so you can just use
                        <xsl:apply-templates select="$contents" />

which means you don't need the variable either, and canuse

                        <xsl:applt-templates
select="document(string($componentFilename))//body/form/*" />


> As a first attempt, ignoring the stuff about replacing %CT% when there is
> no tag defined, I tried modifying this template to use the str:replace
> template available at www.exslt.org, but that has not worked out so well.

You need to apply the string replacement (separately) to each attribute
and text node.

You don't show the templates that are invoked by the above
apply-templates call but they need the replacement call adding, perhaps
in new temlates such as
<xsl:template match="text()">
<xsl:value-of select="str:replace(....
</xsl:template>


>  I would rather do this with XSLT because I can then display
> a document with a browser

Browser XSLT implementations don't support exslt though do they?
(mozilla doesn't support any extensions at all)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. 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
________________________________________________________________________

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.