Click here to Skip to main content
16,006,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: Retrieve code of method at runtime Pin
sreejith ss nair26-Feb-05 20:08
sreejith ss nair26-Feb-05 20:08 
GeneralRe: Retrieve code of method at runtime Pin
hahoyer26-Feb-05 15:15
hahoyer26-Feb-05 15:15 
GeneralRe: Retrieve code of method at runtime Pin
S. Senthil Kumar26-Feb-05 19:41
S. Senthil Kumar26-Feb-05 19:41 
GeneralSome kind of file encryption thingy!! Pin
Anthony Mushrow25-Feb-05 11:49
professionalAnthony Mushrow25-Feb-05 11:49 
GeneralRe: Some kind of file encryption thingy!! Pin
Colin Angus Mackay25-Feb-05 11:51
Colin Angus Mackay25-Feb-05 11:51 
GeneralRe: Some kind of file encryption thingy!! Pin
Anthony Mushrow25-Feb-05 12:22
professionalAnthony Mushrow25-Feb-05 12:22 
GeneralRe: Some kind of file encryption thingy!! Pin
mav.northwind26-Feb-05 0:41
mav.northwind26-Feb-05 0:41 
GeneralProblem Get Attribute Returning Null. Pin
DemonBob25-Feb-05 11:19
DemonBob25-Feb-05 11:19 
I have a program I am writing for my own personl use that takes an XML file and interprets it into a treeview, then if a secion is clicked it shows the information between the tags in a textbox. The problem im having is with this peice of code.

XmlTextReader document = initializeXmlReader();

while((document.Name != e.Node.Tag.ToString()) && (document.GetAttribute("Name")!= e.Node.Text))
{

document.Read();


}

All the tree nodes are made up of the elemets attributes, this code works partially to go through the document and find if the right attribute, but sometimes it returns null, and does not display the next catagory's text.

Here is some sample XML.

<?xml version="1.0" encoding="utf-8" ?>

<Main Name="Desktop Sidebar Help">
<![CDATA[ TEST TEST TEST ]]>
<Key_Cat Name="Overview">
<Sub_Topic Name="Context Menu">TestTestTest</Sub_Topic>
<Sub_Topic Name="Options"></Sub_Topic>
</Key_Cat>
<Key_Cat Name="Basic Panels">
<Sub_Cat Name="Communication">
<Key_Topic Name="Mail Checker Panel">

</Key_Topic>
<Key_Topic Name="Messenger Panel">

</Key_Topic>
<Key_Topic Name="Miranda IM">
</Key_Topic>
</Sub_Cat>
<Sub_Cat Name="Groups Panels">
<Key_Topic Name="Stack Group">

</Key_Topic>
<Key_Topic Name="Tile Group">
</Key_Topic>
</Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="News"></Sub_Cat>
<Sub_Cat Name="Outlook Panels"></Sub_Cat>
<Sub_Cat Name="System"></Sub_Cat>
</Key_Cat>
<Key_Cat Name="3rd Party Panels">
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
</Key_Cat>
<Key_Cat Name="Skin Development">
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
</Key_Cat>
<Key_Cat Name="Plugin Development">
<Sub_Cat Name="DS SDK Documentation Forum - About"></Sub_Cat>
<Sub_Cat Name="Creating/Adding a Panel">
<Key_Topic Name="Creating an Empty Panel"></Key_Topic>
<Key_Topic Name="Adding Your Panel to Desktop Sidebar">trdtfgrgbergbergbergber</Key_Topic>
</Sub_Cat>
<Sub_Cat Name="Creating a Panel Installation File "></Sub_Cat>
<Sub_Cat Name="Publishing Your Panel"></Sub_Cat>
<Sub_Cat Name="Using Components"></Sub_Cat>
<Sub_Cat Name="Reference"></Sub_Cat>
<Sub_Cat Name="FAQ"></Sub_Cat>
</Key_Cat>
<Key_Cat Name="FAQ">
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
</Key_Cat>
<Key_Cat Name="Universal Help Engine">
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
</Key_Cat>
<Key_Cat Name="About Universal Help Engine">
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media"></Sub_Cat>
<Sub_Cat Name="Media">TESTTESTTEST</Sub_Cat>
</Key_Cat>
<Location ID="http://"><Location>
</Main>


I've been testing it by just clicking the first few treenodes that have a different attribute. But most of the time only one or two will work before it is just stays on the same thing for anything else I click. This is really bothering me. I edited out the text that was inbetween the tags, for length problems in this posting.

Sample of what its doing.

Tree
Desktop Sidebar
--OverView
---Context
---Options
--BasicPanels
---Communication
----Mail Checker Panel
----Messanger Panel
----Miranda IM

and so on
When I click mail checker panel for instance, it will show up right. But then if I click messanger Panel, it will show up with Main Check Panels text instead of Messanger Panels Text, upon debugging I noticed that getattribute is returnning null sometimes, I beleive this is the problem. The text between the tags will, contain HTML which is parsed by the textbox/web browser i've incorpertaited.

Any help would be much apperiated. Also if more code is needed I can post it.
GeneralRe: Problem Get Attribute Returning Null. Pin
Colin Angus Mackay25-Feb-05 11:49
Colin Angus Mackay25-Feb-05 11:49 
GeneralRe: Problem Get Attribute Returning Null. Pin
DemonBob25-Feb-05 15:16
DemonBob25-Feb-05 15:16 
GeneralEncrypting and Decrypting a file Pin
Peter Nirschl25-Feb-05 9:27
Peter Nirschl25-Feb-05 9:27 
GeneralRe: Encrypting and Decrypting a file Pin
Rei Miyasaka25-Feb-05 11:46
Rei Miyasaka25-Feb-05 11:46 
GeneralRe: Encrypting and Decrypting a file Pin
Peter Nirschl25-Feb-05 22:09
Peter Nirschl25-Feb-05 22:09 
GeneralRe: Encrypting and Decrypting a file Pin
Rei Miyasaka25-Feb-05 22:13
Rei Miyasaka25-Feb-05 22:13 
GeneralIncorrect syntax near keyword 'DEFAULT' Pin
Mark T Garcia25-Feb-05 8:20
Mark T Garcia25-Feb-05 8:20 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Radgar25-Feb-05 8:33
Radgar25-Feb-05 8:33 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Mark T Garcia25-Feb-05 9:12
Mark T Garcia25-Feb-05 9:12 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Radgar25-Feb-05 9:41
Radgar25-Feb-05 9:41 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Mark T Garcia25-Feb-05 11:53
Mark T Garcia25-Feb-05 11:53 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Dave Kreskowiak25-Feb-05 9:45
mveDave Kreskowiak25-Feb-05 9:45 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Mark T Garcia25-Feb-05 11:47
Mark T Garcia25-Feb-05 11:47 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Dave Kreskowiak25-Feb-05 13:08
mveDave Kreskowiak25-Feb-05 13:08 
GeneralRe: Incorrect syntax near keyword 'DEFAULT' Pin
Mark T Garcia25-Feb-05 13:30
Mark T Garcia25-Feb-05 13:30 
GeneralWindows Form and Message Box Pin
MarkMokris25-Feb-05 7:51
MarkMokris25-Feb-05 7:51 
GeneralRe: Windows Form and Message Box Pin
Peter Nirschl25-Feb-05 9:31
Peter Nirschl25-Feb-05 9:31 

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.