Quark XML Author 2015 October 2018 Update for Microsoft Word — System Admin Guide

Quark XML Author Structure Attribute Definition

Each element that makes up the attribute definition section of the schema is defined below. An example is provided with each to demonstrate proper syntax for the element’s use.

The Attributes element contains the collection of attribute definition elements for the schema, and is a direct child of the XpressSchema root element. It uses no attributes.

<Attributes>
  <AttributeDef name="id" visible="false"/>
  <!-- Additional AttributeDef elements here -->
</Attributes>

AttributeDef

AttributeDef defines a single attribute for the schema. It may use the Restriction child element to specify a restricted list of values from which the user must choose when populating the attribute.

AttributeDef may use any of the attributes defined in the Common Attributes and Field Attributes groups, as well as the optional attributes defined below.

Table 12‑1: AttributeDef Attributes

Attribute

Required

Definition

contextId

no

A dash-delimited list of rule IDs in a validation configuration file.

Restriction

Restriction is used as a child of the AttributeDef element to restrict the user to a pre-determined list of values that may be used to populate the defined attribute. Each possible value is defined in an Enumeration child element. Restriction has no attributes, but must have one or more Enumeration children.

<AttributeDef name="filter" friendly="Filter" default="publish">
  <Restriction>
    <Enumeration value="publish"/>
    <Enumeration value="supress"/>
  </Restriction>
</AttributeDef>
Enumeration

Enumeration defines a single value that may be used to populate the defined attribute. Enumeration has one required attribute: value. This attribute is a string representing the value that may be selected by the user to populate the defined attribute

Using uniqueidentifier

Quark XML Author supports attribute definitions with datatype="uniqueidentifier" for automatically assigning a GUID value. When used without the format attribute, the attribute is populated in the format: id=" 982x0d0c-1446-4b39-a704-646d549b50b3". The xsd:ID datatype requires the value to begin with an alpha character. To comply with this requirement, use datatype="uniqueidentifier" in conjunction with the format attribute. The value of the format attribute will be prepended to the GUID. For example:

<AttributeDef name="id" datatype="uniqueidentifier" format="id-" required="true"/>

The preceding example would produce a value in the format id=" id-982x0d0c-1446-4b39-a704-646d549b50b3".

Associating Attribute Definitions with Elements and Emphasis

Both element definitions (section 14) and emphasis definitions (section 13) can have attributes associated with them. The ElementDef and EmphasisDef elements each have an optional child element called Attributes. The Attributes element contains an AttributeType element for each attribute that is associated with the element or emphasis. The AttributeType element’s name attribute contains the name of an AttributeDef defined earlier in the schema. The AttributeType element can have any of the Field Attributes defined in section 11.6.2. An example is shown below.

<Attributes>
  <AttributeType name="author"/>
  <AttributeType name="copyright"/>
  <AttributeType name="name"/>
  <AttributeType name="editor"/>
  <AttributeType name="keywords"/>
  <AttributeType name="status"/>
  <AttributeType name="id"/>
  <AttributeType name="revisionflag"/>
</Attributes>

SectionBreak, PageBreak, and ColumnBreak Attributes

To specify whether or not a given element may be preceded by a section, page break, or column break, you must define an attribute with the datatype value sectionBreak, pageBreak, or columnBreak. For example:

<AttributeDef name="sectionBreak" datatype="sectionBreak" readonly="true" visible="false"/>
 
<AttributeDef name="pageBreak" datatype="pageBreak " readonly="true" visible="false"/>
 
<AttributeDef name="columnBreak" datatype="columnBreak " readonly="true" visible="false"/>

You would then associate one or more of these attributes with that specific element. Information about associating AttributeDefs with elements is found in section 12.2.

Finally, you would set the value of the SectionBreak, PageBreak, ColumnBreak node in the DocConfig to restricted. See section 9.7 for information about these DocConfig nodes.