Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Add child node to a parent node [Thread Next] Re: Add child node to a parent nodeTo: NULL Date: 5/15/2009 8:59:00 AM "Yuriy" <yuriy_zubarev@y...> wrote in message news:8c6c99df-b810-4961-9018-585fe834391b@v...... > Hi, > > I would appreciate a help for the following use case. A source XML > looks like this: > > <parents> > <parent name="A"> > <child name="A1"/> > <child name="A1"/> > </parent> > </parents> > > A target one would look like: > > <parents> > <parent name="A"> > <child name="A1"/> > <child name="A1"/> > <child name="A1"/> > </parent> > </parents> > > All I need to do is to add another child to a parent. I know my way > around XSL when I need to remove or modify something. This is the > first time I have to "inject" a node and I cannot quite come up with a > solution. > > Thank you. > What's the rule for the new element? Is it always <child name="A1" /> or is it a copy of the other child elements? For example you could use the identity template and then add a rule for parent that copies the parent and its children and then copies the last child, which is a child element. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
