I am new to working with xsl. I need to loop through some xml elements : "telecom" and for each one I need to search if it contains tel if it does assign it to PtPhoneNumber variable. Then if it contains mailto assign that to PtEmail.
Here is the XML:
<recordTarget>
<patientRole>
<telecom use="HP" value="tel:555-555-2004"></telecom>
<telecom use="HP" value="mailto:aaeveryman@email.com"></telecom>
Here is my XPath for loop and if statements:
<xsl:variable name="Telecom" select="ClinicalDocument/recordTarget/patientRole/telecom/@value"/>
<xsl:for-each select="Telecom">"
<xsl:if test = "contains(Telecom,'tel')">
<xsl:variable name="PtPhoneNumber"/>
</xsl:if>
<!--<xsl:if test=(fn:contains('mail',''))>
<xsl:variable name="PtEmail"/>
</xsl:if>-->
</xsl:for-each>
Wondering if someone can help me why this syntax and if it is possible