This is my source XML:
<DEFINITION>
<DEFINEDTERM>criminal proceeding</DEFINEDTERM>
<TEXT> means a prosecution for an offence and includes –</TEXT>
<PARAGRAPH>
<TEXT>a proceeding for the committal of a person for trial or sentence for an offence; and</TEXT>
</PARAGRAPH>
<PARAGRAPH>
<TEXT>a proceeding relating to bail –</TEXT>
</PARAGRAPH>
<TEXT>but does not include a prosecution that is a prescribed taxation offence within the meaning of Part III of the Taxation Administration Act 1953 of the Commonwealth;</TEXT>
</DEFINITION>
This is my XSL:
<xsl:template name="DEFINITION" match="DEFINITION">
<xsl:element name="body">
<xsl:attribute name="break">before</xsl:attribute>
<xsl:element name="defn">
<xsl:attribute name="id" />
<xsl:attribute name="scope" />
<xsl:value-of select="DEFINEDTERM" />
</xsl:element>
<xsl:element name="text">
<xsl:value-of select="replace(TEXT[1],'–','--')" />
</xsl:element>
</xsl:element>
<xsl:apply-templates select="*[not(self::TEXT[1])]" />
</xsl:template>
As per my XSL, I want to do something with the DEFINEDTERM element and the TEXT element that immediately follows it.
Then I want to apply-templates to the rest of the elements, except for the DEFINEDTERM and TEXT element that have already been dealt with. Most importantly, I don't want to apply templates to the first TEXT element.
How do I achieve this, because my XSL above does not work.
I have other templates for TEXT and PARAGRAPH, but not DEFINEDTERM. I have <xsl:template match="*|@*" /> at the top of the XSL.