存在XML元素,這可能是一個非常簡單的答案,但我的生活,我不能弄明白。測試如果XSLT
我要顯示,這取決於正在顯示的子元素,但我不知道如何測試我想要的元素某些內容。我想看看如果啓動,停止和記元素存在
<xsl:template match="protocol[@id=$protocolNumber]">
<h4><xsl:value-of select="$sectionNumber"/>.<xsl:value-of select="@id"/> <xsl:value-of select="@title"/></h4>
<p>
<xsl:for-each select="child::*">
<xsl:choose>
<xsl:when test="start">
<span id="start"><xsl:value-of select="start[@level]" /></span>
</xsl:when>
<xsl:when test="stop">
<span id="stop"><xsl:value-of select="stop[@level]" /></span>
</xsl:when>
<xsl:when test="note">
<span id="note"><xsl:value-of select="note[@title]" />: <xsl:value-of select="note/text()" /></span>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="text()"/><br/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</p>
<protocol id="2" title="Post-Conversion Of VF/VT">
<note title="criteria">Post-conversion treatment of VF or VT should only be started if the patient has regained a pulse of adequate rate, and has a supraventricular rhythm. If not, refer to other cardiac protocols as appropriate. All antiarrhythmics are contraindicated if ventricular escape rhythm is present.</note>
<start level="All Levels"/>
<step>Routine medical care.</step>
<stop level="EMT"/>
<stop level="EMT-I"/>
<start level="EMT-CC & P"/>
<step>
If conversion results from defibrillation without any drug therapy:<br/><br/>
Amiodarone (Cordarone) 150 mg IV/IO Slow IV
</step>
<step>If Amiodarone was the drug resulting in conversion from VF/VT, no additional antiarrhythmic is required.</step>
<step>
If Lidocaine (Xylocaine) was the drug resulting in conversion from VF/VT:<br/><br/>
Repeat Lidocaine bolus 0.75 mg/kg IV/IO every 10 minutes up to a total cumulative dose of 3 mg/kg.
</step>
<step>If more than above listed doses are needed because of length of transport time, contact Medical Control.</step>
</protocol>
也許你在想的? –
kurosch
2009-10-28 21:23:33