DocumentID: ECMA-376/Part5/9.1.3 Title: ECMA-376, Part5: 9.1.3 PreserveElements and PreserveAttributes Attributes Extracted-From: ECMA-376 Office Open XML File Formats, 1st Edition / December 2006 Warning: Coverted to HTML format by a script known to have bugs
The Ignorable attribute presents a challenge unique to markup editors in deciding when and how to preserve ignored markup in the face of modification and when to discard ignored markup. In the absence of explicit knowledge of the specification governing the unrecognized ignored markup, it is difficult for a markup editor to preserve ignored markup while simultaneously maintaining document conformance with whatever specification governs that markup. Similarly, it is difficult for the markup editor to avoid undesired change to the edited document's semantics as they would be interpreted by a markup consumer whose implementation is based on the specification governing the preserved markup.
A markup editor might use the presence of PreserveElements and PreserveAttributes attributes as hints for deciding what ignored elements and attributes to preserve when markup is modified. The markup editor's specific interpretation of those hints shall be governed by the markup specification or specifications that formed the basis for the markup editor's implementation.
Markup specifications should specify conditions under which markup editors should preserve ignored markup. Markup specifications should define the widest possible set ofconditions under which markup editors should preserve ignored markup. [Note: If preservation conditions are too widely defined, future versions and extensions will be over constrained in what new semantics they can introduce. end note]
If a markup specification lacks such guidance, markup editors for markup documents governed by that markup specification should be conservative in their preservation behavior Before preserving any ignored markup, markup editors should attempt to establish confidence that the preserved markup will be acceptable to, and interpretable with acceptable semantics by, all imaginable markup consumers that understand future versions of extensions. [Note: Such confidence could be established by deep understanding of the base specification. end note]
Even in the presence of explicit preservation guidance in a markup specification, any markup editor might choose to discard together all ignored markup without regard to the presence of any PreserveElements or PreserveAttributes attribute. [Note: The explicit presence of the Ignorable attribute indicates that discarding such markup before editing produces a document that conforms to relevant specifications and is self-sufficient in its semantic interpretation. end note]
A markup specification might define conditions calling for the preservation of some ignored elements or attributes without requiring the presence of any PreserveElements or PreserveAttributes attribute.
A markup specification might restrict preservation of elements identified by the PreserveElements attribute to those elements that are descendants of particular elements. Likewise, a markup specification might restrict the set of elements whose ignored attributes can be preserved, as identified by the PreserveAttributes element, to those that are descendants of particular elements. Regardless of any such restrictions, markup consumers shall always accept, but possibly disregard, PreserveElements and PreserveAttributes attributes on any element.
The PreserveElements attribute value contains a whitespace-delimited list of element qualified names identifying the expanded names of elements that a markup producer suggests for preservation by markup editors, even if the elements themselves are ignored. In any qualified name in the list, the wildcard character "*" can replace the local name to suggest that all elements in the namespace can be preserved.
If a markup consumer encounters an ignored element whose expanded name matches the expanded name of an element identified in the PreserveElements attribute value, the markup consumer shall consider that element to be a candidate for preservation, regardless of whether or not the element's qualified name matches the qualified name specified in the PreserveElements attribute value.
When an element is ignored and preserved, all of its unprefixed attributes shall also be preserved along with any preserved attributes identified in a PreserveAttributes attribute value.
The PreserveElements attribute value shall not reference any element name that does not belong to a namespace that is identified by the Ignorable attribute of the same element.
The value of the PreserveElements attribute can be an empty or blank string. When a markup consumer encounters such a value, it shall proceed as if the PreserveElements attribute was not provided.
The PreserveAttributes attribute value contains a whitespace-delimited list of attribute qualified names identifying the expanded names of attributes that a markup producer suggests for preservation by markup editors. [Note: An attribute cannot be preserved if it appears on a non-preserved ignored element. end note] In any qualified name in the list, the wildcard character "*" can replace the local name to indicate that all attributes in the namespace should be preserved. [Note: An unprefixed local attribute cannot be identified by a PreserveAttributes attribute value. end note]
If a markup consumer encounters an ignored attribute whose expanded name matches the expanded name of an attribute identified in the PreserveAttributes attribute value, the markup consumer shall consider that attribute to be a candidate for preservation, regardless of whether or not the attribute's qualified name matches the qualified name specified in the PreserveAttributes attribute value.
The ProcessAttributes attribute value shall not reference any attribute name that does not belong to a namespace that is identified by the Ignorable attribute of the same element.
The value of the PreserveAttributes attribute can be an empty or blank string. When a markup consumer encounters such a value, it shall proceed as if the PreserveAttributes attribute was not provided.