<?xml version="1.0" encoding="UTF-8"?> <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <define name="pattern1"> <data type="string"> <param name="pattern">-?([0-9]+(\.[0-9]*)?|\.[0-9]+)</param> </data> </define> <start> <element name="elem1"> <attribute name="attr1"> <list> <ref name="pattern1"/> </list> </attribute> </element> </start> </grammar>