[Home] [By Thread] [By Date] [Recent Entries]

  • From: "Costello, Roger L." <costello@m...>
  • To: "xml-dev@l..." <xml-dev@l...>
  • Date: Sat, 6 May 2017 20:41:46 +0000

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



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member