docbook-apps

  • 1.  Re: [docbook-apps] nested indexterms

    Posted 03-23-2011 17:46
    Hi Joy,
    I don't think what you are asking for is possible with DTD syntax. In a DTD, an element can have only one content model, and it applies in all contexts that the element can appear in. With DTD syntax, there is no way to say "systemitem allows indexterm in all contexts except when systemitem is a child of primary". You would have to either ban indexterm from systemitem in all contexts, or ban systemitem from primary. And do the same with the other potential child elements of primary (and secondary and tertiary).

    However, an XSL stylesheet can detect this problem using XPath and flag it as an error. But that would not be part of the realtime validation that XML editors perform, so you would only discover a problem when processing the file.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net





  • 2.  Re: [docbook-apps] nested indexterms

    Posted 03-24-2011 11:31
    Thanks Bob,

    I removed indexterm from systemitem until I could figure out something
    better. Looks like this will just stay that way.

    Thanks,
    Joy

    On Wed, Mar 23, 2011 at 1:46 PM, Bob Stayton <bobs@sagehill.net> wrote:

    > Hi Joy,
    > I don't think what you are asking for is possible with DTD syntax. In a
    > DTD, an element can have only one content model, and it applies in all
    > contexts that the element can appear in. With DTD syntax, there is no way
    > to say "systemitem allows indexterm in all contexts except when systemitem
    > is a child of primary". You would have to either ban indexterm from
    > systemitem in all contexts, or ban systemitem from primary. And do the same
    > with the other potential child elements of primary (and secondary and
    > tertiary).
    >
    > However, an XSL stylesheet can detect this problem using XPath and flag it
    > as an error. But that would not be part of the realtime validation that XML
    > editors perform, so you would only discover a problem when processing the
    > file.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    >
    >
    >