xsl-list
[Top] [All Lists]

Re: [xsl] Xslt Doubt

2010-09-27 06:45:42
chirag matkar wrote:

I have four string-name nodes, 2 nodes  before edited by and 2 nodes
after edited by
 I want to match template mixed-citation and pass elements in such a
way that initial 2 string-name nodes are given separate tagging than
final two string-name nodes.

such as
<naming>....</naming>,<naming>.....</naming>, edited by
<after-naming>....</after-naming>,<after-naming>.....</after-naming>
Any Idea?

  <xsl:template match="mixed-citation">
<xsl:variable name="ed" select="text()[normalize-space() = ',edited by']"/> <xsl:apply-templates select="$ed/preceding-sibling::string-name" mode="before"/>
    <xsl:apply-templates select="$ed"/>
<xsl:apply-templates select="$ed/following-sibling::string-name" mode="after"/>
  </xsl:template>

  <xsl:template match="string-name" mode="before">
    <naming>
      <xsl:apply-templates/>
    </naming>
  </xsl:template>

  <xsl:template match="string-name" mode="after">
     <after-naming>
       <xsl:apply-templates/>
     </after-naming/>
  </xsl:template>


--

        Martin Honnen
        http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>