共用方式為


SchemaReference Class

Associated XML Schema.When the object is serialized out as xml, its qualified name is ds:schemaRef.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.CustomXmlDataProperties.SchemaReference

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

Syntax

'Declaration
Public Class SchemaReference _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As SchemaReference
public class SchemaReference : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

22.5.2.2 schemaRef (Associated XML Schema)

This element specifies a single XML schema that is associated with the custom XML data part. This XML schema is identified using its target namespace, and can be located via any means available to an application processing the contents of this file.

If the custom XML part cannot be validated using the specified XML schema when it is opened, then this reference can be omitted when the file is subsequently saved.

[Example: Consider the following content for a custom XML part properties part:

<ds:datastoreItem ds:itemID="{A67AC88A-A164-4ADE-8889-8826CE44DE6E}">
<ds:schemaRefs>
<ds:schemaRef ds:uri="http://www.example.com/exampleSchema" />
</ds:schemaRefs>
</ds:datastoreItem>

The schemaRef element contains a single XML Schema reference to a schema with a target namespace of http://www.example.com/exampleSchema. Applications can then locate and utilize a schema for this namespace using any means available. end example]

Parent Elements

schemaRefs (§22.5.2.3)

Attributes

Description

uri (Target Namespace of Associated XML Schema)

Specifies the target namespace for the XML Schema associated with this schema reference.

[Example: Consider the following content for a custom XML part properties part:

…
<w:schemaRef w:uri="http://www.example.com/schema1" />
<w:schemaRef w:uri="http://www.example.com/schema2" />
…

The uri attribute specifies the target namespace of each XML schema reference:

  • http://www.example.com/schema1

  • http://www.example.com/schema2

Applications can then locate and utilize a schema for these namespaces using any means available. end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

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

SchemaReference Members

DocumentFormat.OpenXml.CustomXmlDataProperties Namespace