Skip to main content

Global attributes

  • Date:
    13/03/2025
  • Modified:
    26/11/2025
  • Category:
    General instructions

The MONET-XML framework includes a set of standardized attributes that can be applied to all elements to maintain consistency and flexibility in document formatting. This guide explains the available attributes, their possible values, and how to use them within your XML documents.

Standard Attributes

The following attributes are part of the monetDefaultAttributes group and can be applied to any element in the framework.

id Attribute

  • Type: xs:ID
  • Usage: Optional
  • Description: Assigns a unique identifier to an element. This is useful for referencing elements within the document.

Example:

<p id="para1">This is a sample paragraph.</p>

textAlign Attribute

  • Type: textAlign
  • Default Value: left
  • Possible Values:
    • left
    • right
    • center
    • justify
  • Usage: Controls the alignment of text within an element.

Example:

<p textAlign="center">Centered text.</p>

textDir Attribute

  • Type: textDir
  • Default Value: ltr
  • Possible Values:
    • ltr (Left-to-right)
    • rtl (Right-to-left)
  • Usage: Specifies the text direction, which is especially useful for multilingual content.

Example:

<p textDir="rtl">مرحبا بكم</p>

fontStyles Attribute

  • Type: fontStyle
  • Possible Values:
    • bold
    • underline
    • italic
    • strikeThrough
  • Usage: Allows multiple font styles to be applied by specifying a space-separated list of styles.

Example:

<p fontStyles="bold italic">Bold and Italic Text</p>

fontTypes Attribute

  • Type: fontType
  • Possible Values:
    • serif
    • sansSerif
    • handWriting
    • monoSpace
    • display
  • Usage: Specifies the font category for text rendering.

Example:

<p fontTypes="sansSerif">Sans-serif font example.</p>

xml:lang Attribute

  • Type: xml:lang
  • Usage: Required on document element, optional on other elements.
  • Description: Specifies the language of the content within an element, using standard language codes.

Example:

<p xml:lang="fr">Ceci est un texte en français.</p>

Best Practices

  • Always use the id attribute if an element needs to be referenced elsewhere in the document.
  • Use textAlign and textDir for proper text formatting, especially for multilingual content.
  • Combine fontStyles as needed for styling emphasis but avoid excessive formatting for readability.
  • Specify fontTypes when a specific font appearance is required. Only use this attribute when instructed.
  • Always use xml:lang for accessibility and proper language support.

By following these guidelines, you can ensure consistency and clarity in your XML documents within the Monet framework.