私はシンプルなプレーンテキスト文字列に結果を変換するXSLスタイルシートを書くためにしようとしている、と私はChromeとOperaので次ののエラーを取得しています:nginxでXSL変換されたスタイルシートに "text/plain"出力を得るには?
このページは以下のエラーが含まれています
1行目の1列目のエラー:ドキュメントの末尾の余分な内容 以下は、最初のエラーまでのページのレンダリングです。
この文書は、XSL変換の結果として作成されたものです。与えられた行番号と列番号は、変換された結果からのものです。
Firefoxの場合はでも問題ありません。
なぜですか?
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="rtmp"/>
</xsl:template>
<xsl:template match="rtmp">
<xsl:apply-templates select="server"/>
</xsl:template>
<xsl:template match="server">
<xsl:apply-templates select="application"/>
</xsl:template>
<xsl:template match="application">
<xsl:apply-templates select="live"/>
</xsl:template>
<xsl:template match="live">
<xsl:apply-templates select="stream"/>
</xsl:template>
<xsl:template match="stream">
<xsl:choose>
<xsl:when test="publishing"><xsl:value-of select="name"/>:<xsl:value-of select="nclients - 1"/>,
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
とnginxのconfには、次のとおりです:
XSLです
location /live {
rtmp_stat all;
rtmp_stat_stylesheet live.xsl;
include mime.types;
default_type text/plain;
}
location /live.xsl {
root /usr/local/nginx/html/;
}
目的はnginx RTMP moduleから結果を取得するために実際にあります。
Firefoxページで[ページ情報の表示]を開き、タイプが「text/xml」です。私はそれを "テキスト/プレーン"として表示させることができれば、問題を解決すると思います。しかしどうですか?これはnginxやXSLスタイルシートで設定できますか?
ステータスが200のテキスト/プレーンストリングを受信したいとします。
お試しください。https://stackoverflow.com/a/44218015/6229548 –