Click here to Skip to main content
15,910,083 members
Home / Discussions / C#
   

C#

 
GeneralRe: MDI and moveable (custom) control painting Pin
Dave Kreskowiak3-Mar-05 0:39
mveDave Kreskowiak3-Mar-05 0:39 
Questionimport registry files? Pin
Anthony Mushrow1-Mar-05 12:02
professionalAnthony Mushrow1-Mar-05 12:02 
AnswerNeed some help! Pin
Anthony Mushrow1-Mar-05 22:50
professionalAnthony Mushrow1-Mar-05 22:50 
GeneralNeed help accessing a textbox from another class... Pin
ericfgarcia1-Mar-05 10:56
ericfgarcia1-Mar-05 10:56 
GeneralRe: Need help accessing a textbox from another class... Pin
Judah Gabriel Himango1-Mar-05 11:46
sponsorJudah Gabriel Himango1-Mar-05 11:46 
GeneralRe: Need help accessing a textbox from another class... Pin
ericfgarcia2-Mar-05 3:44
ericfgarcia2-Mar-05 3:44 
GeneralRe: Need help accessing a textbox from another class... Pin
Judah Gabriel Himango2-Mar-05 5:14
sponsorJudah Gabriel Himango2-Mar-05 5:14 
GeneralGetAttribute Returning Null Sometimes Pin
DemonBob1-Mar-05 10:37
DemonBob1-Mar-05 10:37 
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.
GeneralRegex question Pin
ektoras1-Mar-05 10:02
ektoras1-Mar-05 10:02 
GeneralRe: Regex question Pin
Dave Kreskowiak1-Mar-05 10:18
mveDave Kreskowiak1-Mar-05 10:18 
GeneralRe: Regex question Pin
leppie1-Mar-05 11:10
leppie1-Mar-05 11:10 
GeneralOleDB Insert into MS Access Pin
Vodstok1-Mar-05 9:54
Vodstok1-Mar-05 9:54 
GeneralRe: OleDB Insert into MS Access Pin
Dave Kreskowiak1-Mar-05 10:16
mveDave Kreskowiak1-Mar-05 10:16 
GeneralRe: OleDB Insert into MS Access Pin
Vodstok1-Mar-05 10:26
Vodstok1-Mar-05 10:26 
GeneralRe: OleDB Insert into MS Access Pin
Anonymous1-Mar-05 10:42
Anonymous1-Mar-05 10:42 
GeneralRe: OleDB Insert into MS Access Pin
Troske1-Mar-05 12:29
Troske1-Mar-05 12:29 
GeneralProcess.HasExited problems Pin
3Dizard1-Mar-05 9:44
3Dizard1-Mar-05 9:44 
GeneralRe: Process.HasExited problems Pin
Dave Kreskowiak1-Mar-05 10:14
mveDave Kreskowiak1-Mar-05 10:14 
GeneralRe: Process.HasExited problems Pin
3Dizard2-Mar-05 23:10
3Dizard2-Mar-05 23:10 
GeneralRe: Process.HasExited problems Pin
3Dizard3-Mar-05 0:14
3Dizard3-Mar-05 0:14 
GeneralBasic Thread Questions Pin
GhostsOfOrion1-Mar-05 8:29
GhostsOfOrion1-Mar-05 8:29 
GeneralRe: Basic Thread Questions Pin
S. Senthil Kumar1-Mar-05 8:58
S. Senthil Kumar1-Mar-05 8:58 
GeneralRe: Basic Thread Questions (LONG) Pin
GhostsOfOrion1-Mar-05 16:00
GhostsOfOrion1-Mar-05 16:00 
GeneralRe: Basic Thread Questions (LONG) Pin
S. Senthil Kumar1-Mar-05 17:04
S. Senthil Kumar1-Mar-05 17:04 
GeneralRe: Basic Thread Questions (LONG) Pin
GhostsOfOrion2-Mar-05 4:17
GhostsOfOrion2-Mar-05 4:17 

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.