簡體   English   中英

未定義value-of的命名空間前綴xsl

[英]Namespace prefix xsl on value-of is not defined

我必須轉換xml2xml。 我有一個XSLT文件,該文件可以與其他XML文件一起正常工作,並且將其調整為適合以下文件(僅是測試文件):

<?xml version="1.0" encoding="UTF-8"?>
<invoice:request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:invoice="http://www.xmlData.ch/xmlInvoice/XSD" 
  xsi:schemaLocation="http://www.xmlData.ch/xmlInvoice/XSD 
  MDInvoiceRequest_400.xsd" role="production">

  <invoice:prolog>
    <invoice:package>Handy patients</invoice:package>
    <invoice:software>Handy patients</invoice:software>
    <invoice:validator>tarmedValidator100 ATL Module Copyright © by Suva &amp; santésuisse</invoice:validator>
  </invoice:prolog>

  <invoice:invoice invoice_id="23">
    <invoice:balance>
      <invoice:vat>0.00</invoice:vat>
    </invoice:balance>
    <invoice:detail>
      <invoice:services>
        <invoice:record_tarmed>Prestation médicale en l'absence du patient (y compris étude de dossier), par période de 5 min
        </invoice:record_tarmed>
        <invoice:record_tarmed>Rapport médical sur formulaire assurance-maladie, {AA}, {AM}/Rapport intermédiaire/Feuille annexe sur formulaire {AI}
        </invoice:record_tarmed>
       </invoice:services>
     </invoice:detail>
   </invoice:invoice>

然后是XSLT文件:

    <?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/2001/XMLSchema-instance">

  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

  <xsl:template match="invoice:request">
    <xsl:copy>
      <xsl:for-each-group select="invoice:invoice " group-by="@invoice_id">
        <xsl:element name="Facture">
          <xsl:for-each select="current-group()">
            <xsl:element name="Package">
              <xsl:value-of select="../invoice:prolog/invoice:package"/>
            </xsl:element>
          </xsl:for-each>
        </xsl:element>
      </xsl:for-each-group>
    </xsl:copy>
  </xsl:template>

 </xsl:stylesheet>

我有一個警告:不可能的轉換器:第13行第28欄錯誤:未定義value-of上的命名空間前綴xsl

我能做什么 ?

首先更改:

xmlns:xsl="http://www.w3.org/2001/XMLSchema-instance"

至:

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

但是您還有許多其他問題,此更正將暴露出來。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM