oid_content
oid_content (oid[, flags])
This OID function returns the content of the element specified by oid as a markup-coded string.
The optional argument flags is a bitmask that controls the markup included in the returned string and is constructed using OR with the following flags:
• 0x1 — Include the start tag (and end tag if not EMPTY) markup for oid in the string. If not specified, then only the content is included.
• 0x2 — Include only the start tag for oid markup if applicable (no content nor end tag). If this bit is specified, then the 0x1 bit is ignored.
• 0x4 — Don't convert non-ASCII characters to entity references (as though
set writenonasciichar=char option was in effect). If this bit is not specified, non-ASCII characters are converted based on the
set writenonasciichar command setting.
• 0x8 — Suppress insignificant line breaks, which are line breaks that occur where a record end is not significant. If this bit is not specified, insignificant line breaks are included based on the
set outputrecordlength command setting.
• 0x10 — Suppress
Arbortext processing instructions.
Arbortext processing instructions can also be suppressed using the
set writepi command.
• 0x20 — Use XML syntax in the string returned even if the selection is in an SGML document.
• 0x40 — Use SGML syntax in the string returned even if the selection is in an XML document.
• 0x80 — Do not include the markup in the result. This option takes precedence over any other flag bits that control how markup is generated.
• 0x100 — For XInclude elements, expand the element and return its content only (do not include the <xi:include> tag).
Because of memory requirements, you should not request the content of large elements such as the entire document, chapters, or sections.
Example:
Consider the following string of tagged content. In these examples, assume that your text caret is within this paragraph.
<para id="P1">This is a test.</para>
To return the content only, use the following function call:
oid_content(oid_caret())
To return the content and the surrounding tags, use the following function call:
oid_content(oid_caret(),1)
To return the start tag markup only, use the following function call:
oid_content(oid_caret(),2)
Related Topics