xmltransformを使用して外部xlstファイルを使用してxmlを変換するAppleScriptがあります。xsltファイルによって取得される変数をapplescriptに追加したいと思います。satimageディクショナリは、xmltransformの一部としてのxsl paramsの使用について説明していますが、例が見つかりません。
テンプレートを使用してXMLTransform xmlFile with xsltFile in outputpath
、applescriptと次のxslファイルの例の両方で変数をどのように定義しますか。
<xsl:stylesheet version="1.0">
<xsl:param name="vb1" value="'unknown'"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="xmeml/list/name">
<xsl:value-of select="{$vb1}"/>
</xsl:template>
</xsl:stylesheet>
Applescriptスニペット
set vb1 to "Hello" as string
XMLTransform xmlFile with xsltFile1 in outputpathtemp xsl params vb1
現在のapplescriptは、「vb1をレコードにできません」を返します。
私は今、以下を使用することを検討していますが、XMLでNULLを返しています
set vb1 to {s:"'hello'"}
XMLTransform xmlFile with xsltFile1 in outputpathtemp xsl string params vb1
入力は
<xmeml>
<list>
<name>IMaName</name>
<!-- other nodes -->
</list>
</xmeml>
現在の出力は
<xmeml>
<list>
<name/>
<!-- other nodes -->
</list>
</xmeml>
誰か助けてもらえますか?どうもありがとう。