Hi Folks,
In the following XML document, an entity is defined and then it is used in the XML:
<?xml version="1.0"?>
<!DOCTYPE Commentary [
<!ENTITY adjective "insightful">
]>
<Commentary>
His presentation was &adjective;
</Commentary>
Instead is using the word ‘insightful’ directly in the <Commentary> element, it is used indirectly, via the entity. The entity introduced a level of indirection.
In the following XML Schema, a simpleType is defined and then it is referenced in the declaration of the ‘title’ element:
<xs:element
name="title"
type="person-title"
/>
<xs:simpleType
name="person-title">
<xs:restriction
base="xs:string">
<xs:enumeration
value="Mr."
/>
<xs:enumeration
value="Mrs."
/>
<xs:enumeration
value="Miss"
/>
</xs:restriction>
</xs:simpleType>
Instead of providing the simpleType directly in the ‘title’ element declaration, it is provided indirectly, via a reference. The reference introduced a level of indirection.
In the following XSLT document, a variable is defined and then later it is dereferenced in an output statement:
<xsl:variable
name="author"
select="/Book/Author[1]/text()"/>
. . .
<xsl:sequence
select="('The
author is: ', $author)"
/>
Instead of showing the author directly in the output statement, the author is shown indirectly, via a variable. The variable introduced a level of indirection.
All problems in computer science can be solved by another level of indirection. – David Wheeler
-------------------------------
/Roger