[Zope] XMLDocument mess

Martijn Faassen faassen@vet.uu.nl
Wed, 12 Apr 2000 19:18:03 +0200


[as a side note, there's a zope-xml@egroups.com list that's about Zope
and XML..it may be easier to direct your questions on XMLDocument there]

Serge Stinckwich wrote:
> i'm a bit confused with the behavior of the XMLDocument product.
[snip code]

> I launch the view method and i expect to have 2 URLs, i've got 5 with
> 3 non-existent nodes ...

What is going on is that your display method picks up text nodes as well;
they don't contain much text beyond whitespace, but there's there between
the element nodes. You can do something like this to skip them:

<dtml-in "getChildNodes()">
  <dtml-if "getNodeName() != '#text'">
  <p><dtml-var absolute_url></p>
  </dtml-if>
</dtml-in>

A more advanced option is to use my XMLWidgets product, to be found here:

http://www.zope.org/Members/faassen/XMLWidgets

Regards,

Martijn