[fpc-pascal] How to read TDOMNode attributes

Marco van de Voort marcov at stack.nl
Sun Dec 4 17:14:32 CET 2011


In our previous episode, Graeme Geldenhuys said:
> > The method in question is the TDomNode.Attributes.Length property. I thought
> > something like that shoud exist but I was looking for a Count property.
> > Shouldn't it be count instead?
> 
> Talk about not being very intuitive.  As I mentioned in another
> thread, the DOM unit is pretty damn programmer unfriendly. I don't
> care if it is W3C compliant or not, it just isn't logical or intuitive
> at all.

Use a simple wrapper unit over it. I use the xml config stuff of lazarus for
most purposes, with some minor own additions. Syncing and minimizing this,
is still on my todo. (I took this copy before Sergei started to massively
work on this, from the fpdoc work I know it is now massively better)
 
> comes down to it, and I am forced to use XML in a project, I would
> write a much more simplified API to the DOM unit. GetNode(ANodePath),
> ChildCount, Attribute[] and AttributeCount would be on the top of my
> list.

Sounds like a fine idea. 



More information about the fpc-pascal mailing list