0

XML ドキュメントの表示をカスタマイズする CSS を作成しています。基本的に、子要素の表示をカスタマイズして、HTML OL/UL/LI 要素と同様にレンダリングしたいと考えています。

私のXMLは次のように構成されています:

 <?xml version="1.0"?>
 <?xml-stylesheet type="text/css" href="style.css"?>
 <transcription>
      <turn>
          <speaker>Speaker Name</speaker>
          <clause>
              text here
          </clause>
          <clause>
              one or  more clauses
          </clause>
      </turn>
  </transcription>

私のCSSは次のようになります。

turn {
    counter-reset: item;
}

turn clause {
    display:list-item;
}

clause  {
    content: counter(item);
    counter-increment: item;
}

私はこのサイトを使用しています: http://www.xml.com/lpt/a/401と基本的に同様のドキュメントがあります http://www.xml.com/2000/03/29/tutorial/examples/display1.xml、問題は、display1.xml が firefox で機能しないことです。IE、Safari、Chromeなどで動作します。

他のブラウザーと同様に、Firefox で機能するリンクまたは機能を提供できますか?

4

1 に答える 1

1

firefox が display: list-item プロパティを実装する方法、特にカウンター値の受け渡しにバグがあるようです。これにより、Firefoxでは表示されるがクロムでは表示されないゼロが発生すると思います。

私の回避策は、「display: list-item」の使用を忘れて、代わりにアイテムを直接スタイルして、リストとして表示することです。

transcription {
      counter-reset: item;
}

clause {
      display:block; 
      margin-left:40px; 
}

clause:before  {
      counter-increment: item;
      content: counter(item)  ". ";
}

これは次の XML で機能します。

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="style2.css"?>
<transcription>
    <turn>
    <speaker>Speaker Name</speaker>
    <clause>
        text here
    </clause>
    <clause>
        text here
    </clause>
    <clause>
        text here
    </clause>
</turn>

乗り方を教えて...

アル

于 2010-07-20T14:56:49.980 に答える