[fpc-pascal] How to read TDOMNode attributes
Frank Church
vfclists at gmail.com
Sun Dec 4 14:52:19 CET 2011
On 4 December 2011 11:46, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> On 2 December 2011 22:26, Frank Church wrote:
> >
> > 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.
>
> I'm with you on this one Frank. I would have though the number of
> attributes, or child nodes etc would use a Count property. If it ever
> 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.
>
>
>
My own thought was that it would be good to have a Count property that is
aliased to Length (and documented as such). The downside of using Object
Pascal norms is that someone new to Object Pascal but well versed in the
DOM would be looking for would be looking for direct mappings of the
properties.
> --
> Regards,
> - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://fpgui.sourceforge.net
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
--
Frank Church
=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20111204/5afd41c6/attachment.html>
More information about the fpc-pascal
mailing list