0
xml属性とテキストノードをすべて調べて、リストから文字の存在を識別し、一致しなかった文字値を出力する必要があります。すべてのノードと属性で一致しない値を特定する:XSLT2.0
text()ノードを確認できますが、属性のチェックを実行できません。
<xsl:template match="@*|node()">
<xsl:variable name="getDelimitersToUseNodes" select="('$' ,'#' ,'*' ,'~')[not(contains(current(),.))]"/>
<xsl:variable name="getDelimitersToUseAttr" select="string-join(('$','#','*','~')[not(contains(@*/,.))],',')"/>
<xsl:variable name="getDelimitersToUse" select="concat(string-join($getDelimitersToUseNodes,','),',',string-join($getDelimitersToUseAttr,','))"/>
<!--xsl:variable name="delim" select="distinct-values($getDelimitersToUse,',')"/-->
<xsl:value-of select="$getDelimitersToUse"/>
</xsl:template>
マイアップ嘲笑サンプルファイルには、あなたはすべてのそれらのテキストおよび属性ノードを処理し、以前のように、同じチェックを作ることができ
<?xml version="1.0"?>
<sample>
<test1 name="#theGoofy">My$#test</test1>
<test2 value="$#@">description test2*</test2>
</sample>
ありがとうございます。私の出力は、ファイルにないカンマで区切られた別個の値を含む変数になります。上記の場合、 '〜'が出力され、XSLTの出力として渡されます。 – ChipsnCoke
@ChipsnCoke、テキストまたは属性ノードに含まれていないすべての文字を一度に出力しようとする2番目のサンプルを追加しました。 –
これは美しく動作します。ありがとうございました!!。 $ cの仕組みを教えてください。私はこのように定義して使用したことはありません。 – ChipsnCoke