【发布时间】:2018-10-11 19:38:55
【问题描述】:
我的工作正常,但我想知道是否有办法将子字符串 fx 嵌套在 contains 函数中
XML:
<patientRole>
<telecom use="HP" value="tel:555-555-2004" />
<telecom use="HP" value="mailto:aaeveryman@email.com" />
工作 XSLT:
<xsl:variable name="PtTelecom" select="ClinicalDocument/recordTarget/patientRole/telecom/@value"/>
<xsl:variable name="PtPhoneNumber" select="$PtTelecom[contains(., 'tel')]"/>
<xsl:variable name="PtPhoneNumberFormat" select="substring-after($PtPhoneNumber, 'tel:')"/>
<xsl:variable name="PtEmail" select="$PtTelecom[contains(., 'mailto')]"/>
<xsl:variable name="PtEmailFormat" select="substring-after($PtEmail, 'mailto:')"/>
它可以嵌套像我想要子字符串之后的东西吗 tel: 如果它包含 tel:
<xsl:variable name="PtPhoneNumber" select="substring-after(contains($PtTelecom, 'tel'), 'tel:')"/>
<xsl:variable name="PtEmail" select="substring-after(contains($PtTelecom, 'mailto'), 'mailto:')"/>
这没有返回任何值,所以我觉得a)它不能嵌套或b)我有问题。任何帮助表示赞赏
【问题讨论】:
标签: xml function xslt nested contains