2

以前は機能していた xslt がありますが、変換中にノードを「スキップ」するようになり、その理由がわかりません。以下は、実行できるように編集された xslt のごく一部です。

  <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="xs fn" xmlns:com="http://enrollmentservices.humana.com/V2.0/common" xmlns:ent="http://enrollmentservices.humana.com/V2.0/enrollmententities" xmlns:pro="http://enrollmentservices.humana.com/V2.0/product" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pcext="http://enrollmentservices.humana.com/Policy/V2.0/PolicyExtract">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <xsl:variable name="_PolicyPath" select="PolicyExtract/ContractLineOfCoverageList/ContractLineOfCoverage"/>
        <PolicyExtract>
            <xsl:copy-of select="pcext:TotalRecordCount"/>
            <ContractLineOfCoverageList>

            </ContractLineOfCoverageList>
        </PolicyExtract>
    </xsl:template>
</xsl:stylesheet> 

私が欲しいノードはまだあります.

<?xml version="1.0" encoding="utf-8"?>
<PolicyExtract xmlns:ent="http://enrollmentservices.humana.com/V2.0/enrollmententities" xmlns:pcext="http://enrollmentservices.humana.com/Policy/V2.0/PolicyExtract" xmlns:pro="http://enrollmentservices.humana.com/V2.0/product" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><pcext:TotalRecordCount>4</pcext:TotalRecordCount><ContractLineOfCoverageList></ContractLineOfCoverageList></PolicyExtract>

TotalRecordCount は考慮されますが、転送されません。デバッガーでも試してみましたが、その行をスキップします。

何か案は?

4

1 に答える 1

2

xsl:copy-ofステートメントを次から変更します

<xsl:copy-of select="pcext:TotalRecordCount"/>

これに

<xsl:copy-of select="PolicyExtract/pcext:TotalRecordCount"/>

要素をコピーするにはpcext:TotalRecordCount

<?xml version="1.0" encoding="UTF-8"?>
<PolicyExtract xmlns:com="http://enrollmentservices.humana.com/V2.0/common"
               xmlns:ent="http://enrollmentservices.humana.com/V2.0/enrollmententities"
               xmlns:pro="http://enrollmentservices.humana.com/V2.0/product"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:pcext="http://enrollmentservices.humana.com/Policy/V2.0/PolicyExtract">
   <pcext:TotalRecordCount>4</pcext:TotalRecordCount>
   <ContractLineOfCoverageList/>
</PolicyExtract>
于 2013-10-29T20:07:45.967 に答える