Export (0) Print
Expand All

BidirectionalEmbedding class

Defines the BidirectionalEmbedding Class.This class is only available in Office2010. When the object is serialized out as xml, its qualified name is w:dir.

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Wordprocessing.BidirectionalEmbedding

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

[ChildElementInfoAttribute(typeof(CustomXmlMoveFromRangeStart))]
[ChildElementInfoAttribute(typeof(Radical))]
[ChildElementInfoAttribute(typeof(PreSubSuper))]
[ChildElementInfoAttribute(typeof(Box))]
[ChildElementInfoAttribute(typeof(DeletedRun))]
[ChildElementInfoAttribute(typeof(MoveFromRun))]
[OfficeAvailabilityAttribute(FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(CustomXmlRun))]
[ChildElementInfoAttribute(typeof(SimpleField))]
[ChildElementInfoAttribute(typeof(Hyperlink))]
[ChildElementInfoAttribute(typeof(SdtRun))]
[ChildElementInfoAttribute(typeof(ProofError))]
[ChildElementInfoAttribute(typeof(PermStart))]
[ChildElementInfoAttribute(typeof(PermEnd))]
[ChildElementInfoAttribute(typeof(BookmarkStart))]
[ChildElementInfoAttribute(typeof(BookmarkEnd))]
[ChildElementInfoAttribute(typeof(CommentRangeStart))]
[ChildElementInfoAttribute(typeof(CommentRangeEnd))]
[ChildElementInfoAttribute(typeof(MoveFromRangeStart))]
[ChildElementInfoAttribute(typeof(MoveFromRangeEnd))]
[ChildElementInfoAttribute(typeof(MoveToRangeStart))]
[ChildElementInfoAttribute(typeof(MoveToRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlInsRangeStart))]
[ChildElementInfoAttribute(typeof(CustomXmlInsRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlDelRangeStart))]
[ChildElementInfoAttribute(typeof(CustomXmlDelRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlMoveFromRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlMoveToRangeStart))]
[ChildElementInfoAttribute(typeof(CustomXmlMoveToRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlConflictInsertionRangeStart), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(CustomXmlConflictInsertionRangeEnd), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(CustomXmlConflictDeletionRangeStart), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(CustomXmlConflictDeletionRangeEnd), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(InsertedRun))]
[ChildElementInfoAttribute(typeof(MoveToRun))]
[ChildElementInfoAttribute(typeof(ContentPart), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(RunConflictInsertion), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(RunConflictDeletion), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(Paragraph))]
[ChildElementInfoAttribute(typeof(OfficeMath))]
[ChildElementInfoAttribute(typeof(Accent))]
[ChildElementInfoAttribute(typeof(Bar))]
[ChildElementInfoAttribute(typeof(BorderBox))]
[ChildElementInfoAttribute(typeof(Delimiter))]
[ChildElementInfoAttribute(typeof(EquationArray))]
[ChildElementInfoAttribute(typeof(Fraction))]
[ChildElementInfoAttribute(typeof(MathFunction))]
[ChildElementInfoAttribute(typeof(GroupChar))]
[ChildElementInfoAttribute(typeof(LimitLower))]
[ChildElementInfoAttribute(typeof(LimitUpper))]
[ChildElementInfoAttribute(typeof(Matrix))]
[ChildElementInfoAttribute(typeof(Nary))]
[ChildElementInfoAttribute(typeof(Phantom))]
[ChildElementInfoAttribute(typeof(Subscript))]
[ChildElementInfoAttribute(typeof(SubSuperscript))]
[ChildElementInfoAttribute(typeof(Superscript))]
[ChildElementInfoAttribute(typeof(Run))]
[ChildElementInfoAttribute(typeof(Run))]
[ChildElementInfoAttribute(typeof(BidirectionalOverride), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(BidirectionalEmbedding), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(SubDocumentReference))]
public class BidirectionalEmbedding : OpenXmlCompositeElement

[ISO/IEC 29500-1 1st Edition]

dir (Bidirectional Embedding Level)

