Adding Attributes

The simplest way to add an attribute to a single element is to add it to the attlist pattern for that element. Example 5-13 adds the optional attributes born and died to the attribute list for author. The db.author.attlist pattern is redefined to interleave the two new optional attributes with the existing attributes on the list.

Example 5-13. Adding born and died attributes

namespace db = "http://docbook.org/ns/docbook"
default namespace = "http://docbook.org/ns/docbook"

include "docbook.rnc"

db.author.attlist &=                             1
  attribute born { db.date.contentmodel }?           2
  & attribute died { db.date.contentmodel }?
1

&= interleaves the two new optional attributes with the existing attributes on the list.

2

db.date.contentmodel is a pattern used for any attribute or element that represents a date.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.145.82