The extention syntax attribute extends
specifies
a parent class name for a target class.
The extends
attribute takes a string value
for a Java class name of a parent class.
A base class of the target class will be the Java class
specified by the extends
attribute.
List 8.7.3.1[grammarExtends.rng] is a sample schema for
the extends
attribute.
A element has the extends
attribute
which has value 'MyBase
'.
<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:java="http://www.relaxer.org/xmlns/relaxer/java" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> <ref name="account"/> </start> <define name="account"> <element name="account"> <attribute name="accountNo"> <data type="token"/> </attribute> <element name="balance"> <data type="int"/> </element> <element name="owner"> <data type="token"/> </element> <ref name="address"/> <zeroOrMore> <ref name="phone"/> </zeroOrMore> </element> </define> <define name="address"> <element name="address" java:extends="MyBase"> <attribute name="zip"> <data type="token"/> </attribute> <text/> </element> </define> <define name="phone"> <element name="phone"> <attribute name="area"> <data type="token"/> </attribute> <data type="token"/> </element> </define> </grammar>