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

Re: Change text on given node at runtime

Subject: Re: Change text on given node at runtime
From: Mukul Gandhi <mukulw3@xxxxxxxxx>
Date: Wed, 23 Jul 2003 09:53:45 -0700 (PDT)
change stylesheet at runtime
Hi Jeff ,
  You can try a XSL something like below. This will
replace the contents of tag <A> with 'Some new text'
and copy other things to output as it is. But you want
to provide the tag name and the new text, *at run
time*. If you can tell what is your XSLT processor and
*how you would like to supply the 2 parameters at run
time*, i can try modifying the stylesheet accordingly.

 i don't know if Jeni's XSL is meeting your
requirement(it looks quite complicated to me for your
problem).

Regards,
Mukul

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes"/>
 <xsl:template match="@* | node()">
   <xsl:copy>
     <xsl:apply-templates />
   </xsl:copy>	    
 </xsl:template>	
	
 <xsl:template match="A">
   <A>Some new text</A>
 </xsl:template>
	
</xsl:stylesheet>


--- jeff.day@xxxxxx wrote:
> Hi
> 
> Can you please give some guidance on this...
> 
> I would like to be able, at runtime, to parse an XML
> file and change 
> 
> <A>Original text</A>
> 
> to
> 
> <A>Some new text</A>
> 
> 
> On the next occasion I might want to do this...
> 
> <F>Old text</F>
> 
> change to
> 
> <F>New text</F>
> 
> So at runtime I need to pass in two parameters that
> specify the required
> node and the new text for it.
> 
> There are two issues: Either change the text in
> every node called <A>
> throughout the document or else only change <A>
> along a particular path. A
> solution to either (or both?) option will do for me.
> 
> Of course the rest of the document must remain in
> its entirety, e.g.
> attributes, children etc.
> 
> Many thanks for any help given.
> 
> Regards
> 
> Jeff 
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

 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.