![]() |
| ||
| new to xslt Hi guys, Im brand new to doing tansformations and cannot seem to wrap my head around it. I have a Xml File which looks something like <parentNode> The childnode labled ChildNode1 is repeated several times (the values are identical) and what i am trying to do is transform this xml into a new xml which only has one childnode1 and teh rest are "deleted" or ignored during the transformation.Everything else must stay the same and the position of the childnode needs to be the first position it is found in. I know the name of the childNode1 before hand. <parentNode>Is this even possible? How should i go about it. Thank you |
| ||
| Re: new to xslt Here is an XSLT that will do what you want. <?xml version="1.0" encoding="UTF-8"?> At the root we create the <parentNode> that will contain all children. Since we only want one childnode1, we copy the first by using the "[1]" position argument. We then loop through all of the children of parentNode, copying only those that are not named childnode1. |
| ||
| Re: new to xslt Thank you. This really Helped. |
| All times are GMT -4. The time now is 9:24 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC