Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Understanding XSL

Debanjan BanerjeeNov 11 2013 — edited Nov 12 2013

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>&#10;</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.

This post has been answered by odie_63 on Nov 11 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2013
Added on Nov 11 2013
2 comments
1,469 views