私はXMLを持っています
<?xml version="1.0" encoding="UTF-8"?>
<icestats>
<stats_connections>0</stats_connections>
<source mount="/live">
<bitrate>Some data</bitrate>
<server_description>This is what I want to return</server_description>
</source>
</icestats>
そして私はXSLを持っています
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:copy-of select="/icestats/source mount="/live"/server_description/node()" />
</xsl:template>
</xsl:stylesheet>
出力が欲しい
This is what I want to return
ソースから二重引用符、スペース、スラッシュを削除すると機能しますが、他の投稿で提案されている方法を使用しても、非標準文字をうまくエスケープできませんでした。
わかりやすくするために、以下はLego Stormtrooprのおかげで解決策です
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:copy-of select="/icestats/source[@mount='/live']/server_description/node()" />
</xsl:template>
</xsl:stylesheet>