Re: Apply Comment Position
| Newsgroups | gmane.text.xml.xsl.general.mulberrytech |
|---|---|
| Message-ID | <[email protected]> |
On 26.02.2021 07:22, Martin Honnen [email protected] wrote: > > > On 26.02.2021 06:13, Byomokesh Sahoo [email protected] wrote: >> Hi, >> >> Please look at the below xml, xslt and required output. I tried >> position function to get the comment inside <mail> in respective >> <ext-link>. I am facing a problem where ( <!--xmltex >> \gdef\EmailAuthIdDefnII{\MailAuthIdII}-->) refers to two <ext-link>. >> Could you please anyone help on this. > > > Which version of XSLT can you use? What defines a relation between a > comment "xmltext" and an "ext-link" element? Can't that just be solved by > > <xsl:template match="article-meta"> > > <xsl:copy> > > <xsl:for-each select="comment()[starts-with(., 'xmltext')] | > ext-link" group-starting-with="comment()"> > > <xsl:for-each select="tail(current-group())"> > > <cp id="{@id}"> > > <email> > > <xsl:copy-of select="node(), current-group()[1]"/> > > </email> > > </cp> > > </xsl:for-each-group> > > </xsl:copy> > > </xsl:template> > So that should have been <xsl:template match="article-meta"> <xsl:copy> <xsl:for-each-group select="comment()[starts-with(., 'xmltex')] | ext-link" group-starting-with="comment()"> <xsl:for-each select="tail(current-group())"> <cp id="{@id}"> <email> <xsl:copy-of select="node(), current-group()[1]"/> </email> </cp> </xsl:for-each> </xsl:for-each-group> </xsl:copy> </xsl:template> really, sorry, it seems without an editor I am not able to type well-formed and intended XSLT --~---------------------------------------------------------------- XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/3329386 or by email: [email protected] --~--