问题
I've the below XML line.
<toc-title>1. <content-style>Short title</content-style></toc-title>
here i wanted to apply templates on substring-after 1.
I tried the below XSLT.
<xsl:template match="toc-title/text()" mode="x">
<xsl:analyze-string select="substring-after(.,' ')" regex="([a-z]+)">
<xsl:matching-substring>
<xsl:apply-templates select="regex-group(1)" mode="x"/>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="."/>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>
<xsl:template match="text()" mode="x">
</xsl:template>
but when i run this it throws the below error.
XSLT 2.0 Debugging Error: Error: file:///C:/Users/u0138039/Desktop/FLPHK_CHAP.xsl:239: Not a node item - item has type xs:string with value 'title' - Details: - XTTE0520: The result of evaluating the 'select' attribute of the <xsl:apply-templates> instruction may only contain nodes
I'm, unable to how to do this. please help me on fixing it.
Thanks
来源:https://stackoverflow.com/questions/27165917/apply-templates-select-substring-after