







![]() |
|
![]() |
This topic will explain how you can change the MAML schema so that you can use elements from other namespaces as well. This is useful when extending Sandcastle with build components that provide new elements because it still allows you to validate your topic files.
![]() |
---|
The Sandcastle version of the MAML schema files already contain the necessary changes. |
XML Schema Extensibility
In general, XML schema provides the any element for declaring extensibility points in your schema. The any element has two attributes that control the extensibility contract.
The namespace attribute allows you to either explicitly specify a closed set of namespaces that are allowed or to specify one of these pseudo-URIs:
The processContents attribute allows you to control the validation requirements. It can have one of following values:
Therefore, our extensibility points will all look like this:
Xml |
![]() |
---|---|
<any namespace="##other" processContents="lax" /> |
Extending Inline Text
Build components might add elements that you can use inside a http://ddue.schemas.microsoft.com/authoring/2003/5#E/para element. Examples for such elements are:
To extend the http://ddue.schemas.microsoft.com/authoring/2003/5#E/para element we will extend the underlying type http://ddue.schemas.microsoft.com/authoring/2003/5#T/inlineType.
Open the file inline.xsd, goto line 60, and add the any element to the type:
Xml |
![]() |
---|---|
<complexType name="inlineType" mixed="true"> <annotation> <documentation> The inlineType complexType describes a simple inline-only content model. It provides both text and elements with similarly simple content models. </documentation> </annotation> <choice minOccurs="0" maxOccurs="unbounded"> <group ref="maml:inlineGroup"/> <element ref="maml:sharedContent"/> <element name="conditionalSection"> <complexType> <sequence> <element ref="maml:conditions"/> <element name="conditionalContent" type="maml:inlineType"/> </sequence> </complexType> </element> <!-- PATCH HERE --> <any namespace="##other" processContents="lax" /> </choice> <attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/> </complexType> |
Extending Related Topics
For build components that provide elements for linking we also want to be able to use them inside the http://ddue.schemas.microsoft.com/authoring/2003/5#E/relatedTopics element. To do this, we will extend the type http://ddue.schemas.microsoft.com/authoring/2003/5#T/relatedTopicsType.
Open the file hierarchy.xsd, goto line 123 and add the any element to the type:
Xml |
![]() |
---|---|
<complexType name="relatedTopicsType" mixed="false"> <choice minOccurs="0" maxOccurs="unbounded"> <group ref="maml:relatedTopicLinkGroup"/> <!-- PATCH HERE --> <any namespace="##other" processContents="lax" /> </choice> <attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/> </complexType> |
Extending Section Structure
Last but not least build components might also provide elements that allow you to build a structure. For this purpose MAML itself already provides the http://ddue.schemas.microsoft.com/authoring/2003/5#E/table, http://ddue.schemas.microsoft.com/authoring/2003/5#E/code and http://ddue.schemas.microsoft.com/authoring/2003/5#E/para elements. To allow new structural elements we have to extend the type http://ddue.schemas.microsoft.com/authoring/2003/5#T/sectionContentType.
Open the file structure.xsd, goto line 67 and add the any element to the type:
Xml |
![]() |
---|---|
<complexType name="sectionContentType" mixed="false"> <choice minOccurs="0" maxOccurs="unbounded"> <group ref="maml:structureGroup"/> <element name="conditionalSection" type="maml:conditionalSectionType"/> <!-- PATCH HERE --> <any namespace="##other" processContents="lax" /> </choice> <attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/> </complexType> |