Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 19th, 2007, 03:26 PM
Registered User
Join Date: Dec 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT Node add/delete

Hello all

Can some one help me to accomplish following things?

1) add a node in an input xml dynamically?

2) delete a node in an input xml.

In both cases, i know the node where it needs to be inserted/deleted?
say 2nd element after root node


Old December 19th, 2007, 05:22 PM
Authorized User
Join Date: Nov 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jkmyoung

Are you adding/deleting a node on different occassions or simply replacing it?
I suggest using a copy stylesheet first, and then setting up templates for elements that match certain conditions.

How dynamic are you trying to make this? Is it always one of the 2nd level nodes? eg. can be found by xpath /*/* ?
Old December 20th, 2007, 03:01 AM
Registered User
Join Date: Dec 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for your reply, meanwhile i am able to acomplish using xsl:copy, xsl:copy-off and for -each to perform that operation

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete a xml node with all attributes and s vishnu108mishra XML 2 November 14th, 2007 04:19 AM
delete XML node in Perl crmpicco Perl 4 November 28th, 2006 12:12 PM
delete XML node with javascript crmpicco Javascript How-To 5 April 6th, 2006 03:35 AM
How to delete an element and parent node. crossedge XSLT 1 March 14th, 2006 05:10 AM
how to add or delete a node from an xml documnet sai XML 1 March 22nd, 2004 06:54 AM

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