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>
>
>
>
Original Message -----
> *From:* Joy Andree <joy.andree@ansys.com>
> *To:* docbook-apps@lists.oasis-open.org
> *Sent:* Wednesday, March 16, 2011 7:22 AM
> *Subject:* [docbook-apps] nested indexterms
>
> I recently hit a problem with nested indexterms. While nesting an
> indexterm within an indexterm is invalid it seems there is a loop hole.
>
> If you put the systemitem tag within the primary tag then it allows an
> additional indexterm which is valid in a systemitem tag.
> I have not tried other tags.
>
> <indexterm>
> <primary>
> <systemitem>systemitem
> <indexterm>
> <primary>nested indexterm</primary>
> </indexterm>
> </systemitem>
> </primary>
> </indexterm>
>
> The validation process is not catching this in Arbortext or saxon.
> I build html and pdf output and it is only the PDF that is catching this
> with just a message but not breaking the build.
>
> java: [error] no entries for index key nested indexterm'
>
> I would like to address this in the DTD so the writers can catch this when
> validating but do not know where or how to state in the DTD to not allow
> nested indexterms once you nesting tags.
>
> I'm using Docbook 4.0 and I do have some customizations already so it is
> not a problem to add to my custom DTD.
>
> Can someone help?
>
> Thanks,
> Joy
>
> --
> Joy Andree
> Software Developer II
> ANSYS, Inc.
> 275 Technology Drive
> Canonsburg, PA 15317
> Tel: 724-514-2944
>
> ---------------------------------------------------------------------------------------------------
> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipient is prohibited. If you received
> this in error, please contact the sender and delete the material from any
> computer.
>
>
--
Joy Andree
Software Developer II
ANSYS, Inc.
275 Technology Drive
Canonsburg, PA 15317
Tel: 724-514-2944
---------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.