XML DOM = load of c**p

After years of hand-cranking XML I thought I'd give the DOM a try

It's RUBBISH!

Why can't you add a node & value with one simple line of code

Why can you not set a xmlNode.value, but have to use InnerText

Why is it the other way round for attributes

Was this written by a bunch of monkeys with no input from MS It works nothing like anything else in .net

It's unintuitive and illogical.  I've been coding VB4-vb.net for years and I should be able to pick this up no prob, but it's a load of C**P!

Sorry, but it's Friday, and I expect better than this


Answer this question

XML DOM = load of c**p

  • Pacific Ocean Blue

    You can add a whole subtree by setting InnerXml property.

    XmlNode.Value is for primitive values only.  XmlNode.InnerText conveys the message that you are replacing all the children with the new text.

    Attributes are considered primitive values.

    Part of the problem is that the DOM was designed by a standards committee. (see http://www.w3.org/DOM/).  Microsoft has tried to improve it as much as possible with extensions beyond the standard.

    For some coding assistance see http://samples.gotdotnet.com/quickstart/howto/doc/Xml/OverviewofXML.aspx.

    I hope you have a happy weekend


  • jender624

    Ah, designed by a Standards Committee, it all makes sense now...

    "A camel is a horse designed by committee"


    Getting my head round it, and the weekend was good thanks Chris

     


     


  • XML DOM = load of c**p