SdtContentDate Class

Date Structured Document Tag.When the object is serialized out as xml, its qualified name is w:date.

Inheritance Hierarchy

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

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

Syntax

声明
<ChildElementInfoAttribute(GetType(LanguageId))> _
<ChildElementInfoAttribute(GetType(Calendar))> _
<ChildElementInfoAttribute(GetType(DateFormat))> _
<ChildElementInfoAttribute(GetType(SdtDateMappingType))> _
Public Class SdtContentDate _
    Inherits OpenXmlCompositeElement
用法
Dim instance As SdtContentDate
[ChildElementInfoAttribute(typeof(LanguageId))]
[ChildElementInfoAttribute(typeof(Calendar))]
[ChildElementInfoAttribute(typeof(DateFormat))]
[ChildElementInfoAttribute(typeof(SdtDateMappingType))]
public class SdtContentDate : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • DateFormat <w:dateFormat>

  • LanguageId <w:lid>

  • SdtDateMappingType <w:storeMappedDataAs>

  • Calendar <w:calendar>

[ISO/IEC 29500-1 第 1 个版本]

17.5.2.7 date (Date Structured Document Tag)

This element specifies that the parent structured document tag shall be a date picker when displayed in the document.

This setting specifies that the behavior for this structured document tag shall be as follows:

  • The child elements of this element specify how the dates in this structured document tag shall be stored in any mapped custom XML data and displayed in the document

  • Formatting applied to any part of this structured document tag's contents shall apply to its entire contents

As well, the structured document tag shall satisfy the following restraints or the document shall be considered non-conformant:

  • The contents shall only be contain a single run (one set of formatting properties)

  • The contents shall not contain more than a single paragraph or table cell and shall not contain a table row or table cell

[Example: Consider the following structured document tag:

<w:sdt>
<w:sdtPr>
…
<w:date>
…
</w:date>
</w:sdtPr>
…
</w:sdt>

The date element in this structured document tag's properties specifies that the type of structured document tag is a date picker. end example]

Parent Elements

sdtPr (§17.5.2.38)

Child Elements

Subclause

calendar (Date Picker Calendar Type)

§17.5.2.3

dateFormat (Date Display Mask)

§17.5.2.8

lid (Date Picker Language ID)

§17.5.2.20

storeMappedDataAs (Custom XML Data Date Storage Format)

§17.5.2.40

Attributes

Description

fullDate (Last Known Date in XML Schema DateTime Format)

Specifies the full date and time last entered into the parent structured document tag using the standard XML Schema DateTime syntax.

[Note: This cache is used because the date display mask stored on the dateFormat element (§17.5.2.8) might not contain all of the information about the date, which might be needed if the date display mask is later changed. end note]

If this attribute is specified, then the current fullDate attribute shall be used to populate the run content of the parent structured document tag by filtering it through the date display mask specified in the dateFormat element, if one is present.

If this attribute is omitted, then the current display text shall be maintained when the document is displayed.

[Example: Consider the following structured document tag properties:

<w:sdtPr>
…
<w:date w:fullDate="2006-01-01T05:30:00Z">
…
</w:date>
</w:sdtPr>

The full XML Schema DateTime format for the current structured document tag is specified via the fullDate attribute value as 2006-01-01T05:30:00Z. end example]

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

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

© ISO/IEC29500: 2008. 以上摘要已经由 Microsoft(和/或其代理公司)从英语翻译为简体中文,ISO 对此翻译不承担任何责任。

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

SdtContentDate Members

DocumentFormat.OpenXml.Wordprocessing Namespace