Arbortext Command Language > Functions by Alphabetical Listing > content_model
  
content_model
content_model (tagname[, doc[, index]])
This function returns the canonical form of the content model for the element specified by the expression tagname.
* 
If you have applied an alias map to the document, tagname can be either an alias or a real name. However, the function will return an element's real name, not its alias.
For example, a model declared to be
(a, (%ref;)+, d)
where the REF parameter entity is declared as
b|c
will be returned as
(a,(b|c)+,d)
content_model returns the null string if tagname is not an element declared in the DTD. The tagname may start with the end tag open character / (ETAGO).
The optional doc argument specifies the identifier of the document tree to query. If omitted or 0, the current document is used.
Schemas can have no, one, or more than one content model. The optional index parameter lets you control the content model information returned.
Setting index to -1 — (The default.) Returns the global content model of the tagname in doc. If the element has no global content model, an empty string is returned.
Setting index to a value >=0 — Returns a global or local content model. However, the order of these models is undefined. You can enumerate through all content models by using 0, 1, 2, ... until an empty string is returned (the signal to stop). (For a DTD, 0 and -1 always return the one and only content model and >=1 always return an empty string.)