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: Is recursive markup good? bad? supported? not supported?

Although the replies so far don't bear this out, I've found over the years that developers and users tend to be afraid of recursion.  Failing to use it when appropriate, though, leads to frustration when the limits designed into the hierarchy are exceeded, and extra costs when the schema has to be expanded to accommodate that.

We looked through a year's worth of patent text and found that two layers of superscripts were used very rarely, but they did occur.  So, we've defined two levels, Sup and Sup2, for general text.  For equations, we use MathML; I presume everyone is comfortable with whatever level of recursion that permits.

In patent claims, we have a structure "ClaimText" that is recursive, capturing the hierarchical nature of claim steps.  Abstractly, these are just nested paragraphs with certain limitations on content type based on patent rules.  Placing a limit on recursion of ClaimText would be tantamount to possibly preventing the correct description of an invention, so we don't do that.

Our first attempt at a patent authoring tool captured indent levels in a word processor and then used those levels as attributes on paragraphs.  The developers much preferred the recursive ClaimText; they said it reduced the complexity and amount of code needed to correctly capture the hierarchy.

Bruce B Cox
OCIO/AED/Software Architecture and Engineering Division

-----Original Message-----
From: Costello, Roger L. [mailto:costello@mitre.org] 
Sent: 2011 December 10, Saturday 06:53
To: xml-dev@lists.xml.org
Subject: Is recursive markup good? bad? supported? not supported?

Hi Folks,

There doesn't seem to be a lot of people using recursive markup - I received only two examples of schemas containing recursive definitions.

Why is there such limited use of recursive markup?

It seems to me that recursive markup is a natural fit to XML. 

Many things are naturally recursively defined, e.g.,

    A section consists of a title, body, and optional section.

That is easily expressed in XML Schema with a recursive definition:

    <xsd:complexType name="SectionType">
                 <xsd:element name="Title" type="xsd:string" />
                 <xsd:element name="Body" type="xsd:string" />
                 <xsd:element name="Section" type="SectionType" minOccurs="0" />
    <xsd:element name="Section" type="SectionType" />

In fact, a non-recursive definition would be quite difficult.

Recently I heard someone say this:

    Recursion in XML Schemas is definitely a bad idea, as it can 
    cause problems with XML Schema validators/data binding tools.

I don't know what problems recursive definitions cause to XML Schema validators, do you? 

What data binding tools support recursive definitions?  What data binding tools do not support recursive definitions?

What is your assessment of recursive markup?


[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