Partager via


Literal Class

Literal.When the object is serialized out as xml, its qualified name is m:lit.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Math.OnOffType
        DocumentFormat.OpenXml.Math.Literal

Namespace:  DocumentFormat.OpenXml.Math
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Class Literal _
    Inherits OnOffType
'Usage
Dim instance As Literal
public class Literal : OnOffType

Remarks

[ISO/IEC 29500-1 1st Edition]

22.1.2.58 lit (Literal)

This element specifies that the characters in the run are literal; that is, they are to be interpreted literally and not be built up based on any implied mathematical meaning. This is especially useful for operators or other special characters that signal a need for build up to an OMML reader. These characters are often encountered during a given instance of mathematical text when presented in a 1-dimensional linear format, such as the linear format defined by Unicode Technical Note #28 (Sargent 2006).

When the element is absent, the default value of the property is 0 meaning that this property is not applied.

When the element is present and the val attribute is absent, the default of the val attribute is 1 meaning that this property is applied.

[Example: In the following XML, the + operator is treated literally and does not receive proper binary spacing:

<m:r>a</m:r>
<m:r>
<m:rPr>
<m:lit/>
</m:rPr>
<m:t>+</m:t>
</m:r>
<m:r>
<m:t>b</m:t>
</m:r>

As another example, consider the following Office Open XML Math markup:

<m:r>
    <m:t>a</m:t> 
</m:r>
<m:r>
    <m:rPr>
        <m:lit/> 
    </m:rPr>
    <m:t>/</m:t> 
</m:r>
<m:r>
    <m:t>b</m:t> 
</m:r>

This would be displayed as: . If built up, it would normally be converted to ; however, the presence of this element specifies that the solidus should be treated literally, resulting in .

end example]

Parent Elements

rPr (§22.1.2.91)

Attributes

Description

val (value)

Specifies a binary value for the property defined by the parent XML element.

A value of 1 or true specifies that the property shall be explicitly applied. This is the default value for this attribute, and is implied when the parent element is present.

A value of 0 or false specifies that the property shall be explicitly turned off. This is implied when the parent element is not present.

The possible values for this attribute are defined by the ST_OnOff simple type (§22.9.2.7).

[Note: The W3C XML Schema definition of this element’s content model (CT_OnOff) is located in §A.6.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Literal Members

DocumentFormat.OpenXml.Math Namespace