1
我正在使用已知書籍的示例。Eclipse從xsl生成空xml輸出轉換
XML輸入:對於轉型
<?xml version="1.0" encoding="UTF-8"?>
<reference>
<body>
<title>xsl:stylesheet</title>
<purpose>
<p>The root element of a stylesheet.</p>
</purpose>
<usage>
<p>The <element>stylesheet</element> is always the root element, even if
a stylesheet is included in, or imported into, another. It must have a
<attr>version</attr> attribute, indicating the version of XSLT that the
stylesheet requires.</p>
<p>For this version of XSLT, the value should normally be "2.0". For a
stylesheet designed to execute under either XSLT 1.0 or XSLT 2.0, create a core
module for each version number; then use <element>xsl:include</element> or
<element>xsl:import</element> to incorporate common code, which should specify
<code>version="2.0"</code> if it uses XSLT 2.0 features, or
<code>version="1.0"</code> otherwise.</p>
<p>The <element>xsl:transform</element> element is allowed as a synonym.</p>
<p>The namespace declaration <code>xmlns:xsl="http//www.w3.org/1999/XSL/
Transform</code> by convention uses the prefix <code>xsl</code>.</p>
<p>An element occurring as a child of the <element>stylesheet</element>
element is called a declaration. These top-level elements are all optional, and
may occur zero or more times.</p>
</usage>
</body>
</reference>
簡單的,空的XSL文件:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
</xsl:stylesheet>
當運行上述Eclipse的霓虹燈,(通過選擇這兩個文件,並選擇了Run As -> XSL Transformation
我得到一個空的XML文件(雖然很明顯,它應該輸出所有的文本節點(如從this online tool輸出)
什麼是錯?
你想知道爲什麼你的樣式表沒有在沒有定義模板的情況下評估僅用於輸出文本的內置規則嗎? [內置模板規則](https://www.w3.org/TR/xslt#built-in-rule)或者您是否希望以更合適的方式獲取文本輸出? – uL1
在你的'''中加入''並通過Eclipse Neon執行。 –
uL1
您顯然正在使用不符合標準的XSLT處理器。你能更準確地識別它嗎? http://stackoverflow.com/questions/25244370/how-can-i-check-which-xslt-processor-is-being-used-in-solr/25245033#25245033 –