|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: dtd limit depth of elements
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