This element specifies that the embedding level of its contents shall be increased, as described by the Bidirectional Algorithm (cf. Unicode Technical Report #9). Unlike the rtl element (§17.3.2.30), this element can be nested and causes the embedding level to increase appropriately. Within this element, the semantics for the rtl element shall continue apply, specifying a high-level override of the character classification applied at the appropriate embedding level. [Note: The presence of this markup is functionally equivalent to the presence of a LRE/RLE character at the location of the start element, and a corresponding PDF character at the location of the end element in a string of Unicode text. end note]

[Example: Consider a left-to-right paragraph that has a quote in a right-to-left language, but the quote itself includes left-to-right text. In this case, the text layout within the quote should be read from right-to-left. Adding this element around the quote increases the embedding level and result in the desired layout. (Assume the lower-case text is English and the upper-case text is Arabic or Hebrew):

<w:r>
    <w:t>he said: “</w:t>
</w:r>
<w:dir w:val=”rtl”>
    <w:r>
        <w:rPr>
            <w:rtl />
        </w:rPr>
        <w:t>I LEAVE FOR </w:t>
    </w:r>
    <w:r>
        <w:t>united states</w:t>
    </w:r>
    <w:r>
        <w:rPr>
            <w:rtl />
        </w:rPr>
        <w:t xml:space="preserve"> TOMORROW</w:t>
    </w:r>
</w:dir>
<w:r>
    <w:t>”.</w:t>
</w:r>

The alternating RTL and elements help in resolving the classification of characters within this run as follows:

   he said: “I LEAVE FOR united states TOMORROW”.
   LLLLLLLLLLRRRRRRRRRRRRLLLLLLLLLLLLLRRRRRRRRRLL

But the fact that the quote is enclosed in an RTL embedding; the following embedding levels are generated:

   he said: “I LEAVE FOR united states TOMORROW”.
   0000000000111111111111222222222222211111111100

This generates the following text layout:

   he said: “WORROMOT united states ROF EVAEL I”.

end example]

Parent Elements

bdo (§17.3.2.3); customXml (§17.5.1.3); del (§17.13.5.14); dir (§17.3.2.8); fldSimple (§17.16.19); hyperlink (§17.16.22); ins (§17.13.5.18); moveFrom (§17.13.5.22); moveTo (§17.13.5.25); p (§17.3.1.22); sdtContent (§17.5.2.36); smartTag (§17.5.1.9)

Child Elements

Subclause

bdo (Bidirectional Override)

§17.3.2.3

bookmarkEnd (Bookmark End)

§17.13.6.1

bookmarkStart (Bookmark Start)

§17.13.6.2

commentRangeEnd (Comment Anchor Range End)

§17.13.4.3

commentRangeStart (Comment Anchor Range Start)

§17.13.4.4

customXml (Inline-Level Custom XML Element)

§17.5.1.3

customXmlDelRangeEnd (Custom XML Markup Deletion End)

§17.13.5.4

customXmlDelRangeStart (Custom XML Markup Deletion Start)

§17.13.5.5

customXmlInsRangeEnd (Custom XML Markup Insertion End)

§17.13.5.6

customXmlInsRangeStart (Custom XML Markup Insertion Start)

§17.13.5.7

customXmlMoveFromRangeEnd (Custom XML Markup Move Source End)

§17.13.5.8

customXmlMoveFromRangeStart (Custom XML Markup Move Source Start)

§17.13.5.9

customXmlMoveToRangeEnd (Custom XML Markup Move Destination Location End)

§17.13.5.10

customXmlMoveToRangeStart (Custom XML Markup Move Destination Location Start)

§17.13.5.11

del (Deleted Run Content)

§17.13.5.14

dir (Bidirectional Embedding Level)

§17.3.2.8

fldSimple (Simple Field)

§17.16.19

hyperlink (Hyperlink)

§17.16.22

ins (Inserted Run Content)

§17.13.5.18

moveFrom (Move Source Run Content)

§17.13.5.22

moveFromRangeEnd (Move Source Location Container - End)

§17.13.5.23

moveFromRangeStart (Move Source Location Container - Start)

§17.13.5.24

moveTo (Move Destination Run Content)

§17.13.5.25

moveToRangeEnd (Move Destination Location Container - End)

§17.13.5.27

moveToRangeStart (Move Destination Location Container - Start)

§17.13.5.28

oMath (Office Math)

§22.1.2.77

oMathPara (Office Math Paragraph)

§22.1.2.78

permEnd (Range Permission End)

§17.13.7.1

permStart (Range Permission Start)

§17.13.7.2

proofErr (Proofing Error Anchor)

§17.13.8.1

r (Text Run)

§17.3.2.25

sdt (Inline-Level Structured Document Tag)

§17.5.2.31

smartTag (Inline-Level Smart Tag)

§17.5.1.9

subDoc (Anchor for Subdocument Location)

§17.17.1.1

Attributes

Description

val (Direction of Embedding)

Specifies the direction of the embedding being applied.

If this attribute is omitted, the embedding shall be assumed to be ltr.

[Example: For example, consider the following bidirectional embedding:

<w:dir w:val="rtl">
  …</w:
dir>

The val attribute explicitly declares that the embedding is applied right to left. end example]

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

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

© ISO/IEC29500: 2008.

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

Community Additions

Show:
© 2014 Microsoft