1 <?xml version="1.0" encoding="UTF-8"?> 2 <grammar 3 xmlns="http://relaxng.org/ns/structure/1.0" 4 xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" 5 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> 6 7 <define name="pattern1"> 8 <data type="string"> 9 <param name="pattern">-?([0-9]+(\.[0-9]*)?|\.[0-9]+)</param> 10 </data> 11 </define> 12 13 <start> 14 <element name="elem1"> 15 <attribute name="attr1"> 16 <list> 17 <ref name="pattern1"/> 18 </list> 19 </attribute> 20 </element> 21 </start> 22 23 </grammar> 24