XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: ***SPAM*** [xml-dev] Representing binary trees in XML=?UTF-8?Q?=E2=80=A6?= flat versus recursive

On Thu, 2019-07-04 at 13:45 +0000, Costello, Roger L. wrote:

> Are there other ways to represent binary trees in XML?

Many. But it's mostly in the details; stand-off markup (flat) and
directly nested are the two most common. Note that arbitrary graph
structures can't be descried as pure trees, so you need either a hybrid
approach or (simplest) the flat/standoff approach.
 
> Of the two ways to represent binary trees shown above, which way is
> easier to process with XSLT? Which way is easier to process with
> other programming languages?

It doesn't make much difference. The id/idref approach allows for
indexed access.

> If you have used the recursive approach, have you encountered
> problems with XML parsers failing on deeply nested elements?
Years ago, yes (with SGML too).

But tail recursion, where available, usually eliminates that.

Liam



-- 
Liam Quin, https://www.delightfulcomputing.com/

Upcoming courses: DocBook (sold out)
                  CSS for XML People, DC area, USA: August



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS