xslt为列名添加标题

时间:2017-07-14 13:04:28

标签: html xslt xslt-1.0 xslt-2.0

嘿,我有一个问题。

 <table border="1">
      <xsl:variable name="items" select="$xsd//xs:complexType[@name = 'ONDType']/node()/attribute::*[1]"/>
      <tr bgcolor="#9acd32">
        <xsl:for-each select="$items">
          <td title='$x'>
            <xsl:value-of select="."/>
          </td>
        </xsl:for-each>
      </tr>

我需要在表格中添加标题,但我想添加的标题是变量(x),我不知道如何处理它。

try {
                if (!mVideoView.isPlaying()) {
                    Uri uri = Uri.parse(videoURL);
                    mVideoView.setVideoURI(uri);
                    mVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                        @Override
                        public void onCompletion(MediaPlayer mp) {

                        }
                    });
                } else {
                    mVideoView.pause();
                }
            }catch (Exception ex){

            }
            mVideoView.requestFocus();
            mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mp) {
                    mProgressDialog.dismiss();
                    mp.setLooping(true);
                    mVideoView.start();
                }
            });

如果我运行此代码我得到标题$ x,但我想得到MY_TITLE

1 个答案:

答案 0 :(得分:0)

尝试:

<td title="{$x}">

要了解其工作原理,请阅读attribute value templates