Parameterizing Attributes

Attribute declarations also benefit from parameterization. For example, the type attribute of the Transaction element can be declared as follows .

 <!ENTITY % TypeAtt "type"> <!ENTITY % type.extra ""> <!ATTLIST %TransactionElement; %TypeAtt;   (withdrawal  deposit  transfer %type.extra;)   #REQUIRED> 

Now you can change the name of the attribute by redefining the TypeAtt entity or add an additional value by redefining the type.extra entity. For example, the redefinition below adds a balanceInquiry type.

 <!ENTITY % type.extra "   balanceInquiry "> 

Effective XML. 50 Specific Ways to Improve Your XML
Effective XML: 50 Specific Ways to Improve Your XML
ISBN: 0321150406
EAN: 2147483647
Year: 2002
Pages: 144 © 2008-2017.
If you may any questions please contact us: