|
Subject: Re: the "~" operator (was Re: [xsl] Add id to next element) From: "John Lumley john@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 23 May 2022 13:40:58 -0000 |
<body>
<p/>
<p outputclass="foo bar"/>
<p outputclass="foo BAZ"/>
</body>
<xsl:template match="p">
<xsl:copy>
<xsl:attribute name="outputclass"
select="tokenize(@outputclass, '\s+')
=> mine:add_value('BAZ')
=> distinct-values()
=> string-join(' ')"/>
<xsl:apply-templates select="node()|(@* except @outputclass)"/>
</xsl:copy>
</xsl:template>
<xsl:template match="p/@outputclass[not(contains-token(.,'BAZ'))]>
B B B <xsl:attribute name="{name(.)}" select=". || ' BAZ'"/>
</xsl:template> <xsl:template match="p">
<xsl:copy>
B B B <xsl:apply-templates select="@*,node()" mode="#current"/>
</xsl:copy>
</xsl:template>-- *John Lumley* MA PhD CEng FIEE john@xxxxxxxxxxxx
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: the "~" operator (was Re: [xsl], Chris Papademetrious | Thread | [xsl] output the result of the tran, Wolfhart Totschnig w |
| Re: the "~" operator (was Re: [xsl], Chris Papademetrious | Date | [xsl] output the result of the tran, Wolfhart Totschnig w |
| Month |