0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

個人的「質はともかく継続する」35日目です。

copy-ofとvalue-ofのちがい

こんなxmlから、descriptionの値を取得することを考えてみます。

<person>
  <name>しぶさわ えいいち</name>
  <age>30</age>
  <description>すごい<br>実業家</description>
</person>

value-ofの場合

value-ofの場合、タグは無視されて、値だけ取り出されます。
この例の場合、間にある
も出力されません。
名前の通り、valueのみ取り出すイメージです。

<xsl:value-of select="person/description"/>
すごい実業家

copy-ofの場合

copy-ofの場合は、ノード全体を取り出します。
この例で言えば、前後や中にあるタグもそのまま出力されます。
こちらも名前の通り、copyするイメージです。

<xsl:copy-of select="person/description"/>
<description>すごい<br>実業家</description>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?