NoBreakHyphen Class

Non Breaking Hyphen Character.When the object is serialized out as xml, its qualified name is w:noBreakHyphen.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.EmptyType
        DocumentFormat.OpenXml.Wordprocessing.NoBreakHyphen

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

Syntax

'Declaration
Public Class NoBreakHyphen _
    Inherits EmptyType
'Usage
Dim instance As NoBreakHyphen
public class NoBreakHyphen : EmptyType

Remarks

[ISO/IEC 29500-1 1st Edition]

17.3.3.18 noBreakHyphen (Non Breaking Hyphen Character)

This element specifies that a non breaking hyphen character shall be placed at the current location in the run content. A non breaking hyphen is the equivalent of Unicode character 002D (the hyphen-minus), however it shall not be used as a line breaking character for the current line of text when displaying this WordprocessingML content.

The behavior of a non breaking hyphen in run content shall be to display using the same glyph as the hyphen-minus character, however without being a line breaking position (unlike the hyphen-minus character).

[Example: Consider the following sentence in a WordprocessingML document:

This makes a very very very wordy and deliberately overcomplicated sentence.

Normally, just as shown above, this sentence not would be displayed on a single line as it is long enough to require line breaking (given the width of the current page). However, if a hyphen minus were inserted after the letter s in sentence, as follows:

<w:r>
<w:t>This makes a very very very wordy and deliberately overcomplicated s-entence.</w:t>
</w:r>

This would allow a break at that position, and break the word after that character:

This makes a very very very wordy and deliberately overcomplicated s-entence.

If this was not desired, the non breaking hyphen character could be specified as follows:

<w:r>
<w:t>This makes a very very very wordy and deliberately overcomplicated s</w:t>
<w:nonBreakHyphen/>
<w:t>entence.</w:t>
</w:r>

This would display a hyphen character, but would not allow the text to break at that location:

This makes a very very very wordy and deliberately overcomplicated sentence.

end example]

Parent Elements

r (§22.1.2.87); r (§17.3.2.25)

[Note: The W3C XML Schema definition of this element’s content model (CT_Empty) is located in §A.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

NoBreakHyphen Members

DocumentFormat.OpenXml.Wordprocessing Namespace