Re: tidyGetNext() function

Leo Fink <[email protected]> Thu, 10 Sep 2009 20:54:37 +0200
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
Bjoern Hoehrmann wrote:

> * Leo Fink wrote:
>> I used the dumpNode() example code given in tidy.h to traverse the  
>> DOM
>> tree, but it seems like tidyGetNext() never gives me any end tags --
>> just the starts and start-ends. What am I missing?
>
> There is no reason to represent end tags in the tree because the  
> element
> boundaries are implied by the tree structure. Similarily the  
> distinction
> between start-tags and empty-element-tags is usually lost on  
> parsing. So
> you do not get any because there are none. That the example has a case
> for them is probably due to completeness reasons.

Thanks for the quick reply, Björn.

I see. So I could infer the existence of an end tag if I knew my node  
was a container element. (Suppose I'd want to roll my own "pretty  
print".) Is there a quick way to determine that? I didn't see it among  
the node interrogation functions.

Thanks!
L
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july