<xoe:documents xmlns:xoe="http://xxxxxx" count="1">
<xocs:doc xmlns:xocs="xxxxxx" xmlns:xsi="yyyyyyy" xsi:schemaLocation="zzzzzz">
<xocs:meta>...</xocs:meta>
<xocs:serial-item>
<!-- this line -->
<article xmlns:sa="www.google.hgy" xmlns="http://www.xyzq1.org/xml/ja/dtd" version="5.4" xml:lang="pl" docsubtype="rev">
<article-info>
</article-info>
</article>
</xocs:serial-item>
</xocs:doc>
</xoe:documents>
我無法獲得'xml:lang'屬性的值。甚至認爲我與下面的XPath無法獲得'xml:lang'屬性的值
<xsl:variable name="rootPath" select="/xoe:documents/xocs:doc/xocs:serial-item"/>
<xsl:variable name="lang" select="$rootPath/ja:article[@xml:lang]"/>
or
<xsl:variable name="lang" select="$rootPath/ja:article/@xml:lang"/>
這裏試圖JA是我的XSLT代碼
xmlns:ja="http://www.xyzq1.org/xml/ja/dtd"
有人能幫幫已經定義?
在您的示例XML中,「article」位於「www.yahoo.mkt」命名空間中,而不是「http:// www.xyzq1.org/xml/ja/dtd」。 – JLRishe
謝謝,我改變了。仍然沒有結果。 –