Re: Problems with attributes
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-05-12 01:27:14
|
> downloaded the cvs version, but it looks like getData will no longer fetch > attributes, either in the @ or the attribute:: notation. I have changed my > scripts to use getAttributes instead, but is this deliberate or a bug? > > When I ran my old scripts - using getData - it produced errors for the > implode line immediately following. Shouldn't === read == ? The errors went > away when I changed this! Not deliberate, so I suppose you could class it as a "bug", I prefer the term "ommision" :o) Anyway I've coded this in now, so getData() can be used to get the data of an attribute, however getAttributes() is faster, and I would recommend it if you know that you are getting from an attribute and not a node. I've added a test to the test harness so that future releases don't suffer from this numpty attack. The change is in CVS if you can't wait for it to be released. Will probably wait several more weeks before 3.1 Please keep a close eye out for similar bugs relating to attributes. The test harness that we've built uses DOM test data (the DOM-TS project from w3c). In the DOM world, attributes are quite different entities to Nodes, so the coverage in the Php.XPath functions where attributes and nodes are considered the same kind of entities is poor. Cheers, Nigel |