[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: dtd limit depth of elements

Subject: Re: dtd limit depth of elements
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Sat, 25 Jan 2003 09:33:47 -0600
xsl limit
Hubert Holtz wrote:

But another sect inside the third has to be invalid!
So, how can i limit the depth of elements inside a dtd?

There is no way to do it in a DTD.


As a rule, any production XML system must provide some form of validation application that enforces all of the business rules defined by the document type. A DTD is an intentionally simple syntactic constraint specification--there are many potential business rules that cannot be defined using DTD syntax. The same is true for XML Schema or any other declarative constraint language.

It's certainly easy to write an XSLT style sheet that will check these sorts of constraints, e.g:

<xsl:template match="//section/section/section/section">
  <xsl:message>+++ ERROR: Sections may only be nested at most three deep.
      <xsl:call-template name="show-ancestry"/></xsl:message>
</xsl:template>

For a more generic solution, you might find SchemaTron useful (http://www.ascc.net/xml/resource/schematron/schematron.html)

Cheers,

Eliot
--
W. Eliot Kimber, eliot@xxxxxxxxxx
Consultant, ISOGEN International

1016 La Posada Dr., Suite 240
Austin, TX  78752 Phone: 512.656.4139


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.