XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Indirection in XML

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS