User Input

Use the input element to mark up text that is input by the user. This may be text entered into a command-line environment or into a text field in a graphical application.

Notes

  • The input element can contain a mixture of text and any general inline elements.

  • The input element can occur in any general inline context, including inside most inline elements, some basic block elements, and certain informational elements.

  • The input element can link to other pages or documents. See Ubiquitous Linking for more information.

  • The style attribute takes a space-separated list of style hints. Processing tools should adjust their behavior according to those style hints they understand.

  • The input element can have attributes from external namespaces. See External Namespaces for more information on external-namespace attributes.

  • The input element, together with the output element, may be used to mark up the contents of a screen element, allowing processing tools to treat them differently.

Examples

Use input to mark up a user response to a prompt:

Type <input>Y</input> at the prompt to proceed.

Type Y at the prompt to proceed.

Use input and output inside a screen element:

<screen>
<output style="prompt">$ </output><input>ls mal_inline_output.xml</input>
<output>mal_inline_output.xml</output>
</screen>
$ ls mal_inline_output.xml
mal_inline_output.xml

Processing Expectations

User input is displayed in a fixed-width or wide font. Fixed-width fonts tend to have more distinction between visually similar characters. A border or background color may be used to make the beginning and end of the input clear.

Comparison to Other Formats

The input element is similar to the userinput element in DocBook.

The input element is similar to the userinput element in DITA.

Schema

The formal definition of the Mallard language is maintained in RELAX NG Compact Syntax in code blocks within this specification. This is the formal definition for the input element. The namespace declarations for this definition are on the page Pages.

mal_inline_input = element input {
  mal_inline_input_attr,
  mal_inline_input_inline
}
mal_inline_input_attr = (
  mal_attr_link *,
  attribute style { xsd:NMTOKENS } ?,
  mal_inline_attr,
  mal_attr_external *
)
mal_inline_input_inline = mal_inline
© 2008-2011 Shaun McCance
cc-by-sa 3.0 (us)

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

As a special exception, the copyright holders give you permission to copy, modify, and distribute the example code contained in this document under the terms of your choosing, without restriction.

Powered by
Mallard