2016-04-11 4 views
0

XSLTを作成していますが、以下のエラーが発生しています。XTRE1500エラーの取得

XSLT 2.0 Debugging Error: Error: file:///C:/Users/u0138039/Desktop/Proview/SG/2016/SICC/XML/XSLT/chapters.xsl:5: Specified URI 'file:///C:/Users/u0138039/Desktop/Proview/SG/2016/SICC/XML/XSLT/chapters.xsl' is already used for writing - Details: -  XTRE1500: Cannot write to an external resource and read from the same resource during a single transformation 

私は最近、1私のprevioysで、私のマシンを変更し、何の問題が、ありませんでした私の現在のシステムでは、私はこのエラーを取得しています。

は、エラーは、以下のように私はこれを使用して私のプログラムで

<xsl:variable name="ThisDocument" select="document('')"/> 

でスローされます。

<xsl:variable name="d"> 
      <xsl:value-of select="concat('toc-item-',$ThisDocument//ntw:nums[@num=$nu]/@word,'-level')"/> 
     </xsl:variable> 

そして、ntwsは以下のとおりです。

<!-- Namespace ntw--> 
<ntw:nums num="1" word="first"/> 
<ntw:nums num="2" word="second"/> 
<ntw:nums num="3" word="third"/> 
<ntw:nums num="4" word="forth"/> 
<ntw:nums num="5" word="fifth"/> 
<ntw:nums num="6" word="sixth"/> 
<ntw:nums num="7" word="seventh"/> 
<ntw:nums num="8" word="eighth"/> 
<ntw:nums num="9" word="nighth"/> 
<ntw:nums num="10" word="tenth"/> 
<!-- Namespace ntw ends --> 

ここは私の完全なXSLTです。 http://xsltransform.net/3NJ391b

私はAltova XML Spyを使用しています。

私はどこが間違っているのか、どうすればこの問題を解決できるか教えてください。

おかげで、 ラケッシュ

答えて

1

あなたは新しいマシンにそのエラーを取得している理由はわからないではなく、あなたの古いマシン。変換がどのように実行されているか、XML Spyのバージョンが異なる可能性があります。問題を再現することができないと言うのが難しい。

お試しいただけることは、document('')を使用しないことです。これは、XSLT 2.0を使用しているので必要ではありません。

ThisDocument変数に直接ごntw:nums要素を移動してみてください:

<xsl:variable name="ThisDocument"> 
    <ntw:nums num="1" word="first"/> 
    <ntw:nums num="2" word="second"/> 
    <ntw:nums num="3" word="third"/> 
    <ntw:nums num="4" word="forth"/> 
    <ntw:nums num="5" word="fifth"/> 
    <ntw:nums num="6" word="sixth"/> 
    <ntw:nums num="7" word="seventh"/> 
    <ntw:nums num="8" word="eighth"/> 
    <ntw:nums num="9" word="nighth"/> 
    <ntw:nums num="10" word="tenth"/>  
</xsl:variable> 

あなたはそれが働いて確認したら、変数と参照の名前を変更したい場合があります。 as="element()+"を追加して使い方を変更すると、もう少し具体的になると思います。

<xsl:variable name="nums" as="element()+"> 
    <ntw:nums num="1" word="first"/> 
    <ntw:nums num="2" word="second"/> 
    <ntw:nums num="3" word="third"/> 
    <ntw:nums num="4" word="forth"/> 
    <ntw:nums num="5" word="fifth"/> 
    <ntw:nums num="6" word="sixth"/> 
    <ntw:nums num="7" word="seventh"/> 
    <ntw:nums num="8" word="eighth"/> 
    <ntw:nums num="9" word="nighth"/> 
    <ntw:nums num="10" word="tenth"/>  
</xsl:variable> 

交換d変数のため:

<xsl:variable name="d"> 
    <xsl:value-of select="concat('toc-item-',$nums[@num=$nu]/@word,'-level')"/> 
</xsl:variable> 
ここ

交換ThisDocument変数のために...私はどうなるのかの一例です