My XML File is as follows:
<Apple>
<Mango>
<MyInfo>
</MyInfo>
</Mango>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
<Grape>
<OtherInfo>
</OtherInfo>
</Grape>
</Apple>
My XSL Was :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="Something" >
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="foo:Apple/foo:Grape">
<xsl:value-of select="foo:OtherInfo"/>
<xsl:text> </xsl:text>
</xsl:for-each>
Now I want to select MyInfo from Mango tag in the same line. Please suggest How can I do that. I have heard there are sibling , preeceding sibling etc concept in xsl,but unable to figure it out anyway.