共用方式為


LatentStyles Class

Latent Style Information.When the object is serialized out as xml, its qualified name is w:latentStyles.

Inheritance Hierarchy

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

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

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(LatentStyleExceptionInfo))> _
Public Class LatentStyles _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As LatentStyles
[ChildElementInfoAttribute(typeof(LatentStyleExceptionInfo))]
public class LatentStyles : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • LatentStyleExceptionInfo <w:lsdException>

[ISO/IEC 29500-1 1st Edition]

17.7.2.5 latentStyles (Latent Style Information)

This element specifies the properties which shall be applied to a set of latent styles for this document. Latent styles refer to any set of style definitions known to an application which have not been included in the current document. [Example: Latent styles can include additional styles known by a particular hosting application. end example]

When a style definition is embedded in a document, it specifies two distinct groups of properties:

  • Behavior properties

  • Formatting properties

Obviously, embedding all the styles known to a particular application in each document which it produces would drastically increase the file size. Latent styles provide a way to store pieces of information for the first group (behavior properties) which shall be specified for all styles known to an application without requiring the storage of the second group (formatting properties).

[Example: Consider a WordprocessingML document which contains text specified in one of two styles: Heading1 or Normal. Based on this, the document only needs to store the formatting properties for those two styles, saving the additional overhead which would be required to save all of the styles supported by the hosting application.

However, if the documentProtection element (§17.15.1.29) specifies that the hosting application shall prevent the use of any style whose locked element (§17.7.4.7) is set to false, then the locking state of all styles known to that application become useful and necessary to maintain the current state of the document. Using latent styles, this information can be stored without storing any formatting properties for those styles.

For example, if all styles which are not stored in the document must be locked except for the style with a primary name (§17.7.4.9) of Heading 2. This requirement would be specified using latent styles as follows:

<w:latentStyles … w:defLockedState="true">
<w:lsdException w:name="Heading 2" w:locked="false"/>
</w:latentStyles>

The latentStyles element specifies that all latent styles known to any hosting application must have a default locking state of true except for any style known to the hosting application with a primary name of Heading 2, whose latent style definition specifies that its locked state must be false. end example]

Parent Elements

styles (§17.7.4.18)

Child Elements

Subclause

lsdException (Latent Style Exception)

§17.7.4.8

Attributes

Description

count (Latent Style Count)

Specifies the number of known styles which shall be initialized to the current latent style defaults when this document is first processed. [Note: This property can be used by an application as needed to ensure that only the number of styles known when this document was created are initialized with the defaults on the parent element, and that all new known styles use their default values. end note]

[Example: Consider a WordprocessingML document in which only the first 20 latent styles must be initialized. This requirement would be specified as follows:

<w:latentStyles w:count="20"  >

</w:latentStyles>

The count attribute specifies that 20 known styles must be initialized to the default settings when the document is first opened, and any additional styles should use the defaults defined by the application. end example]

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

defLockedState (Default Style Locking Setting)

Specifies the default setting for the locked element (§17.7.4.7) which shall be applied to any style made available by the hosting application which is not explicitly defined in the current document. This setting shall be overridden for every style for which a latent style exception (§17.7.4.8) exists.

If this element is omitted, the default locked state for all latent styles in the current document shall be false.

[Example: Consider a WordprocessingML document in which all styles which are not stored in the document must be locked. This requirement would be specified using latent styles as follows:

<w:latentStyles  w:defLockedState="true">

</w:latentStyles>

The defLockedState attribute specifies that all latent styles in the current document must have a locked element setting of true by default. end example]

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

defQFormat (Default Primary Style Setting)

Specifies the default setting for the qFormat element (§17.7.4.14) which shall be applied to any style made available by the hosting application which is not explicitly defined in the current document. This setting shall be overridden for every style for which a latent style exception (§17.7.4.8) exists.

If this element is omitted, the default qFormat state for all latent styles in the current document shall be false.

[Example: Consider a WordprocessingML document in which all styles which are not stored in the document must not be marked as primary styles. This requirement would be specified using latent styles as follows:

<w:latentStyles  w:defQFormat="false">

</w:latentStyles>

The defQFormat attribute specifies that all latent styles in the current document must have a qFormat element setting of false by default. end example]

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

defSemiHidden (Default Semi-Hidden Setting)

Specifies the default setting for the semiHidden element (§17.7.4.16) which shall be applied to any style made available by the hosting application which is not explicitly defined in the current document. This setting shall be overridden for every style for which a latent style exception (§17.7.4.8) exists.

If this element is omitted, the default semiHidden state for all latent styles in the current document shall be false.

[Example: Consider a WordprocessingML document in which all styles which are not stored in the document must not be marked as semi-hidden. This requirement would be specified using latent styles as follows:

<w:latentStyles  w:defSemiHidden="false">

</w:latentStyles>

The defSemiHidden attribute specifies that all latent styles in the current document must have a semiHidden element setting of false by default. end example]

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

defUIPriority (Default User Interface Priority Setting)

Specifies the default setting for the uiPriority element (§17.7.4.19) which shall be applied to any style made available by the hosting application which is not explicitly defined in the current document. This setting shall be overridden for every style for which a latent style exception (§17.7.4.8) exists.

If this element is omitted, the default uiPriority state for all latent styles in the current document shall be 99.

[Example: Consider a WordprocessingML document in which all styles which are not stored in the document must not be marked as semi-hidden. This requirement would be specified using latent styles as follows:

<w:latentStyles  w:defUIPriority="10">

</w:latentStyles>

The defUIPriority attribute specifies that all latent styles in the current document must have a uiPriority element setting of 10 by default. end example]

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

defUnhideWhenUsed (Default Hidden Until Used Setting)

Specifies the default setting for the unhideWhenUsed element (§17.7.4.20) which shall be applied to any style made available by the hosting application which is not explicitly defined in the current document. This setting shall be overridden for every style for which a latent style exception (§17.7.4.8) exists.

If this element is omitted, the default unhideWhenUsed state for all latent styles in the current document shall be false.

[Example: Consider a WordprocessingML document in which all styles which are not stored in the document must be hidden until they are used in the document's contents. This requirement would be specified using latent styles as follows:

<w:latentStyles  w:defUnhideWhenUsed="true">

</w:latentStyles>

The defUnhideWhenUsed attribute specifies that all latent styles in the current document must have a unhideWhenUsed element setting of true by default. end example]

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_LatentStyles) 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

LatentStyles Members

DocumentFormat.OpenXml.Wordprocessing Namespace