CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!
Free 3 Months



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 3/26/2004 1:49:00 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 36 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
PimpoDiabolo
Asp.Net User
XmlNode Control3/26/2004 1:49:00 PM

0/0

Hi Everyone,

I´m trying to develop a control for display XmlNodes. the attributes of the actual node and his leave-nodes (<a>DATA</a>) will be display in textboxes, so that the user can change them. All other child-nodes (with more children or attributes) should be displayed as linkbuttons. So far so good. But when am trying to compute the actual XmlNode a got some problems. Most of the time my code works fine, but when there is some special kind of xmlcode I get an Exception. I-man have located the problem. Sometimes myXmlNode.attributes.Count is null! Does anyone know a solution?

Here is the "sinister" XmlCode:
<Person groesse="20" gewicht="90" >
<Nachname geschlecht="Mann">Arnold</Nachname>
<Vorname>Schwarz</Vorname>
<Hobbys>
<Hobby>Capoeira</Hobby>
<Hobby>Musik</Hobby>
</Hobbys>
<Alter>54</Alter>
<sport />
</Person>

Here is my method:

public void ShowXmlNode(XmlNode myXmlNode)
{
// Set the Attributes
this.NodeAttributes = GetAttributes(myXmlNode);

// Create the ArrayLists which will later catain the leaves / children
ArrayList myChildren =new ArrayList();
ArrayList myLeaves = new ArrayList();

XmlNodeList myChildNodes = myXmlNode.ChildNodes;
foreach (XmlNode myWorkerNode in myChildNodes)
{
if (myWorkerNode.ChildNodes.Count > 1 || myWorkerNode.Attributes.Count >0) myChildren.Add(myWorkerNode.Name.ToString());
else
// No Attributes, No Children => Leave
myLeaves.Add(new Pair(myWorkerNode.Name, myWorkerNode.InnerText));
}
this.Leaves = myLeaves;
this.Children = myChildren;

}
The porblem occurs, when the node passed to the method, is this part of the xmldocument:
<Nachname geschlecht="Mann">Arnold</Nachname>

The Exception is thrown at :
... myWorkerNode.Attributes.Count >0)

Thanks

Klaus

1 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath Authors: Eric Carter, Eric Lippert, Pages: 992, Published: 2006
Pro SharePoint Solution Development Combining .NET, SharePoint, and Office 2007 Authors: Ed Hild, Susie Adams, SpringerLink (Online service, Pages: 0, Published: 2007
Essential ActionScript 2.0 Authors: Colin Moock, Pages: 502, Published: 2004
Flex Solutions: Essential Techniques for Flex 2 and 3 Developers Authors: Marco Casario, Pages: 872, Published: 2007
ASP.NET AJAX Programmer's Reference: With ASP.NET 2.0 Or ASP.NET 3.5 Authors: Shahram Khosravi, Pages: 1522, Published: 2007
XML.NET Developer's Guide: Developer's Guide Authors: Adam Sills, Jonothon Ortiz, Pages: 566, Published: 2002
MCAD/MCSD Training Guide (70-310): Developing XML Web Services and Server Components with Visual Basic. Net and the . Net Framework Authors: Mike Gunderloy, Ed Tittel, Pages: 1024, Published: 2003
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005

Web:
XMLNode Control The XMLNode control is a mapped XML node object that exposes events and can ... The XMLNode control is created only when a non-repeating schema element is ...
XMLNode Members (Microsoft.Office.Tools.Word) Represents a single XMLNode control that exposes events and that can be bound to ... BaseName, Gets the name of the XMLNode control without any prefix. ...
Paul Stubbs : XMLNode and XMLNodes View Control Video Demo You can watch the archive video here: View Control Programming in Word 2003 and Excel 2003 . I have re-recorded the Word XMLNode Demo.
C# .NET XpathNavigator or XmlNode which one is better? Feb 29, 2008 ... . I’m thinking using XpathNavigator instead of working with XmlNode directly. Would this be more effective? ...
Safari Books Online - 0321334884 - Visual Studio Tools for Office ... For each nonrepeating element mapped to the Word document, VSTO creates an XMLNode control. For example, by mapping the nonrepeating element CustomerName ...
XpathNavigator or XmlNode which one is better? - ASP.NET Forums . I’m thinking using XpathNavigator instead of working with XmlNode directly. Would this be more effective? Or any one have any better idea? ...
Microsoft.Office.Tools.Word Namespace (2007 System) (2007 System) Host control classes, including content controls, Bookmark, XMLNode, and XMLNodes. For information about host controls, see Host Items and Host Controls ...
CodeProject: Save an XML File to database and send an email using ... protected void GetFormData(Control Parent, XmlDocument xmlDoc) { XmlNode xmlnode ; foreach (Control wc in Parent.Controls) { /* Depending on which version of ...
Problems with XmlNode.InsertAfter - .NET XML Problems with XmlNode.InsertAfter. Get answers to your questions in our . ... works but I want to be able to control where exactly the new ...
System.InvalidCastException: Cannot assign object of type System ... Xml.XmlNode[] to an object of type System.String. at Microsoft. ... Control. WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows. ...




Search This Site:










"absolute" positioning of controls in itemtemplate / header template of datalist

saving a method call / using reflection

yahoo style site navigation control for .net

top, left position as set by visual studio designer

expose usercontrol enum

adding body onload event text

postback data handler problem

user controls and code behind

controlaction in customcontrol

class exposed as property with multiple instances.

addstyleattribute works on ie but not firefox: why?

layout in a panel

sql server 2005 common language run-time (clr) integration

composite control with datalist

inheritance and overriding property types

exposing a data source property from a listbox

help.... anyone have an answer to this...

link button in the header template

searching ad

bug ????

/sigh

problem with user control!

validating text box

citrix hosting site?

custom dropdownlist not passing selected value

chart conrtols??

free hosts?

event handling in custom server controls

collectioneditor prevents rendering runat=server

defaultvalue question

  Privacy | Contact Us
All Times Are GMT