2012-02-21 5 views

答えて

1

あなたの問題へのサンプル溶液:

<?xml version="1.0" encoding="UTF-8"?> 
<grammar xmlns="http://relaxng.org/ns/structure/1.0" 
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> 
    <start> 
     <ref name="testDef"/> 
    </start> 
    <define name="testDef"> 
     <element name="test"> 
      <ref name="commonAttributes"/> 
     </element> 
    </define> 
    <define name="commonAttributes"> 
     <attribute name="id"> 
      <data type="ID"/> 
     </attribute> 
     <attribute name="otherCommonAttr"> 
      <data type="string"/> 
     </attribute> 
    </define> 
</grammar> 

あなたは上記の例の要素testでのように、各要素に共通の属性の定義への参照を宣言する必要があります。

関連する問題