Hi all, I have several nodes that are identical. They each have a properties X: <nodes> <node> <X>one</X> <X>two</X> </node> <node> <X>aaa</X> <X>bbb</X> <node> </nodes> In my xsl I have <xsl:for-each select="//blah/nodes"> <nodes> </node> </xsl:for-each> Which is fine for getting each of the nodes out, but problem arises when I try to take out X properties of the individual node in transform. I keep getting all values of all X properties in each node by using <xsl:for-each select="//X">: nodes> <node> <Xs> <X>aaa</X> <X>bbb</X> <X>one</X> <X>two</X> </Xs> </node> <node> <Xs> <X>aaa</X> <X>bbb</X> <X>one</X> <X>two</X> </Xs> <node> </nodes> I'm very new to xsl, haven't been able to find the solution (not even not sure of the terminology). Thank you for your help, C
conorgaff@gmail.com wrote: > I have several nodes that are identical. They each have a properties > X: > > <nodes> > <node> > <X>one</X> > <X>two</X> > </node> > <node> > <X>aaa</X> > <X>bbb</X> > <node> > </nodes> > > > In my xsl I have > > > <xsl:for-each select="//blah/nodes"> > <nodes> > > </node> > </xsl:for-each> > > > Which is fine for getting each of the nodes out, but problem arises > when I try to take out X properties of the individual node in > transform. > > I keep getting all values of all X properties in each node by using > <xsl:for-each select="//X">: I guess you are looking for relative XPath expressions e.g. <xsl:for-each select="/nodes/node"> <xsl:for-each select="X"> That way the inner for-each selects only the 'X' elements of the 'node' element selected by the outer for-each. So be careful with prefixing XPath expressions with //, that way you are always looking at descendants of the root node. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/