Checking context
Hello all,
I am looking for an ACL function that will interrogate the DTD and tell me whether a given element is contextually correct for insertion before the first element in the exising SGML document. I know that the insert_tag function returns 1 on success and 0 on failure, but I need to know whether an element can be inserted in the current context before the insert_tag function is called.
For example, the current docuement may contain only <section> elements which in turn contain <para> elements. For the sake of this example, lets say that <section elements can only be wrapped by <book> elements and not <magazine> elements. If the user executes a custom ACL function designed to wrap the current document in a <magazine> parent element, I want to systematically determine that this is an invalid action and notify the user before calling the insert_tag function and reacting to its error status.
I’ve read about the content_model function that returns the content model for a given element. Are there any existing functions that accept an element name and return true of false regarding whether a given element is included in that text that content_model returns?
Any help will be greatly appreciated.

