Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 28th, 2006, 05:18 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL to replace text in XML file

Hi,
     I need to create an XSL to take an input XML and modify the contents of a particular tag. So the output XML is almsot same as the input XML except for the contents of a single element.For example, I wanty to change the contents of child2 only. rest of the document remains the same.
example: input.xml
Code:
<root>
    <parent>
        <child1>a</child1>
        <child2>b</child2>
    </parent>
    <parent>
    .
    .
    </parent>
</root>


My actual document is huge. I was lookign at the option of using apply-templates. Is it possible to do something like apply a template to just change the contents of child2 and apply another template to copy the remaining document as it is? Guide me please.
thanks,


Reply With Quote
  #2 (permalink)  
Old November 29th, 2006, 05:20 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ramesh.kumarm
Default

Hi,
I think you can do the other way round.
Copy all the contents and try to replace the child2 contents.
Check out this in http://p2p.wrox.com/topic.asp?TOPIC_ID=52685

Ramesh
"Always Look For Something NEW"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace a text in XML file AyatKh XML 17 May 23rd, 2012 09:05 PM
How to pass the dynamic XML file name to XSL jle XSLT 3 March 13th, 2008 04:20 PM
HELP - Find text / Replace with email link (XML or peakfx XML 1 July 13th, 2007 09:07 PM
Word wrap in XSL that transforms to a text file suri_1811 XSLT 1 November 15th, 2006 03:59 PM
How to replace elements(from existed XML file)? hbcontract XML 1 October 30th, 2003 05:49 AM



All times are GMT -4. The time now is 05:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.