Click here to Skip to main content
15,892,965 members
Home / Discussions / C#
   

C#

 
GeneralRe: scrollbars... *sigh* Pin
Eddy Vluggen19-Jul-11 9:08
professionalEddy Vluggen19-Jul-11 9:08 
GeneralRe: scrollbars... *sigh* Pin
l a u r e n19-Jul-11 9:40
l a u r e n19-Jul-11 9:40 
GeneralRe: scrollbars... *sigh* Pin
Eddy Vluggen19-Jul-11 10:31
professionalEddy Vluggen19-Jul-11 10:31 
QuestionLINQ: Show parent table value in child table Gridview Pin
Raza us Samad19-Jul-11 4:01
Raza us Samad19-Jul-11 4:01 
Questionspecify area for Drag'n'Drop Pin
lukeer19-Jul-11 1:37
lukeer19-Jul-11 1:37 
AnswerRe: specify area for Drag'n'Drop Pin
Dave Kreskowiak19-Jul-11 3:59
mveDave Kreskowiak19-Jul-11 3:59 
AnswerRe: specify area for Drag'n'Drop Pin
Alan N19-Jul-11 4:30
Alan N19-Jul-11 4:30 
Questionget parent and level of the xml node from XPathNavigator Pin
NarVish19-Jul-11 0:34
NarVish19-Jul-11 0:34 
Hi,

For the below xml, I would like to get the parent and level of the entity node. For example, for the Business entity, token value should be BUSINESS; desc value should be Business News; parent should be PROD; level should be 1. From the below code, I'm getting token and desc values. Kindly guide me to get parent and level values. Thanks in advance.

foreach (XPathNavigator book in topicsXml.CreateNavigator().Select("//Entity"))
{
   string token = book.SelectSingleNode("Token").Value;
   string desc = book.SelectSingleNode("Description").Value;
   string parent = ?
   string level = ?
}
<CodeList>
  <Entity>
    <Token>PROD</Token>
    <Description>prod</Description>---->level 0
    <Entity>
      <Token>BUSINESS</Token>
      <Description>Business News</Description>---->level 1
      <Entity>
        <Token>COS</Token>
        <Description>Company News</Description>---->level 2
        <Entity>
          <Token>ANA</Token>
          <Description>Analyst Ratings</Description>---->level 3
          <Entity>
            <Token>ANAMOVES</Token>
            <Description>Analyst Ratings, Estimates and Target Price Changes</Description>---->level 4
            <Entity>
              <Token>ANACHANGE</Token>
              <Description>Analyst Rating Changes</Description>---->level 5
              <Entity>
                <Token>ANACUT</Token>
                <Description>Analyst Downgrades</Description>---->level 6
                <Entity>
                  <Token>ANACUTEVT</Token>
                  <Description>Analyst Ratings Cut Events, Announcements</Description>---->level 7
                </Entity>
              </Entity>
            </Entity>
          </Entity>
          <Entity>
            <Token>IP</Token>
            <Description>Intellectual Property</Description>---->level 4
            <Entity>
              <Token>COPYRIGHT</Token>
              <Description>Copyrights</Description>---->level 5
            </Entity>
          </Entity>
        </Entity>
      </Entity>
      <Entity>
        <Token>DRGPATENT</Token>
        <Description>Drug Patents</Description>---->level 2
      </Entity>
    </Entity>
  </Entity>

AnswerRe: get parent and level of the xml node from XPathNavigator Pin
Mirko198019-Jul-11 1:38
Mirko198019-Jul-11 1:38 
GeneralRe: get parent and level of the xml node from XPathNavigator Pin
NarVish19-Jul-11 2:35
NarVish19-Jul-11 2:35 
GeneralRe: get parent and level of the xml node from XPathNavigator Pin
Mirko198019-Jul-11 4:58
Mirko198019-Jul-11 4:58 
GeneralRe: get parent and level of the xml node from XPathNavigator Pin
NarVish19-Jul-11 19:01
NarVish19-Jul-11 19:01 
QuestionC# Mysql query problem Pin
nighttrain_18-Jul-11 23:16
nighttrain_18-Jul-11 23:16 
AnswerRe: C# Mysql query problem Pin
Blue_Boy18-Jul-11 23:32
Blue_Boy18-Jul-11 23:32 
GeneralRe: C# Mysql query problem Pin
nighttrain_18-Jul-11 23:52
nighttrain_18-Jul-11 23:52 
SuggestionRe: C# Mysql query problem Pin
GuyThiebaut19-Jul-11 1:59
professionalGuyThiebaut19-Jul-11 1:59 
GeneralRe: C# Mysql query problem Pin
nighttrain_19-Jul-11 2:38
nighttrain_19-Jul-11 2:38 
GeneralRe: C# Mysql query problem Pin
GuyThiebaut19-Jul-11 3:05
professionalGuyThiebaut19-Jul-11 3:05 
AnswerRe: C# Mysql query problem Pin
PIEBALDconsult19-Jul-11 2:45
mvePIEBALDconsult19-Jul-11 2:45 
GeneralRe: C# Mysql query problem Pin
nighttrain_19-Jul-11 3:35
nighttrain_19-Jul-11 3:35 
AnswerRe: C# Mysql query problem [modified] Pin
BobJanova19-Jul-11 3:56
BobJanova19-Jul-11 3:56 
GeneralRe: C# Mysql query problem Pin
PIEBALDconsult19-Jul-11 14:22
mvePIEBALDconsult19-Jul-11 14:22 
GeneralRe: C# Mysql query problem Pin
BobJanova20-Jul-11 11:19
BobJanova20-Jul-11 11:19 
GeneralRe: C# Mysql query problem Pin
PIEBALDconsult20-Jul-11 14:18
mvePIEBALDconsult20-Jul-11 14:18 
GeneralRe: C# Mysql query problem Pin
BobJanova21-Jul-11 7:02
BobJanova21-Jul-11 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.